tool

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendRequest

func SendRequest(ctx context.Context, method, url string, data map[string]interface{}, reqOpts ...Option) (*http.Response, error)

func SendRequestWithTrace

func SendRequestWithTrace(ctx context.Context, method, url string, data map[string]interface{}, reqOpt ...Option) (*http.Response, error)

Types

type Option added in v0.2.0

type Option func(opts *reqOptions)

func WithReqClient added in v0.2.0

func WithReqClient(client *http.Client) Option

func WithReqMiddle added in v0.2.0

func WithReqMiddle(reqMids ...RequestMiddleware) Option

func WithReqMiddleTimeout added in v0.2.0

func WithReqMiddleTimeout(timeout int) Option

type RequestMiddleware

type RequestMiddleware interface {
	ReqMid(ctx context.Context, r *http.Request) (*http.Request, error)
	RespMid(ctx context.Context, resp *http.Response) (*http.Response, error)
}

Jump to

Keyboard shortcuts

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