MCPcopy Create free account
hub / github.com/bluekeyes/patch2pr / NewTokenClient

Function NewTokenClient

internal/transport.go:18–25  ·  view source on GitHub ↗

NewTokenClient returns an [http.Client] that sets the bearer token in the Authorization header of all requests.

(token string)

Source from the content-addressed store, hash-verified

16// NewTokenClient returns an [http.Client] that sets the bearer token in the
17// Authorization header of all requests.
18func NewTokenClient(token string) *http.Client {
19 return &http.Client{
20 Transport: &tokenRoundTripper{
21 base: http.DefaultTransport,
22 token: token,
23 },
24 }
25}

Callers 2

prepareTestContextFunction · 0.92
mainFunction · 0.92

Calls

no outgoing calls

Tested by 1

prepareTestContextFunction · 0.74