Documentation ¶
Index ¶
Constants ¶
View Source
const (
// UserAgentHeaderKey is the key for the User-Agent header.
UserAgentHeaderKey = "User-Agent"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around the Go stdlib http client.
func NewClient ¶
func NewClient() *Client
NewClient returns a new Client with its internal http client set to the default client.
func (*Client) GetWithContext ¶
func (c *Client) GetWithContext(ctx context.Context, url string, opts ...GetOptions) (*http.Response, error)
GetWithContext performs a Get request with the context provided.
type GetOptions ¶
func WithHeader ¶
func WithHeader(key, value string) GetOptions
func WithJSONAccept ¶
func WithJSONAccept() GetOptions
type HeaderOption ¶
HeaderOption is a function that sets a (key, value) pair in the headers map.
func WithAuthentication ¶
func WithAuthentication(key, token string) HeaderOption
func WithSlinkyVersionUserAgent ¶
func WithSlinkyVersionUserAgent() HeaderOption
type RoundTripperWithHeaders ¶
type RoundTripperWithHeaders struct {
// contains filtered or unexported fields
}
RoundTripperWithHeaders is a round tripper that adds headers to the request.
func NewRoundTripperWithHeaders ¶
func NewRoundTripperWithHeaders(next http.RoundTripper, headerOptions ...HeaderOption) *RoundTripperWithHeaders
NewRoundTripperWithHeaders creates a new RoundTripperWithHeaders.
Click to show internal directories.
Click to hide internal directories.