WithAuthToken returns a ClientOptionsFunc that sets the authentication token for a Client. If not set, the client will make unauthenticated requests.
(token string)
| 428 | // WithAuthToken returns a ClientOptionsFunc that sets the authentication token |
| 429 | // for a Client. If not set, the client will make unauthenticated requests. |
| 430 | func WithAuthToken(token string) ClientOptionsFunc { |
| 431 | return func(o *clientOptions) error { |
| 432 | if token == "" { |
| 433 | return errors.New("token must not be empty") |
| 434 | } |
| 435 | |
| 436 | o.token = &token |
| 437 | return nil |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | // WithURLs returns a ClientOptionsFunc that sets the base and upload URLs |
| 442 | // while only validating the URL format. Nil values will be ignored and default |
no outgoing calls
searching dependent graphs…