middler

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Do

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

type RequestMiddler

type RequestMiddler interface {
	ModifyRequest(req *http.Request) error
}

func WithRequestMiddlerFunc

func WithRequestMiddlerFunc(f RequestMiddlerFunc) RequestMiddler

WithRequestMiddlerFunc 是创建一个 RequestMiddler 的helper 如果我们只需要简单的逻辑,只关注闭包本身,则可以使用这个helper快速创建一个 RequestMiddler

type RequestMiddlerFunc

type RequestMiddlerFunc func(req *http.Request) error

func (RequestMiddlerFunc) ModifyRequest

func (f RequestMiddlerFunc) ModifyRequest(req *http.Request) error

type ResponseMiddler

type ResponseMiddler interface {
	ModifyResponse(response *http.Response) error
}

ResponseMiddler 响应拦截器

func WithResponseMiddlerFunc

func WithResponseMiddlerFunc(f ResponseMiddlerFunc) ResponseMiddler

WithResponseMiddlerFunc 是创建一个 ResponseMiddler 的helper 如果我们只需要简单的逻辑,只关注闭包本身,则可以使用这个helper快速创建一个 ResponseMiddler

type ResponseMiddlerFunc

type ResponseMiddlerFunc func(response *http.Response) error

func (ResponseMiddlerFunc) ModifyResponse

func (f ResponseMiddlerFunc) ModifyResponse(response *http.Response) error

Jump to

Keyboard shortcuts

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