hook

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddHeadersHook

type AddHeadersHook struct{}

func (*AddHeadersHook) OnRequestError

func (h *AddHeadersHook) OnRequestError(context.Context, *http.Request, error) error

OnRequestError is for when PrepareRequest return error, it will handle this error, if this function also return error, all the work will stop

func (*AddHeadersHook) OnResponseError

func (h *AddHeadersHook) OnResponseError(context.Context, *http.Request, *http.Response, error) error

OnResponseError is for when ProcessResponse return error, it will handle this error, if this function also return error, all the work will stop

func (*AddHeadersHook) PrepareRequest

func (h *AddHeadersHook) PrepareRequest(ctx context.Context, req *http.Request) error

PrepareRequest handle this request before do requesting

func (*AddHeadersHook) ProcessResponse

func (h *AddHeadersHook) ProcessResponse(context.Context, *http.Request, *http.Response) error

ProcessResponse handle this request and response after do requesting

Jump to

Keyboard shortcuts

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