Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEgressClient ¶
func NewEgressClient(httpAddr, uaaAddr, uaaClientId, uaaClientSecret string) (prom_versioned_api_client.API, error)
Types ¶
type EgressClient ¶
type EgressClient struct {
// contains filtered or unexported fields
}
EgressClient sets the "Authorization" header of any outgoing request. It gets a JWT from the configured Oauth2 server. It only gets a new JWT when a request comes back with a 401.
func (*EgressClient) Do ¶
Do implements HTTPClient. It adds the Authorization header to the request (unless the header already exists). If the token is expired, it will reach out the Oauth2 server and get a new one. The given error CAN be from the request to the Oauth2 server.
Do modifies the given Request. It is invalid to use the same Request instance on multiple go-routines.
Click to show internal directories.
Click to hide internal directories.