hooks

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientCredentialsHook

func NewClientCredentialsHook() *clientCredentialsHook

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