hooks

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterErrorContext

type AfterErrorContext struct {
	HookContext
}

type AfterSuccessContext

type AfterSuccessContext struct {
	HookContext
}

type BeforeRequestContext

type BeforeRequestContext struct {
	HookContext
}

type FailEarly

type FailEarly struct {
	Cause error
}

func (*FailEarly) Error

func (f *FailEarly) Error() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for supplying the SDK with a custom HTTP client

type HookContext

type HookContext struct {
	Context        context.Context
	OperationID    string
	OAuth2Scopes   []string
	SecuritySource func(context.Context) (interface{}, error)
}

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

func New

func New() *Hooks

func (*Hooks) AfterError

func (h *Hooks) AfterError(hookCtx AfterErrorContext, res *http.Response, err error) (*http.Response, error)

func (*Hooks) AfterSuccess

func (h *Hooks) AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error)

func (*Hooks) BeforeRequest

func (h *Hooks) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)

func (*Hooks) SDKInit

func (h *Hooks) SDKInit(baseURL string, client HTTPClient) (string, HTTPClient)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL