Documentation ¶
Index ¶
- type Client
- type ClientOption
- func WithBaseURL(baseURL string) ClientOption
- func WithCacheFilePath(cacheFilePath string) ClientOption
- func WithCustomCacheValidity(duration time.Duration) ClientOption
- func WithDebugLogger(logFn LogFn) ClientOption
- func WithHTTPClient(doer HTTPRequestDoer) ClientOption
- func WithRequestEditorFn(fn aur.RequestEditorFn) ClientOption
- type HTTPRequestDoer
- type LogFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...ClientOption) (*Client, error)
type ClientOption ¶
ClientOption allows setting custom parameters during construction.
func WithBaseURL ¶
func WithBaseURL(baseURL string) ClientOption
WithBaseURL allows overriding the default base URL of the client.
func WithCacheFilePath ¶
func WithCacheFilePath(cacheFilePath string) ClientOption
func WithCustomCacheValidity ¶
func WithCustomCacheValidity(duration time.Duration) ClientOption
func WithDebugLogger ¶
func WithDebugLogger(logFn LogFn) ClientOption
func WithHTTPClient ¶
func WithHTTPClient(doer HTTPRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn aur.RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type HTTPRequestDoer ¶
Click to show internal directories.
Click to hide internal directories.