standard

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpTransportHandlerAdaptor

func HttpTransportHandlerAdaptor(h transports.Handler, maxRequestBody int) http.Handler

func New

func New() transports.Transport

func NewHeader

func NewHeader() transports.Header

func WrapHttpHeader

func WrapHttpHeader(h http.Header) transports.Header

Types

type Client

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

func NewClient

func NewClient(address string, config *ClientConfig) (client *Client, err error)

func (Client) Close

func (c Client) Close()

func (Client) Do

func (c Client) Do(ctx context.Context, method []byte, path []byte, header transports.Header, body []byte) (status int, responseHeader transports.Header, responseBody []byte, err error)

func (Client) Key

func (c Client) Key() (key string)

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"`
	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)

func (*Dialer) Close

func (dialer *Dialer) Close()

func (*Dialer) Dial

func (dialer *Dialer) Dial(addressBytes []byte) (client transports.Client, err error)

type Params

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

func (*Params) Add

func (params *Params) Add(name []byte, value []byte)

func (*Params) Encode

func (params *Params) Encode() (p []byte)

func (*Params) Get

func (params *Params) Get(name []byte) []byte

func (*Params) Len

func (params *Params) Len() int

func (*Params) Remove

func (params *Params) Remove(name []byte)

func (*Params) Set

func (params *Params) Set(name []byte, value []byte)

func (*Params) Values

func (params *Params) Values(name []byte) [][]byte

type Request

type Request struct {
	context.Context
	// contains filtered or unexported fields
}

func (*Request) Body

func (r *Request) Body() ([]byte, error)

func (*Request) Cookie

func (r *Request) Cookie(key []byte) (value []byte)

func (*Request) Header

func (r *Request) Header() transports.Header

func (*Request) Host

func (r *Request) Host() []byte

func (*Request) Method

func (r *Request) Method() []byte

func (*Request) Params

func (r *Request) Params() transports.Params

func (*Request) Path

func (r *Request) Path() []byte

func (*Request) Proto

func (r *Request) Proto() []byte

func (*Request) RemoteAddr

func (r *Request) RemoteAddr() []byte

func (*Request) SetBody

func (r *Request) SetBody(body []byte)

func (*Request) SetCookie

func (r *Request) SetCookie(key []byte, value []byte)

func (*Request) SetMethod

func (r *Request) SetMethod(method []byte)

func (*Request) TLS

func (r *Request) TLS() bool

func (*Request) TLSConnectionState

func (r *Request) TLSConnectionState() *tls.ConnectionState

type Server

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

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe() (err error)

func (*Server) Shutdown

func (srv *Server) Shutdown(ctx context.Context) (err error)

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

func (tr *Transport) ListenAndServe() (err error)

func (*Transport) Name

func (tr *Transport) Name() (name string)

func (*Transport) Port

func (tr *Transport) Port() (port int)

func (*Transport) Shutdown

func (tr *Transport) Shutdown(ctx context.Context)

Jump to

Keyboard shortcuts

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