Documentation ¶
Index ¶
- type Connection
- type GnetEasyNetPlugin
- type GnetServer
- func (s *GnetServer) OnBoot(eng gnet.Engine) gnet.Action
- func (s *GnetServer) OnClose(c gnet.Conn, err error) (action gnet.Action)
- func (s *GnetServer) OnOpen(c gnet.Conn) (out []byte, action gnet.Action)
- func (s *GnetServer) OnShutdown(eng gnet.Engine)
- func (s *GnetServer) OnTick() (delay time.Duration, action gnet.Action)
- func (s *GnetServer) OnTraffic(c gnet.Conn) gnet.Action
- type YamlConfig
- func (n *YamlConfig) GetIp() string
- func (n *YamlConfig) GetLockosthread() bool
- func (n *YamlConfig) GetMulticore() bool
- func (n *YamlConfig) GetNumEventLoop() int32
- func (n *YamlConfig) GetPort() int32
- func (n *YamlConfig) GetProtocol() string
- func (n *YamlConfig) GetReadBufferCap() int32
- func (n *YamlConfig) GetReuseAddr() bool
- func (n *YamlConfig) GetReusePort() bool
- func (n *YamlConfig) GetWriteBufferCap() int32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
Conn gnet.Conn
}
func (Connection) Close ¶
func (c Connection) Close() (err error)
func (Connection) RemoteAddr ¶
func (c Connection) RemoteAddr() string
type GnetEasyNetPlugin ¶
type GnetEasyNetPlugin struct { Conn net.Conn Ctx context.Context Config *YamlConfig Server *GnetServer Handler _interface.IEasyNet }
func NewGnetEasyNetPlugin ¶
func NewGnetEasyNetPlugin(ctx context.Context, iconfig _interface.IConfig, handler _interface.IEasyNet) *GnetEasyNetPlugin
func (GnetEasyNetPlugin) Run ¶
func (g GnetEasyNetPlugin) Run() error
type GnetServer ¶
type GnetServer struct { Ctx context.Context gnet.BuiltinEventEngine InputStreamMap map[string]_interface.IInputStream ConnectionMap map[string]_interface.IConnection // contains filtered or unexported fields }
func NewGnetServer ¶
func NewGnetServer(ctx context.Context, config *YamlConfig, handler _interface.IEasyNet) *GnetServer
func (*GnetServer) OnBoot ¶
func (s *GnetServer) OnBoot(eng gnet.Engine) gnet.Action
func (*GnetServer) OnClose ¶
func (s *GnetServer) OnClose(c gnet.Conn, err error) (action gnet.Action)
func (*GnetServer) OnOpen ¶
func (s *GnetServer) OnOpen(c gnet.Conn) (out []byte, action gnet.Action)
func (*GnetServer) OnShutdown ¶
func (s *GnetServer) OnShutdown(eng gnet.Engine)
func (*GnetServer) OnTick ¶
func (s *GnetServer) OnTick() (delay time.Duration, action gnet.Action)
func (*GnetServer) OnTraffic ¶
func (s *GnetServer) OnTraffic(c gnet.Conn) gnet.Action
type YamlConfig ¶
type YamlConfig struct { Protocol string `json:"protocol" yaml:"protocol"` Ip string `json:"ip" yaml:"ip"` Port int32 `json:"port" yaml:"port"` Multicore bool `json:"multicore" yaml:"multicore"` Lockosthread bool `json:"lockosthread" yaml:"lockosthread"` ReadBufferCap int32 `json:"readbuffercap" yaml:"readbuffercap"` WriteBufferCap int32 `json:"writebuffercap" yaml:"writebuffercap"` NumEventLoop int32 `json:"numeventloop" yaml:"numeventloop"` ReusePort bool `json:"reuseport" yaml:"reuseport"` ReuseAddr bool `json:"reuseaddr" yaml:"reuseaddr"` }
func (*YamlConfig) GetIp ¶
func (n *YamlConfig) GetIp() string
func (*YamlConfig) GetLockosthread ¶
func (n *YamlConfig) GetLockosthread() bool
func (*YamlConfig) GetMulticore ¶
func (n *YamlConfig) GetMulticore() bool
func (*YamlConfig) GetNumEventLoop ¶
func (n *YamlConfig) GetNumEventLoop() int32
func (*YamlConfig) GetPort ¶
func (n *YamlConfig) GetPort() int32
func (*YamlConfig) GetProtocol ¶
func (n *YamlConfig) GetProtocol() string
func (*YamlConfig) GetReadBufferCap ¶
func (n *YamlConfig) GetReadBufferCap() int32
func (*YamlConfig) GetReuseAddr ¶
func (n *YamlConfig) GetReuseAddr() bool
func (*YamlConfig) GetReusePort ¶
func (n *YamlConfig) GetReusePort() bool
func (*YamlConfig) GetWriteBufferCap ¶
func (n *YamlConfig) GetWriteBufferCap() int32
Click to show internal directories.
Click to hide internal directories.