Documentation ¶
Index ¶
- func New() transports.Transport
- type Client
- type ClientConfig
- type ClientHttp2Config
- type Config
- type Context
- func (ctx *Context) LocalValue(key []byte) any
- func (ctx *Context) LocalValues(fn func(key []byte, val any))
- func (ctx *Context) RemoveLocalValue(key []byte)
- func (ctx *Context) RemoveUserValue(key []byte)
- func (ctx *Context) SetLocalValue(key []byte, val any)
- func (ctx *Context) SetUserValue(key []byte, val any)
- func (ctx *Context) UserValue(key []byte) any
- func (ctx *Context) UserValues(fn func(key []byte, val any))
- type Dialer
- type DialerConfig
- type Http2Config
- type Params
- func (params *Params) Add(name []byte, value []byte)
- func (params *Params) Encode() (p []byte)
- func (params *Params) Get(name []byte) []byte
- func (params *Params) Len() int
- func (params *Params) Remove(name []byte)
- func (params *Params) Set(name []byte, value []byte)
- func (params *Params) Values(name []byte) [][]byte
- type Request
- func (r *Request) Body() ([]byte, error)
- func (r *Request) Cookie(key []byte) (value []byte)
- func (r *Request) FormValue(name []byte) (value []byte)
- func (r *Request) Header() transports.Header
- func (r *Request) Host() []byte
- func (r *Request) Method() []byte
- func (r *Request) Params() transports.Params
- func (r *Request) Path() []byte
- func (r *Request) Proto() []byte
- func (r *Request) RemoteAddr() []byte
- func (r *Request) RequestURI() []byte
- func (r *Request) SetBody(body []byte)
- func (r *Request) SetCookie(key []byte, value []byte)
- func (r *Request) SetMethod(method []byte)
- func (r *Request) TLS() bool
- func (r *Request) TLSConnectionState() *tls.ConnectionState
- type RequestHeader
- func (h RequestHeader) Add(key []byte, value []byte)
- func (h RequestHeader) Del(key []byte)
- func (h RequestHeader) Foreach(fn func(key []byte, values [][]byte))
- func (h RequestHeader) Get(key []byte) []byte
- func (h RequestHeader) Len() int
- func (h RequestHeader) Reset()
- func (h RequestHeader) Set(key []byte, value []byte)
- func (h RequestHeader) Values(key []byte) [][]byte
- type ResponseHeader
- func (h *ResponseHeader) Add(key []byte, value []byte)
- func (h *ResponseHeader) Del(key []byte)
- func (h *ResponseHeader) Foreach(fn func(key []byte, values [][]byte))
- func (h *ResponseHeader) Get(key []byte) []byte
- func (h *ResponseHeader) Len() int
- func (h *ResponseHeader) Reset()
- func (h *ResponseHeader) Set(key []byte, value []byte)
- func (h *ResponseHeader) Values(key []byte) [][]byte
- type ResponseWriter
- func (w *ResponseWriter) Body() []byte
- func (w *ResponseWriter) BodyLen() int
- func (w *ResponseWriter) Failed(cause error)
- func (w *ResponseWriter) Header() transports.Header
- func (w *ResponseWriter) Hijack(f func(ctx context.Context, conn net.Conn, rw *bufio.ReadWriter) (err error)) (async bool, err error)
- func (w *ResponseWriter) Hijacked() bool
- func (w *ResponseWriter) ResetBody()
- func (w *ResponseWriter) SetCookie(cookie *transports.Cookie)
- func (w *ResponseWriter) SetStatus(status int)
- func (w *ResponseWriter) Status() int
- func (w *ResponseWriter) Succeed(v interface{})
- func (w *ResponseWriter) Write(body []byte) (int, error)
- func (w *ResponseWriter) WriteDeadline() time.Time
- func (w *ResponseWriter) WriteTimeout() time.Duration
- type Server
- type Transport
- func (tr *Transport) Construct(options transports.Options) (err error)
- func (tr *Transport) Dial(address []byte) (client transports.Client, err error)
- func (tr *Transport) ListenAndServe() (err error)
- func (tr *Transport) Name() (name string)
- func (tr *Transport) Port() (port int)
- func (tr *Transport) Shutdown(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() transports.Transport
Types ¶
type ClientConfig ¶
type ClientConfig struct { DialDualStack bool `json:"dialDualStack"` MaxConnsPerHost int `json:"maxConnsPerHost"` MaxIdleConnDuration string `json:"maxIdleConnDuration"` MaxConnDuration string `json:"maxConnDuration"` MaxIdemponentCallAttempts int `json:"maxIdemponentCallAttempts"` ReadBufferSize string `json:"readBufferSize"` ReadTimeout string `json:"readTimeout"` WriteBufferSize string `json:"writeBufferSize"` WriteTimeout string `json:"writeTimeout"` MaxResponseBodySize string `json:"maxResponseBodySize"` MaxConnWaitTimeout string `json:"maxConnWaitTimeout"` Dialer DialerConfig `json:"dialer"` IsTLS bool `json:"isTLS"` TLSConfig *tls.Config `json:"-"` TLSDialer ssl.Dialer `json:"-"` // contains filtered or unexported fields }
type ClientHttp2Config ¶
type Config ¶
type Config struct { ReadBufferSize string `json:"readBufferSize"` ReadTimeout string `json:"readTimeout"` WriteBufferSize string `json:"writeBufferSize"` WriteTimeout string `json:"writeTimeout"` MaxIdleWorkerDuration string `json:"maxIdleWorkerDuration"` TCPKeepalive bool `json:"tcpKeepalive"` TCPKeepalivePeriod string `json:"tcpKeepalivePeriod"` MaxRequestBodySize string `json:"maxRequestBodySize"` ReduceMemoryUsage bool `json:"reduceMemoryUsage"` MaxRequestsPerConn int `json:"maxRequestsPerConn"` KeepHijackedConns bool `json:"keepHijackedConns"` StreamRequestBody bool `json:"streamRequestBody"` Prefork bool `json:"prefork"` Http2 Http2Config `json:"http2"` Client ClientConfig `json:"client"` }
type Context ¶ added in v1.1.2
type Context struct { *fasthttp.RequestCtx // contains filtered or unexported fields }
func (*Context) LocalValue ¶ added in v1.1.2
func (*Context) LocalValues ¶ added in v1.2.0
func (*Context) RemoveLocalValue ¶ added in v1.2.85
func (*Context) RemoveUserValue ¶ added in v1.2.85
func (*Context) SetLocalValue ¶ added in v1.1.2
func (*Context) SetUserValue ¶ added in v1.1.2
func (*Context) UserValues ¶ added in v1.1.2
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
func NewDialer ¶
func NewDialer(opts ClientConfig) (dialer *Dialer, err error)
type DialerConfig ¶ added in v1.2.21
type Http2Config ¶
type Request ¶
type Request struct {
*Context
}
func (*Request) Header ¶
func (r *Request) Header() transports.Header
func (*Request) Params ¶
func (r *Request) Params() transports.Params
func (*Request) RemoteAddr ¶
func (*Request) RequestURI ¶ added in v1.1.3
func (*Request) TLSConnectionState ¶
func (r *Request) TLSConnectionState() *tls.ConnectionState
type RequestHeader ¶
type RequestHeader struct {
// contains filtered or unexported fields
}
func (RequestHeader) Add ¶
func (h RequestHeader) Add(key []byte, value []byte)
func (RequestHeader) Del ¶
func (h RequestHeader) Del(key []byte)
func (RequestHeader) Foreach ¶
func (h RequestHeader) Foreach(fn func(key []byte, values [][]byte))
func (RequestHeader) Get ¶
func (h RequestHeader) Get(key []byte) []byte
func (RequestHeader) Len ¶
func (h RequestHeader) Len() int
func (RequestHeader) Reset ¶
func (h RequestHeader) Reset()
func (RequestHeader) Set ¶
func (h RequestHeader) Set(key []byte, value []byte)
func (RequestHeader) Values ¶
func (h RequestHeader) Values(key []byte) [][]byte
type ResponseHeader ¶
type ResponseHeader struct {
*fasthttp.ResponseHeader
}
func (*ResponseHeader) Add ¶
func (h *ResponseHeader) Add(key []byte, value []byte)
func (*ResponseHeader) Del ¶
func (h *ResponseHeader) Del(key []byte)
func (*ResponseHeader) Foreach ¶
func (h *ResponseHeader) Foreach(fn func(key []byte, values [][]byte))
func (*ResponseHeader) Get ¶
func (h *ResponseHeader) Get(key []byte) []byte
func (*ResponseHeader) Len ¶
func (h *ResponseHeader) Len() int
func (*ResponseHeader) Reset ¶
func (h *ResponseHeader) Reset()
func (*ResponseHeader) Set ¶
func (h *ResponseHeader) Set(key []byte, value []byte)
func (*ResponseHeader) Values ¶
func (h *ResponseHeader) Values(key []byte) [][]byte
type ResponseWriter ¶ added in v1.1.2
type ResponseWriter struct { *Context // contains filtered or unexported fields }
func (*ResponseWriter) Body ¶ added in v1.1.2
func (w *ResponseWriter) Body() []byte
func (*ResponseWriter) BodyLen ¶ added in v1.1.2
func (w *ResponseWriter) BodyLen() int
func (*ResponseWriter) Failed ¶ added in v1.1.2
func (w *ResponseWriter) Failed(cause error)
func (*ResponseWriter) Header ¶ added in v1.1.2
func (w *ResponseWriter) Header() transports.Header
func (*ResponseWriter) Hijack ¶ added in v1.1.2
func (w *ResponseWriter) Hijack(f func(ctx context.Context, conn net.Conn, rw *bufio.ReadWriter) (err error)) (async bool, err error)
func (*ResponseWriter) Hijacked ¶ added in v1.1.2
func (w *ResponseWriter) Hijacked() bool
func (*ResponseWriter) ResetBody ¶ added in v1.2.63
func (w *ResponseWriter) ResetBody()
func (*ResponseWriter) SetCookie ¶ added in v1.1.2
func (w *ResponseWriter) SetCookie(cookie *transports.Cookie)
func (*ResponseWriter) SetStatus ¶ added in v1.1.2
func (w *ResponseWriter) SetStatus(status int)
func (*ResponseWriter) Status ¶ added in v1.1.2
func (w *ResponseWriter) Status() int
func (*ResponseWriter) Succeed ¶ added in v1.1.2
func (w *ResponseWriter) Succeed(v interface{})
func (*ResponseWriter) Write ¶ added in v1.1.2
func (w *ResponseWriter) Write(body []byte) (int, error)
func (*ResponseWriter) WriteDeadline ¶ added in v1.1.2
func (w *ResponseWriter) WriteDeadline() time.Time
func (*ResponseWriter) WriteTimeout ¶ added in v1.1.2
func (w *ResponseWriter) WriteTimeout() time.Duration
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) Construct ¶
func (tr *Transport) Construct(options transports.Options) (err error)
func (*Transport) Dial ¶
func (tr *Transport) Dial(address []byte) (client transports.Client, err error)
func (*Transport) ListenAndServe ¶
Click to show internal directories.
Click to hide internal directories.