MCPcopy Create free account
hub / github.com/zalando/skipper / WithBearerToken

Function WithBearerToken

net/httpclient.go:509–513  ·  view source on GitHub ↗

WithBearerToken adds an Authorization header with "Bearer " prefix and add the given bearerToken as value to all requests. To regular update your token you need to call this method and use the returned Transport.

(t *Transport, bearerToken string)

Source from the content-addressed store, hash-verified

507// update your token you need to call this method and use the returned
508// Transport.
509func WithBearerToken(t *Transport, bearerToken string) *Transport {
510 tt := t.shallowCopy()
511 tt.bearerToken = bearerToken
512 return tt
513}
514
515func (t *Transport) shallowCopy() *Transport {
516 return &Transport{

Callers 2

ExampleTransportFunction · 0.92
TestTransportFunction · 0.85

Calls 1

shallowCopyMethod · 0.80

Tested by 2

ExampleTransportFunction · 0.74
TestTransportFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…