Help us shape the future of Go! Take the 2026 Go Developer Survey

hooks

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 4 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 {
	SDK              any
	SDKConfiguration config.SDKConfiguration
	BaseURL          string
	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

Jump to

Keyboard shortcuts

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