Documentation ¶
Index ¶
- type Conn
- type ConnOption
- type Msg
- type Option
- func WithHBInterval(hbInterval time.Duration) Option
- func WithHandShakeTime(hst time.Duration) Option
- func WithIn(in int) Option
- func WithOut(out int) Option
- func WithReadBuffer(rb int) Option
- func WithReadLimit(rLimit int64) Option
- func WithWriteBuffer(wb int) Option
- func WithWriteTime(wt time.Duration) Option
- type Server
- type ServerOption
- func Address(addr string) ServerOption
- func ConnOpt(opts ...Option) ServerOption
- func Handle(handlers ...middleware.HTTPMiddleware) ServerOption
- func Logger(l logger.Logger) ServerOption
- func Path(path string) ServerOption
- func Timeout(rTimeout, wTimeout time.Duration) ServerOption
- func WithNetwork(network string) ServerOption
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnOption ¶
type ConnOption struct {
// contains filtered or unexported fields
}
type Option ¶
type Option func(opt *ConnOption)
func WithHBInterval ¶
func WithHandShakeTime ¶
func WithReadBuffer ¶
func WithReadLimit ¶
func WithWriteBuffer ¶
func WithWriteTime ¶
type Server ¶
type Server struct { *http.Server *ConnOption // contains filtered or unexported fields }
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) Handler ¶
func (s *Server) Handler(handler http.HandlerFunc)
func (*Server) NewSession ¶
type ServerOption ¶
type ServerOption func(*Server)
func Address ¶
func Address(addr string) ServerOption
func ConnOpt ¶
func ConnOpt(opts ...Option) ServerOption
func Handle ¶
func Handle(handlers ...middleware.HTTPMiddleware) ServerOption
func Logger ¶ added in v1.3.7
func Logger(l logger.Logger) ServerOption
func Path ¶
func Path(path string) ServerOption
func Timeout ¶
func Timeout(rTimeout, wTimeout time.Duration) ServerOption
func WithNetwork ¶
func WithNetwork(network string) ServerOption
type Session ¶
type Session struct { sync.Mutex // avoid close chan duplicated *ConnOption // contains filtered or unexported fields }
func (*Session) SetContext ¶
func (s *Session) SetContext(ctx interface{})
Click to show internal directories.
Click to hide internal directories.