api

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 1 Imported by: 6

README

不建议使用这个目录下的代码

建议使用如下目录

github.com/guonaihong/gout/middler

这个目录的代码将在未来4-5个版本迭代之后删除

请做好迁移 v0.3.1版本开始算起,大约在v0.3.6版本移除

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Do added in v0.3.1

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

type RequestMiddler

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

func WithRequestMiddlerFunc added in v0.2.10

func WithRequestMiddlerFunc(f RequestMiddlerFunc) RequestMiddler

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

type RequestMiddlerFunc added in v0.2.10

type RequestMiddlerFunc func(req *http.Request) error

func (RequestMiddlerFunc) ModifyRequest added in v0.2.10

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

type ResponseMiddler added in v0.2.7

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

ResponseMiddler 响应拦截器

func WithResponseMiddlerFunc added in v0.2.10

func WithResponseMiddlerFunc(f ResponseMiddlerFunc) ResponseMiddler

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

type ResponseMiddlerFunc added in v0.2.10

type ResponseMiddlerFunc func(response *http.Response) error

func (ResponseMiddlerFunc) ModifyResponse added in v0.2.10

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