MCPcopy Index your code
hub / github.com/subtrace/subtrace / WithToken

Function WithToken

rpc/rpc.go:25–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23type Option func(*http.Request)
24
25func WithToken() Option {
26 return func(r *http.Request) {
27 if val := os.Getenv("SUBTRACE_TOKEN"); val != "" {
28 r.Header.Set("authorization", fmt.Sprintf("Bearer %s", val))
29 }
30 }
31}
32
33func WithoutToken() Option {
34 return func(r *http.Request) {

Callers 2

dialSingleMethod · 0.92
rpc.goFile · 0.85

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected