Documentation ¶
Index ¶
- Constants
- func GetID(network, address string, seed int, logger zerolog.Logger) string
- func GetRLimit(logger zerolog.Logger) syscall.Rlimit
- func Resolve(network, address string, logger zerolog.Logger) (string, error)
- type Client
- type Proxy
- type ProxyImpl
- type Server
- func (s *Server) IsRunning() bool
- func (s *Server) OnBoot(engine gnet.Engine) gnet.Action
- func (s *Server) OnClose(gconn gnet.Conn, err error) gnet.Action
- func (s *Server) OnOpen(gconn gnet.Conn) ([]byte, gnet.Action)
- func (s *Server) OnShutdown(engine gnet.Engine)
- func (s *Server) OnTick() (time.Duration, gnet.Action)
- func (s *Server) OnTraffic(gconn gnet.Conn) gnet.Action
- func (s *Server) Run() error
- func (s *Server) Shutdown()
- type Status
Constants ¶
View Source
const ( Running Status = "running" Stopped Status = "stopped" DefaultTickInterval = 5 * time.Second DefaultPoolSize = 10 MinimumPoolSize = 2 DefaultBufferSize = 4096 )
View Source
const (
DefaultSeed = 1000
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { net.Conn ID string ReceiveBufferSize int Network string // tcp/udp/unix Address string // contains filtered or unexported fields }
type ProxyImpl ¶
type ProxyImpl struct { Elastic bool ReuseElasticClients bool // ClientConfig is used for elastic proxy and reconnection ClientConfig *Client // contains filtered or unexported fields }
func (*ProxyImpl) Disconnect ¶
func (*ProxyImpl) PassThrough ¶
type Server ¶
type Server struct { gnet.BuiltinEventEngine Network string // tcp/udp/unix Address string Options []gnet.Option SoftLimit uint64 HardLimit uint64 Status Status TickInterval time.Duration // contains filtered or unexported fields }
func (*Server) OnShutdown ¶
func (s *Server) OnShutdown(engine gnet.Engine)
Click to show internal directories.
Click to hide internal directories.