Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBearerToken ¶
WithBearerToken inserts the bearer token into the returned context which is based on the provided context. If this context is then used with the HTTP request in a client having the AuthenticatingRoundTripper as its transport, the round tripper will insert this token into the Authorization header of the request.
Types ¶
type AuthenticatingRoundTripper ¶
type AuthenticatingRoundTripper struct {
http.RoundTripper
}
AuthenticatingRoundTripper is a wrapper around an HTTP round tripper that add a bearer token from the context (if any) before performing the request using the wrapped round tripper.
type ExaminingRoundTripper ¶
type ExaminingRoundTripper struct { http.RoundTripper Examiner RoundTripExaminer }
ExaminingRoundTripper is an HTTP request round tripper that calls the Examiner after the request is made so that it can examine the request and response or turn it into an error.
type RoundTripExaminer ¶
RoundTripExaminer is interface enabling the implementors to examine the request and response during the roundtrip and potentially somehow modify them or turn them into error.