Documentation
¶
Index ¶
- type APIURLRequestHook
- type AfterErrorContext
- type AfterSuccessContext
- type BeforeRequestContext
- type FailEarly
- type GlobalAPIURLRequestHook
- type HTTPClient
- type HTTPDumpRequestHook
- type HTTPDumpResponseErrorHook
- type HTTPDumpResponseHook
- type HookContext
- type Hooks
- func (h *Hooks) AfterError(hookCtx AfterErrorContext, res *http.Response, err error) (*http.Response, error)
- func (h *Hooks) AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error)
- func (h *Hooks) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)
- func (h *Hooks) SDKInit(baseURL string, client HTTPClient) (string, HTTPClient)
- type UserAgentPreRequestHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIURLRequestHook ¶
type APIURLRequestHook struct {
CustomDomain string
}
func (*APIURLRequestHook) BeforeRequest ¶
func (i *APIURLRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)
Replace `.konghq.com` with the custom domain set in the `KONG_CUSTOM_DOMAIN` environment variable.
type AfterErrorContext ¶
type AfterErrorContext struct {
HookContext
}
type AfterSuccessContext ¶
type AfterSuccessContext struct {
HookContext
}
type BeforeRequestContext ¶
type BeforeRequestContext struct {
HookContext
}
type GlobalAPIURLRequestHook ¶
type GlobalAPIURLRequestHook struct{}
func (*GlobalAPIURLRequestHook) BeforeRequest ¶
func (i *GlobalAPIURLRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)
type HTTPClient ¶
HTTPClient provides an interface for supplying the SDK with a custom HTTP client
type HTTPDumpRequestHook ¶
type HTTPDumpRequestHook struct{}
HTTPDumpRequestHook is a hook that dumps the request to stdout.
func (*HTTPDumpRequestHook) BeforeRequest ¶
func (i *HTTPDumpRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)
BeforeRequest dumps the request to stdout if enabled.
type HTTPDumpResponseErrorHook ¶
type HTTPDumpResponseErrorHook struct{}
HTTPDumpResponseErrorHook is a hook that dumps the error response to stdout.
func (*HTTPDumpResponseErrorHook) AfterError ¶
func (i *HTTPDumpResponseErrorHook) AfterError(hookCtx AfterErrorContext, res *http.Response, err error) (*http.Response, error)
AfterError dumps the error response to stdout if enabled.
type HTTPDumpResponseHook ¶
type HTTPDumpResponseHook struct{}
HTTPDumpResponseHook is a hook that dumps the response to stdout.
func (*HTTPDumpResponseHook) AfterSuccess ¶
func (i *HTTPDumpResponseHook) AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error)
AfterSuccess dumps the response to stdout if enabled.
type HookContext ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (*Hooks) AfterError ¶
func (*Hooks) AfterSuccess ¶
func (*Hooks) BeforeRequest ¶
func (*Hooks) SDKInit ¶
func (h *Hooks) SDKInit(baseURL string, client HTTPClient) (string, HTTPClient)
type UserAgentPreRequestHook ¶
type UserAgentPreRequestHook struct{}
func (*UserAgentPreRequestHook) BeforeRequest ¶
func (i *UserAgentPreRequestHook) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)
Click to show internal directories.
Click to hide internal directories.