http

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, method Method, target string, opts ...CliOptionFunc) ([]byte, error)

func GetDefaultHttpClient added in v0.0.31

func GetDefaultHttpClient() *http.Client

func Serve added in v0.0.31

func Serve(ctx context.Context, addr string, handle http.Handler, opts ...SrvOptionFunc) error

Types

type CliOptionFunc added in v0.0.46

type CliOptionFunc func(*cliConfig)

func WithCliBody added in v0.0.31

func WithCliBody(body []byte) CliOptionFunc

func WithCliHeader added in v0.0.31

func WithCliHeader(header map[string]string) CliOptionFunc

func WithCliLogger added in v0.0.31

func WithCliLogger(logger log.API) CliOptionFunc

func WithCliQuery added in v0.0.31

func WithCliQuery(query map[string]string) CliOptionFunc

func WithCliRetry added in v0.0.31

func WithCliRetry(retry int) CliOptionFunc

func WithCliTrace added in v0.0.31

func WithCliTrace(trace bool) CliOptionFunc

func WithCliUniqueId added in v0.0.31

func WithCliUniqueId(uniqueId string) CliOptionFunc

func WithClient

func WithClient(client *http.Client) CliOptionFunc

type Method

type Method int64
const (
	GET Method = iota
	POST
)

func (Method) String

func (i Method) String() string

type SrvOptionFunc added in v0.0.46

type SrvOptionFunc func(*srvCfg)

func WithSrvLogger added in v0.0.31

func WithSrvLogger(logger log.API) SrvOptionFunc

Jump to

Keyboard shortcuts

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