Documentation ¶
Overview ¶
Package event is a generated GoMock package.
Index ¶
- type AcceptProcess
- type BootClient
- func (b *BootClient) CancelFunc()
- func (b *BootClient) Dial(network string, addr string) (StarterClient, error)
- func (b *BootClient) DialTcp(addr string) (StarterClient, error)
- func (b *BootClient) DialTcpTimeout(addr string, timeout time.Duration) (StarterClient, error)
- func (b *BootClient) DialTimeout(network string, addr string, timeout time.Duration) (StarterClient, error)
- func (b *BootClient) DialUdp(addr string) (StarterClient, error)
- func (b *BootClient) DialUdpTimeout(addr string, timeout time.Duration) (StarterClient, error)
- type BootServer
- type DisconnectProcess
- type Event
- type MockProcess
- type MockProcessMockRecorder
- type Process
- type Session
- type SessionState
- type StarterClient
- type StarterServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptProcess ¶ added in v1.5.1
AcceptProcess 网络建立连接时执行
type BootClient ¶
type BootClient struct { *Event // contains filtered or unexported fields }
func NewBootClient ¶
func NewBootClient() *BootClient
func NewBootClientContext ¶ added in v1.4.1
func NewBootClientContext(ctx context.Context) *BootClient
func (*BootClient) CancelFunc ¶ added in v1.4.1
func (b *BootClient) CancelFunc()
func (*BootClient) Dial ¶ added in v1.5.1
func (b *BootClient) Dial(network string, addr string) (StarterClient, error)
func (*BootClient) DialTcp ¶ added in v1.4.1
func (b *BootClient) DialTcp(addr string) (StarterClient, error)
func (*BootClient) DialTcpTimeout ¶ added in v1.5.1
func (b *BootClient) DialTcpTimeout(addr string, timeout time.Duration) (StarterClient, error)
func (*BootClient) DialTimeout ¶ added in v1.5.1
func (b *BootClient) DialTimeout(network string, addr string, timeout time.Duration) (StarterClient, error)
func (*BootClient) DialUdp ¶ added in v1.5.1
func (b *BootClient) DialUdp(addr string) (StarterClient, error)
func (*BootClient) DialUdpTimeout ¶ added in v1.5.1
func (b *BootClient) DialUdpTimeout(addr string, timeout time.Duration) (StarterClient, error)
type BootServer ¶
type BootServer struct { *Event // contains filtered or unexported fields }
func NewBootServer ¶
func NewBootServer() *BootServer
func NewBootServerContext ¶ added in v1.4.1
func NewBootServerContext(ctx context.Context) *BootServer
func (*BootServer) BindAddr ¶ added in v1.4.1
func (b *BootServer) BindAddr(network string, addr string) error
BindAddr 绑定监听地址, 如:localhost:8080, 0.0.0.0:8080, :8080, [::1]:0
func (*BootServer) CancelFunc ¶ added in v1.4.1
func (b *BootServer) CancelFunc()
func (*BootServer) ListenTcp ¶ added in v1.4.1
func (b *BootServer) ListenTcp(addr string) error
ListenTcp 启动监听
func (*BootServer) ListenUdp ¶ added in v1.5.1
func (b *BootServer) ListenUdp(addr string) error
func (*BootServer) Starter ¶
func (b *BootServer) Starter() StarterServer
func (*BootServer) Stop ¶ added in v1.4.1
func (b *BootServer) Stop() error
type DisconnectProcess ¶ added in v1.5.1
DisconnectProcess 网络连接断开时执行
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (*Event) ProcessList ¶
func (e *Event) ProcessList() []interface{}
func (*Event) RegisterPlus ¶ added in v1.5.1
func (*Event) UnRegister ¶
type MockProcess ¶
type MockProcess struct {
// contains filtered or unexported fields
}
MockProcess is a mock of Process interface.
func NewMockProcess ¶
func NewMockProcess(ctrl *gomock.Controller) *MockProcess
NewMockProcess creates a new mock instance.
func (*MockProcess) Accept ¶
func (m *MockProcess) Accept(session *Session) error
Accept mocks base method.
func (*MockProcess) Active ¶
func (m *MockProcess) Active(session *Session, value any) (any, error)
Active mocks base method.
func (*MockProcess) Disconnect ¶
func (m *MockProcess) Disconnect(session *Session) error
Disconnect mocks base method.
func (*MockProcess) EXPECT ¶
func (m *MockProcess) EXPECT() *MockProcessMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockProcessMockRecorder ¶
type MockProcessMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessMockRecorder is the mock recorder for MockProcess.
func (*MockProcessMockRecorder) Accept ¶
func (mr *MockProcessMockRecorder) Accept(session any) *gomock.Call
Accept indicates an expected call of Accept.
func (*MockProcessMockRecorder) Active ¶
func (mr *MockProcessMockRecorder) Active(session, value any) *gomock.Call
Active indicates an expected call of Active.
func (*MockProcessMockRecorder) Disconnect ¶
func (mr *MockProcessMockRecorder) Disconnect(session any) *gomock.Call
Disconnect indicates an expected call of Disconnect.
type Session ¶
Session 会话对象, 每个连接都有唯一会话
func NewSession ¶
func NewSessionContext ¶ added in v1.4.1
func (*Session) CancelFunc ¶ added in v1.4.1
func (s *Session) CancelFunc()
func (*Session) SetState ¶
func (s *Session) SetState(state SessionState)
func (*Session) State ¶
func (s *Session) State() SessionState
type SessionState ¶
type SessionState int
SessionState 会话状态
const ( Accept SessionState = iota // 新建连接 Active // 活动连接 Disconnect // 断开连接 )