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)
| 507 | // update your token you need to call this method and use the returned |
| 508 | // Transport. |
| 509 | func WithBearerToken(t *Transport, bearerToken string) *Transport { |
| 510 | tt := t.shallowCopy() |
| 511 | tt.bearerToken = bearerToken |
| 512 | return tt |
| 513 | } |
| 514 | |
| 515 | func (t *Transport) shallowCopy() *Transport { |
| 516 | return &Transport{ |
searching dependent graphs…