Documentation
¶
Index ¶
- func WithMeta(m meta.Meta) func(Operator)
- func WithReadHooks(i ReadInterceptor) func(Operator)
- func WithWriteHooks(i WriteInterceptor) func(Operator)
- type Callback
- type Event
- type Module
- type NetClient
- type NetServer
- type NetSession
- type Operator
- type ReadInterceptor
- type Runner
- type SessionManager
- type WriteInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithReadHooks ¶
func WithReadHooks(i ReadInterceptor) func(Operator)
func WithWriteHooks ¶
func WithWriteHooks(i WriteInterceptor) func(Operator)
Types ¶
type Callback ¶
type Callback struct {
OnSession func(NetSession)
OnMessage func(Event)
OnSessionStop func(NetSession)
}
type Event ¶
type Event interface {
// Session返回本条消息对应的NetSession
Session() NetSession
// Message返回经过unPack,decode之后的消息
Message() interface{}
}
Event 是onMessage回调中传入的参数
type NetClient ¶
type NetClient interface {
SessionManager
Runner
}
type NetServer ¶
type NetServer interface {
SessionManager
Runner
}
type NetSession ¶
type Operator ¶
type ReadInterceptor ¶
type SessionManager ¶
type SessionManager interface {
// BroadCast对所有NetSession连接执行fn
// 若module设置Pool,则fn全部投入Pool中,否则在当前goroutine执行
Broadcast(func(session NetSession))
// GetSession返回指定id对应的NetSession
GetSession(id uint64) (NetSession, bool)
}
Directories
¶
| Path | Synopsis |
|---|---|
|
plugins/codec_protobuf/test
Package test is a generated protocol buffer package.
|
Package test is a generated protocol buffer package. |
|
net
|
|
Click to show internal directories.
Click to hide internal directories.