Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorization ¶
type Client ¶
type Client struct {
// Client is the HTTP Client used to communicate with the API.
// By default this uses http.DefaultClient, so there are no timeouts
// configured. It's recommended you set your own HTTP client with
// reasonable timeouts for your application.
Client HTTPDoer
// Client options allow the caller to configure various parts of the
// request.
Options Opts
// Services used for talking with different parts of the API
HTTPMethods HTTPMethodsService
// contains filtered or unexported fields
}
Client manages communication with the Example API.
type HTTPDoer ¶
HTTPDoer is used for making HTTP requests. This implementation is generally a *http.Client.
type HTTPMethodsService ¶
type HTTPMethodsService interface {
// Get retrieves a plan. If the plan does not exist,
// a nil plan and nil error are returned.
//
// https://dev.recurly.com/docs/lookup-plan-details
Get(ctx context.Context) (*HTTPBin, error)
}
HTTPMethodsService manages the interactions for httpbin http-methods.
type Headers ¶
type Headers struct {
XAPIVersion string `json:"x-api-version,omitempty"`
Authorization string `json:"authorization,omitempty"`
Accept string `json:"accept,omitempty"`
AcceptEncoding string `json:"accept-encoding,omitempty"`
AcceptLanguage string `json:"accept-language,omitempty"`
DNT string `json:"dnt,omitempty"`
Host string `json:"host,omitempty"`
Referer string `json:"referer,omitempty"`
UserAgent string `json:"user-agent,omitempty"`
}
type Opts ¶
type Opts struct {
// Host is the base url for requests.
Host *url.URL
// Set debug level for logging http calls in the client http sdk. Defaults to false
Debug bool
// Version (optional) can be set if a versioned api is preferred, ex: /v1/items vs /v2/items
Version string
// Authorization holds the auth token and prefix to build up the header
Authorization
}