http

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncClient added in v0.5.0

type AsyncClient interface {
	Do(req *http.Request, fn ResponseFn)
}

AsyncClient asynchronous client interface

func NewAsyncClient added in v0.5.0

func NewAsyncClient(client *http.Client, conf *AsyncClientConf) AsyncClient

NewAsyncClient create an AsyncClient instance

type AsyncClientConf added in v0.5.0

type AsyncClientConf struct {
	MinWorker         int
	MaxRequestBuf     int
	MaxRequestTempBuf int
	MaxTickCount      int
	TickWaitTime      time.Duration
}

AsyncClientConf client configure used to create an AsynClient instance

type ConnectMux

type ConnectMux struct {
	// contains filtered or unexported fields
}

ConnectMux mux used for Connect

func NewConnectMux

func NewConnectMux(pathPrefix ...string) *ConnectMux

NewConnectMux allocates and returns a new ConnectMux.

func (*ConnectMux) Handle

func (mux *ConnectMux) Handle(path string, handler http.Handler)

Handle registers the handler for the given path. If a handler already exists for path, Handle panics.

func (*ConnectMux) ServeHTTP

func (mux *ConnectMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP dispatches the request to the handler whose pattern most closely matches the request URL.

type ResponseFn added in v0.5.0

type ResponseFn = gp.ResponseFn[*http.Request, *http.Response]

ResponseFn a function used handle the response of http.Client.Do

Jump to

Keyboard shortcuts

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