Documentation ¶
Index ¶
- func ConvertHttpHandler(h http.Handler) transports.Handler
- func ConvertHttpHandlerFunc(h http.HandlerFunc) transports.Handler
- func ConvertRequest(ctx transports.Request, r *http.Request, forServer bool) error
- func HttpTransportHandlerAdaptor(h transports.Handler, maxRequestBody int, writeTimeout time.Duration) http.Handler
- func New() transports.Transport
- func NewHeader() transports.Header
- func WrapHttpHeader(h http.Header) transports.Header
- type Client
- type ClientConfig
- func (config *ClientConfig) ExpectContinueTimeoutDuration() (n time.Duration, err error)
- func (config *ClientConfig) IdleConnTimeoutDuration() (n time.Duration, err error)
- func (config *ClientConfig) MaxConnectionsPerHost() (n int)
- func (config *ClientConfig) MaxIdleConnectionsPerHost() (n int)
- func (config *ClientConfig) MaxResponseHeaderByteSize() (n uint64, err error)
- func (config *ClientConfig) TLSHandshakeTimeoutDuration() (n time.Duration, err error)
- func (config *ClientConfig) TimeoutDuration() (n time.Duration, err error)
- type Config
- type Dialer
- type DialerConfig
- 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 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) 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 ConvertHttpHandler ¶ added in v1.2.0
func ConvertHttpHandler(h http.Handler) transports.Handler
func ConvertHttpHandlerFunc ¶ added in v1.2.0
func ConvertHttpHandlerFunc(h http.HandlerFunc) transports.Handler
func ConvertRequest ¶ added in v1.2.0
func New ¶
func New() transports.Transport
func NewHeader ¶
func NewHeader() transports.Header
func WrapHttpHeader ¶
func WrapHttpHeader(h http.Header) transports.Header
Types ¶
type ClientConfig ¶
type ClientConfig struct { MaxConnsPerHost int `json:"maxConnsPerHost"` MaxResponseHeaderSize string `json:"maxResponseHeaderSize"` Timeout string `json:"timeout"` DisableKeepAlive bool `json:"disableKeepAlive"` MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost"` IdleConnTimeout string `json:"idleConnTimeout"` TLSHandshakeTimeout string `json:"tlsHandshakeTimeout"` ExpectContinueTimeout string `json:"expectContinueTimeout"` Dialer DialerConfig `json:"dialer"` IsTLS bool `json:"isTLS"` TLSConfig *tls.Config `json:"-"` TLSDialer ssl.Dialer `json:"-"` }
func (*ClientConfig) ExpectContinueTimeoutDuration ¶
func (config *ClientConfig) ExpectContinueTimeoutDuration() (n time.Duration, err error)
func (*ClientConfig) IdleConnTimeoutDuration ¶
func (config *ClientConfig) IdleConnTimeoutDuration() (n time.Duration, err error)
func (*ClientConfig) MaxConnectionsPerHost ¶
func (config *ClientConfig) MaxConnectionsPerHost() (n int)
func (*ClientConfig) MaxIdleConnectionsPerHost ¶
func (config *ClientConfig) MaxIdleConnectionsPerHost() (n int)
func (*ClientConfig) MaxResponseHeaderByteSize ¶
func (config *ClientConfig) MaxResponseHeaderByteSize() (n uint64, err error)
func (*ClientConfig) TLSHandshakeTimeoutDuration ¶
func (config *ClientConfig) TLSHandshakeTimeoutDuration() (n time.Duration, err error)
func (*ClientConfig) TimeoutDuration ¶
func (config *ClientConfig) TimeoutDuration() (n time.Duration, err error)
type Config ¶
type Config struct { MaxRequestHeaderSize string `json:"maxRequestHeaderSize"` MaxRequestBodySize string `json:"maxRequestBodySize"` ReadTimeout string `json:"readTimeout"` ReadHeaderTimeout string `json:"readHeaderTimeout"` WriteTimeout string `json:"writeTimeout"` IdleTimeout string `json:"idleTimeout"` Client *ClientConfig `json:"client"` }
func (*Config) ClientConfig ¶
func (config *Config) ClientConfig() *ClientConfig
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 Request ¶
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 ResponseWriter ¶ added in v1.1.2
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) 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.