Documentation ¶
Index ¶
Constants ¶
View Source
const ( PathPrefix byte = byte('/') DefaultMaxSleepTime = 1 * time.Second // accept中间最大sleep interval DefaultMAXConnNum = 50 * 1024 * 1024 // 默认最大连接数 50w DefaultHTTPRspBufferSize = 1024 DefaultTcpReadBufferSize = 128 * 1024 // 64k DefaultTcpWriteBufferSize = 512 * 1024 // 64k )
View Source
const (
REQ_Q_SIZE = 1 // http1.1形式的短连接,一次也只能处理一个请求,放大size无意义
)
Variables ¶
View Source
var (
DefaultDialTimeout = time.Second * 5
)
Functions ¶
This section is empty.
Types ¶
type DialOption ¶
type DialOption func(*DialOptions)
func WithPath ¶
func WithPath(path string) DialOption
func WithTimeout ¶
func WithTimeout(d time.Duration) DialOption
Timeout used when dialling the remote side
type DialOptions ¶
type ListenOption ¶
type ListenOption func(*ListenOptions)
type ListenOptions ¶
type Transport ¶
type Transport interface { Dial(addr string, opts ...DialOption) (Client, error) Listen(addr string, opts ...ListenOption) (Listener, error) String() string }
Transport is an interface which is used for communication between services. It uses socket send/recv semantics and had various implementations {HTTP, RabbitMQ, NATS, ...}
func NewHTTPTransport ¶
Click to show internal directories.
Click to hide internal directories.