Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
NewRequest wraps the standard http.NewRequestWithContext but also applies credentials when applicable.
Types ¶
type Credentials ¶
type Credentials interface {
// contains filtered or unexported methods
}
func BasicAuth ¶
func BasicAuth(username, password string) Credentials
BasicAuth generates a Credentials set which sets the supplied username and password via basic authentication.
func BearerToken ¶
func BearerToken(token string) Credentials
BearerToken sets the supplied token as a Authorization Bearer token on each request.
func FromHeader ¶
func FromHeader(key, value string) Credentials
FromHeader generates credentials which allow us to set the header key and value on the request.
func FromQueryString ¶
func FromQueryString(key, value string) Credentials
FromQueryString generates credentials where the key is assigned to the query string.
Click to show internal directories.
Click to hide internal directories.