adapter

package
v0.0.0-...-04ef08d Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MulanPSL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRoundTripperAndCloserImplement

type HTTPRoundTripperAndCloserImplement struct {
	RoundTripper func(req *http.Request) (*http.Response, error)
	Closer       func() error
}

func (*HTTPRoundTripperAndCloserImplement) Close

func (*HTTPRoundTripperAndCloserImplement) RoundTrip

type HTTPRoundTripperAndCloserInterface

type HTTPRoundTripperAndCloserInterface interface {
	RoundTrip(req *http.Request) (*http.Response, error)
	Close() error
}

type RoundTripTransport

type RoundTripTransport func(*http.Request) (*http.Response, error) // roundTrip 是一个函数,它执行HTTP请求的传输,并返回响应和可能的错误。

RoundTripTransport 是一个实现了 http.RoundTripper 接口的类型, 允许自定义HTTP请求的传输行为。

func (RoundTripTransport) RoundTrip

func (r RoundTripTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip 是 http.RoundTripper 接口要求的方法,用于执行HTTP请求。 它简单地调用了结构体中的 roundTrip 函数,传递给它一个HTTP请求,并返回该请求的响应及可能的错误。

Jump to

Keyboard shortcuts

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