Documentation ¶
Index ¶
- func GetRegisteredRoundTripperFactoryInitializers() map[AuthType]RoundTripperFactoryInitFunc
- func GetRoundTripper(c *ClientAuth, next http.RoundTripper, ...) (http.RoundTripper, error)
- func RegisterRoundTripperInitializer(authType AuthType, initFunc RoundTripperFactoryInitFunc)
- type AuthType
- type ClientAuth
- type RoundTripperFactory
- type RoundTripperFactoryInitFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRegisteredRoundTripperFactoryInitializers ¶
func GetRegisteredRoundTripperFactoryInitializers() map[AuthType]RoundTripperFactoryInitFunc
func GetRoundTripper ¶
func GetRoundTripper(c *ClientAuth, next http.RoundTripper, initializers map[AuthType]RoundTripperFactoryInitFunc, ) (http.RoundTripper, error)
func RegisterRoundTripperInitializer ¶
func RegisterRoundTripperInitializer(authType AuthType, initFunc RoundTripperFactoryInitFunc)
RegisterRoundTripperInitializer registers a authRoundTripper initializer function for a specific prometheus AuthType, the function will be called when the prometheus client is created. The function should return a RoundTripperFactory for the prometheus AuthType. If the function is called multiple times for the same AuthType, the last one will be used.
Types ¶
type ClientAuth ¶
ClientAuth holds the HTTP client identity info.
type RoundTripperFactory ¶
type RoundTripperFactory interface {
GetAuthRoundTripper(c *ClientAuth) (http.RoundTripper, error)
}
func NewBasicAuthRoundTripperProvider ¶
func NewBasicAuthRoundTripperProvider(next http.RoundTripper) (RoundTripperFactory, error)
func NewTokenAuthRoundTripperProvider ¶
func NewTokenAuthRoundTripperProvider(next http.RoundTripper) (RoundTripperFactory, error)
type RoundTripperFactoryInitFunc ¶
type RoundTripperFactoryInitFunc func(next http.RoundTripper) (RoundTripperFactory, error)
RoundTripperFactoryInitFunc is the function to initialize a authRoundTripper
Click to show internal directories.
Click to hide internal directories.