Documentation ¶
Overview ¶
Package qim is a generated GoMock package.
Package qim is a generated GoMock package.
Package qim is a generated GoMock package.
Index ¶
- Constants
- Variables
- func FromRequest(r *http.Request) string
- func GetLocalIP() string
- type Acceptor
- type Agent
- type Channel
- type ChannelImpl
- func (ch *ChannelImpl) Close() error
- func (ch *ChannelImpl) GetMeta() Meta
- func (ch *ChannelImpl) ID() string
- func (ch *ChannelImpl) Push(payload []byte) error
- func (ch *ChannelImpl) Readloop(lst MessageListener) error
- func (ch *ChannelImpl) SetReadwait(timeout time.Duration)
- func (ch *ChannelImpl) SetWritewait(timeout time.Duration)
- type ChannelMap
- type ChannlesImpl
- type Client
- type Conn
- type Context
- type ContextImpl
- func (c *ContextImpl) Dispatch(body protoreflect.ProtoMessage, recvs ...*Location) error
- func (c *ContextImpl) Header() *pkt.Header
- func (c *ContextImpl) Next()
- func (c *ContextImpl) ReadBody(value protoreflect.ProtoMessage) error
- func (c *ContextImpl) Resp(status pkt.Status, body protoreflect.ProtoMessage) error
- func (c *ContextImpl) RespWithError(status pkt.Status, err error) error
- func (c *ContextImpl) Session() Session
- type DefaultServer
- func (s *DefaultServer) Push(channelID string, payload []byte) error
- func (s *DefaultServer) SetAcceptor(acceptor Acceptor)
- func (s *DefaultServer) SetChannelMap(channelMap ChannelMap)
- func (s *DefaultServer) SetMessageListener(messageListener MessageListener)
- func (s *DefaultServer) SetReadwait(readwait time.Duration)
- func (s *DefaultServer) SetStateListener(stateListener StateListener)
- func (s *DefaultServer) Shutdown(ctx context.Context) error
- func (s *DefaultServer) Start() error
- type Dialer
- type DialerContext
- type Dispatcher
- type Frame
- type FuncTree
- type HandlerFunc
- type HandlersChain
- type Location
- type MessageListener
- type Meta
- type MockAcceptor
- type MockAcceptorMockRecorder
- type MockAgent
- type MockAgentMockRecorder
- type MockChannel
- func (m *MockChannel) Close() error
- func (m *MockChannel) EXPECT() *MockChannelMockRecorder
- func (m *MockChannel) Flush() error
- func (m *MockChannel) GetMeta() Meta
- func (m *MockChannel) ID() string
- func (m *MockChannel) LocalAddr() net.Addr
- func (m *MockChannel) Push(payload []byte) error
- func (m *MockChannel) Read(b []byte) (int, error)
- func (m *MockChannel) ReadFrame() (Frame, error)
- func (m *MockChannel) Readloop(lst MessageListener) error
- func (m *MockChannel) RemoteAddr() net.Addr
- func (m *MockChannel) SetDeadline(t time.Time) error
- func (m *MockChannel) SetReadDeadline(t time.Time) error
- func (m *MockChannel) SetReadwait(timeout time.Duration)
- func (m *MockChannel) SetWriteDeadline(t time.Time) error
- func (m *MockChannel) SetWritewait(timeout time.Duration)
- func (m *MockChannel) Write(b []byte) (int, error)
- func (m *MockChannel) WriteFrame(opcode OpCode, payload []byte) error
- type MockChannelMockRecorder
- func (mr *MockChannelMockRecorder) Close() *gomock.Call
- func (mr *MockChannelMockRecorder) Flush() *gomock.Call
- func (mr *MockChannelMockRecorder) GetMeta() *gomock.Call
- func (mr *MockChannelMockRecorder) ID() *gomock.Call
- func (mr *MockChannelMockRecorder) LocalAddr() *gomock.Call
- func (mr *MockChannelMockRecorder) Push(payload interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) Read(b interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) ReadFrame() *gomock.Call
- func (mr *MockChannelMockRecorder) Readloop(lst interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) RemoteAddr() *gomock.Call
- func (mr *MockChannelMockRecorder) SetDeadline(t interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) SetReadDeadline(t interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) SetReadwait(timeout interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) SetWritewait(timeout interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) Write(b interface{}) *gomock.Call
- func (mr *MockChannelMockRecorder) WriteFrame(opcode, payload interface{}) *gomock.Call
- type MockClient
- func (m *MockClient) Close()
- func (m *MockClient) Connect(addr string) error
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) GetMeta() map[string]string
- func (m *MockClient) Read() (Frame, error)
- func (m *MockClient) Send(payload []byte) error
- func (m *MockClient) ServiceID() string
- func (m *MockClient) ServiceName() string
- func (m *MockClient) SetDialer(dialer Dialer)
- type MockClientMockRecorder
- func (mr *MockClientMockRecorder) Close() *gomock.Call
- func (mr *MockClientMockRecorder) Connect(addr interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) GetMeta() *gomock.Call
- func (mr *MockClientMockRecorder) Read() *gomock.Call
- func (mr *MockClientMockRecorder) Send(payload interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) ServiceID() *gomock.Call
- func (mr *MockClientMockRecorder) ServiceName() *gomock.Call
- func (mr *MockClientMockRecorder) SetDialer(dialer interface{}) *gomock.Call
- type MockConn
- func (m *MockConn) Close() error
- func (m *MockConn) EXPECT() *MockConnMockRecorder
- func (m *MockConn) Flush() error
- func (m *MockConn) LocalAddr() net.Addr
- func (m *MockConn) Read(b []byte) (int, error)
- func (m *MockConn) ReadFrame() (Frame, error)
- func (m *MockConn) RemoteAddr() net.Addr
- func (m *MockConn) SetDeadline(t time.Time) error
- func (m *MockConn) SetReadDeadline(t time.Time) error
- func (m *MockConn) SetWriteDeadline(t time.Time) error
- func (m *MockConn) Write(b []byte) (int, error)
- func (m *MockConn) WriteFrame(opcode OpCode, payload []byte) error
- type MockConnMockRecorder
- func (mr *MockConnMockRecorder) Close() *gomock.Call
- func (mr *MockConnMockRecorder) Flush() *gomock.Call
- func (mr *MockConnMockRecorder) LocalAddr() *gomock.Call
- func (mr *MockConnMockRecorder) Read(b interface{}) *gomock.Call
- func (mr *MockConnMockRecorder) ReadFrame() *gomock.Call
- func (mr *MockConnMockRecorder) RemoteAddr() *gomock.Call
- func (mr *MockConnMockRecorder) SetDeadline(t interface{}) *gomock.Call
- func (mr *MockConnMockRecorder) SetReadDeadline(t interface{}) *gomock.Call
- func (mr *MockConnMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call
- func (mr *MockConnMockRecorder) Write(b interface{}) *gomock.Call
- func (mr *MockConnMockRecorder) WriteFrame(opcode, payload interface{}) *gomock.Call
- type MockDialer
- type MockDialerMockRecorder
- type MockDispatcher
- type MockDispatcherMockRecorder
- type MockFrame
- type MockFrameMockRecorder
- type MockMessageListener
- type MockMessageListenerMockRecorder
- type MockServer
- func (m *MockServer) DialURL() string
- func (m *MockServer) EXPECT() *MockServerMockRecorder
- func (m *MockServer) GetMeta() map[string]string
- func (m *MockServer) GetNamespace() string
- func (m *MockServer) GetProtocol() string
- func (m *MockServer) GetTags() []string
- func (m *MockServer) PublicAddress() string
- func (m *MockServer) PublicPort() uint16
- func (m *MockServer) Push(channelID string, payload []byte) error
- func (m *MockServer) ServiceID() string
- func (m *MockServer) ServiceName() string
- func (m *MockServer) SetAcceptor(acceptor Acceptor)
- func (m *MockServer) SetChannelMap(channelMap ChannelMap)
- func (m *MockServer) SetMessageListener(messageListener MessageListener)
- func (m *MockServer) SetReadwait(readwait time.Duration)
- func (m *MockServer) SetStateListener(stateListener StateListener)
- func (m *MockServer) Shutdown(ctx context.Context) error
- func (m *MockServer) Start() error
- func (m *MockServer) String() string
- type MockServerMockRecorder
- func (mr *MockServerMockRecorder) DialURL() *gomock.Call
- func (mr *MockServerMockRecorder) GetMeta() *gomock.Call
- func (mr *MockServerMockRecorder) GetNamespace() *gomock.Call
- func (mr *MockServerMockRecorder) GetProtocol() *gomock.Call
- func (mr *MockServerMockRecorder) GetTags() *gomock.Call
- func (mr *MockServerMockRecorder) PublicAddress() *gomock.Call
- func (mr *MockServerMockRecorder) PublicPort() *gomock.Call
- func (mr *MockServerMockRecorder) Push(channelID, payload interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) ServiceID() *gomock.Call
- func (mr *MockServerMockRecorder) ServiceName() *gomock.Call
- func (mr *MockServerMockRecorder) SetAcceptor(acceptor interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) SetChannelMap(channelMap interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) SetMessageListener(messageListener interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) SetReadwait(readwait interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) SetStateListener(stateListener interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) Shutdown(ctx interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) Start() *gomock.Call
- func (mr *MockServerMockRecorder) String() *gomock.Call
- type MockService
- type MockServiceMockRecorder
- type MockServiceRegistration
- func (m *MockServiceRegistration) DialURL() string
- func (m *MockServiceRegistration) EXPECT() *MockServiceRegistrationMockRecorder
- func (m *MockServiceRegistration) GetMeta() map[string]string
- func (m *MockServiceRegistration) GetNamespace() string
- func (m *MockServiceRegistration) GetProtocol() string
- func (m *MockServiceRegistration) GetTags() []string
- func (m *MockServiceRegistration) PublicAddress() string
- func (m *MockServiceRegistration) PublicPort() uint16
- func (m *MockServiceRegistration) ServiceID() string
- func (m *MockServiceRegistration) ServiceName() string
- func (m *MockServiceRegistration) String() string
- type MockServiceRegistrationMockRecorder
- func (mr *MockServiceRegistrationMockRecorder) DialURL() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) GetMeta() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) GetNamespace() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) GetProtocol() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) GetTags() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) PublicAddress() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) PublicPort() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) ServiceID() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) ServiceName() *gomock.Call
- func (mr *MockServiceRegistrationMockRecorder) String() *gomock.Call
- type MockSessionStorage
- func (m *MockSessionStorage) Add(session *pkt.Session) error
- func (m *MockSessionStorage) Delete(account, channelID string) error
- func (m *MockSessionStorage) EXPECT() *MockSessionStorageMockRecorder
- func (m *MockSessionStorage) Get(channelID string) (*pkt.Session, error)
- func (m *MockSessionStorage) GetLocation(account, device string) (*Location, error)
- func (m *MockSessionStorage) GetLocations(account ...string) ([]*Location, error)
- type MockSessionStorageMockRecorder
- func (mr *MockSessionStorageMockRecorder) Add(session interface{}) *gomock.Call
- func (mr *MockSessionStorageMockRecorder) Delete(account, channelID interface{}) *gomock.Call
- func (mr *MockSessionStorageMockRecorder) Get(channelID interface{}) *gomock.Call
- func (mr *MockSessionStorageMockRecorder) GetLocation(account, device interface{}) *gomock.Call
- func (mr *MockSessionStorageMockRecorder) GetLocations(account ...interface{}) *gomock.Call
- type MockStateListener
- type MockStateListenerMockRecorder
- type OpCode
- type Router
- type Server
- type ServerOption
- type ServerOptions
- type Service
- type ServiceRegistration
- type Session
- type SessionStorage
- type StateListener
- type Upgrader
Constants ¶
const ( DefaultReadwait = time.Minute * 3 DefaultWritewait = time.Second * 10 DefaultLoginwait = time.Second * 10 DefaultHeartbeat = time.Second * 55 )
const ( DefaultMessageReadPool = 5000 DefaultConnectionPool = 5000 )
Variables ¶
var ErrSessionLost = errors.New("err:session lost")
var ErrSessionNil = errors.New("err:session nil")
Functions ¶
func FromRequest ¶
FromRequest returns the real IP address of the client. It parses the X-Forwarded-For header or the X-Real-Ip header if they are present in the request. Otherwise it returns the request.RemoteAddr. If the request is nil then it returns an empty string.
func GetLocalIP ¶
func GetLocalIP() string
Types ¶
type Acceptor ¶
type Acceptor interface { // 返回有个握手完成的Channel对象或者一个error。 // 业务层需要处理不同协议和网络环境下的连接握手协议。 Accept(conn Conn, timeout time.Duration) (string, Meta, error) }
连接接收器
type Channel ¶
type ChannelImpl ¶
type ChannelImpl struct { Conn // contains filtered or unexported fields }
websocket implementation of Channel
func (*ChannelImpl) Close ¶
func (ch *ChannelImpl) Close() error
func (*ChannelImpl) Push ¶
func (ch *ChannelImpl) Push(payload []byte) error
Push implements Channel 异步写入消息
func (*ChannelImpl) Readloop ¶
func (ch *ChannelImpl) Readloop(lst MessageListener) error
Readloop implements Channel 负责读取消息与心跳处理(SetReadDeadline) 利用atomic保证只被一个线程调用
func (*ChannelImpl) SetReadwait ¶
func (ch *ChannelImpl) SetReadwait(timeout time.Duration)
SetReadwait implements Channel
func (*ChannelImpl) SetWritewait ¶
func (ch *ChannelImpl) SetWritewait(timeout time.Duration)
SetWritewait implements Channel
type ChannelMap ¶
type ChannelMap interface { // add channel Add(ch Channel) // remove channel by id Remove(id string) // get channel by id Get(id string) (Channel, bool) // return all channels All() []Channel }
func NewChannels ¶
func NewChannels(num int) ChannelMap
type ChannlesImpl ¶
type ChannlesImpl struct {
// contains filtered or unexported fields
}
func (*ChannlesImpl) Get ¶
func (cs *ChannlesImpl) Get(id string) (Channel, bool)
Get implements ChannelMap
func (*ChannlesImpl) Remove ¶
func (cs *ChannlesImpl) Remove(id string)
Remove implements ChannelMap
type Context ¶
type Context interface { Dispatcher SessionStorage Header() *pkt.Header ReadBody(value proto.Message) error Session() Session RespWithError(status pkt.Status, err error) error Resp(status pkt.Status, body proto.Message) error Dispatch(body proto.Message, recvs ...*Location) error Next() }
func BuildContext ¶
func BuildContext() Context
type ContextImpl ¶
type ContextImpl struct { sync.Mutex Dispatcher SessionStorage // contains filtered or unexported fields }
ContextImpl the most important part
func (*ContextImpl) Dispatch ¶
func (c *ContextImpl) Dispatch(body protoreflect.ProtoMessage, recvs ...*Location) error
Dispatch implements Context
func (*ContextImpl) ReadBody ¶
func (c *ContextImpl) ReadBody(value protoreflect.ProtoMessage) error
ReadBody implements Context
func (*ContextImpl) Resp ¶
func (c *ContextImpl) Resp(status pkt.Status, body protoreflect.ProtoMessage) error
Resp implements Context
func (*ContextImpl) RespWithError ¶
func (c *ContextImpl) RespWithError(status pkt.Status, err error) error
RespWithError implements Context
type DefaultServer ¶
type DefaultServer struct { Upgrader ServiceRegistration ChannelMap Acceptor MessageListener StateListener // contains filtered or unexported fields }
DefaultServer is a websocket implemnetation of qim.Server
func NewServer ¶
func NewServer( listen string, service ServiceRegistration, upgrader Upgrader, options ...ServerOption, ) *DefaultServer
func (*DefaultServer) Push ¶
func (s *DefaultServer) Push(channelID string, payload []byte) error
Push implements Server
func (*DefaultServer) SetAcceptor ¶
func (s *DefaultServer) SetAcceptor(acceptor Acceptor)
SetAcceptor implements Server
func (*DefaultServer) SetChannelMap ¶
func (s *DefaultServer) SetChannelMap(channelMap ChannelMap)
SetChannelMap implements Server
func (*DefaultServer) SetMessageListener ¶
func (s *DefaultServer) SetMessageListener(messageListener MessageListener)
SetMessageListener implements Server
func (*DefaultServer) SetReadwait ¶
func (s *DefaultServer) SetReadwait(readwait time.Duration)
SetReadwait implements Server
func (*DefaultServer) SetStateListener ¶
func (s *DefaultServer) SetStateListener(stateListener StateListener)
SetStateListener implements Server
type DialerContext ¶
type Dispatcher ¶
The Dispatcher is responsible for dispatch messages to the gateway.
type FuncTree ¶
type FuncTree struct {
// contains filtered or unexported fields
}
FuncTree is a tree structure
func (*FuncTree) Add ¶
func (t *FuncTree) Add(path string, handlers ...HandlerFunc)
type HandlerFunc ¶
type HandlerFunc func(Context)
type HandlersChain ¶
type HandlersChain []HandlerFunc
type MessageListener ¶
监听消息
type MockAcceptor ¶
type MockAcceptor struct {
// contains filtered or unexported fields
}
MockAcceptor is a mock of Acceptor interface.
func NewMockAcceptor ¶
func NewMockAcceptor(ctrl *gomock.Controller) *MockAcceptor
NewMockAcceptor creates a new mock instance.
func (*MockAcceptor) EXPECT ¶
func (m *MockAcceptor) EXPECT() *MockAcceptorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockAcceptorMockRecorder ¶
type MockAcceptorMockRecorder struct {
// contains filtered or unexported fields
}
MockAcceptorMockRecorder is the mock recorder for MockAcceptor.
func (*MockAcceptorMockRecorder) Accept ¶
func (mr *MockAcceptorMockRecorder) Accept(conn, timeout interface{}) *gomock.Call
Accept indicates an expected call of Accept.
type MockAgent ¶
type MockAgent struct {
// contains filtered or unexported fields
}
MockAgent is a mock of Agent interface.
func NewMockAgent ¶
func NewMockAgent(ctrl *gomock.Controller) *MockAgent
NewMockAgent creates a new mock instance.
func (*MockAgent) EXPECT ¶
func (m *MockAgent) EXPECT() *MockAgentMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockAgentMockRecorder ¶
type MockAgentMockRecorder struct {
// contains filtered or unexported fields
}
MockAgentMockRecorder is the mock recorder for MockAgent.
func (*MockAgentMockRecorder) GetMeta ¶
func (mr *MockAgentMockRecorder) GetMeta() *gomock.Call
GetMeta indicates an expected call of GetMeta.
func (*MockAgentMockRecorder) ID ¶
func (mr *MockAgentMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID.
func (*MockAgentMockRecorder) Push ¶
func (mr *MockAgentMockRecorder) Push(payload interface{}) *gomock.Call
Push indicates an expected call of Push.
type MockChannel ¶
type MockChannel struct {
// contains filtered or unexported fields
}
MockChannel is a mock of Channel interface.
func NewMockChannel ¶
func NewMockChannel(ctrl *gomock.Controller) *MockChannel
NewMockChannel creates a new mock instance.
func (*MockChannel) EXPECT ¶
func (m *MockChannel) EXPECT() *MockChannelMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockChannel) LocalAddr ¶
func (m *MockChannel) LocalAddr() net.Addr
LocalAddr mocks base method.
func (*MockChannel) Read ¶
func (m *MockChannel) Read(b []byte) (int, error)
Read mocks base method.
func (*MockChannel) ReadFrame ¶
func (m *MockChannel) ReadFrame() (Frame, error)
ReadFrame mocks base method.
func (*MockChannel) Readloop ¶
func (m *MockChannel) Readloop(lst MessageListener) error
Readloop mocks base method.
func (*MockChannel) RemoteAddr ¶
func (m *MockChannel) RemoteAddr() net.Addr
RemoteAddr mocks base method.
func (*MockChannel) SetDeadline ¶
func (m *MockChannel) SetDeadline(t time.Time) error
SetDeadline mocks base method.
func (*MockChannel) SetReadDeadline ¶
func (m *MockChannel) SetReadDeadline(t time.Time) error
SetReadDeadline mocks base method.
func (*MockChannel) SetReadwait ¶
func (m *MockChannel) SetReadwait(timeout time.Duration)
SetReadwait mocks base method.
func (*MockChannel) SetWriteDeadline ¶
func (m *MockChannel) SetWriteDeadline(t time.Time) error
SetWriteDeadline mocks base method.
func (*MockChannel) SetWritewait ¶
func (m *MockChannel) SetWritewait(timeout time.Duration)
SetWritewait mocks base method.
func (*MockChannel) Write ¶
func (m *MockChannel) Write(b []byte) (int, error)
Write mocks base method.
func (*MockChannel) WriteFrame ¶
func (m *MockChannel) WriteFrame(opcode OpCode, payload []byte) error
WriteFrame mocks base method.
type MockChannelMockRecorder ¶
type MockChannelMockRecorder struct {
// contains filtered or unexported fields
}
MockChannelMockRecorder is the mock recorder for MockChannel.
func (*MockChannelMockRecorder) Close ¶
func (mr *MockChannelMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockChannelMockRecorder) Flush ¶
func (mr *MockChannelMockRecorder) Flush() *gomock.Call
Flush indicates an expected call of Flush.
func (*MockChannelMockRecorder) GetMeta ¶
func (mr *MockChannelMockRecorder) GetMeta() *gomock.Call
GetMeta indicates an expected call of GetMeta.
func (*MockChannelMockRecorder) ID ¶
func (mr *MockChannelMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID.
func (*MockChannelMockRecorder) LocalAddr ¶
func (mr *MockChannelMockRecorder) LocalAddr() *gomock.Call
LocalAddr indicates an expected call of LocalAddr.
func (*MockChannelMockRecorder) Push ¶
func (mr *MockChannelMockRecorder) Push(payload interface{}) *gomock.Call
Push indicates an expected call of Push.
func (*MockChannelMockRecorder) Read ¶
func (mr *MockChannelMockRecorder) Read(b interface{}) *gomock.Call
Read indicates an expected call of Read.
func (*MockChannelMockRecorder) ReadFrame ¶
func (mr *MockChannelMockRecorder) ReadFrame() *gomock.Call
ReadFrame indicates an expected call of ReadFrame.
func (*MockChannelMockRecorder) Readloop ¶
func (mr *MockChannelMockRecorder) Readloop(lst interface{}) *gomock.Call
Readloop indicates an expected call of Readloop.
func (*MockChannelMockRecorder) RemoteAddr ¶
func (mr *MockChannelMockRecorder) RemoteAddr() *gomock.Call
RemoteAddr indicates an expected call of RemoteAddr.
func (*MockChannelMockRecorder) SetDeadline ¶
func (mr *MockChannelMockRecorder) SetDeadline(t interface{}) *gomock.Call
SetDeadline indicates an expected call of SetDeadline.
func (*MockChannelMockRecorder) SetReadDeadline ¶
func (mr *MockChannelMockRecorder) SetReadDeadline(t interface{}) *gomock.Call
SetReadDeadline indicates an expected call of SetReadDeadline.
func (*MockChannelMockRecorder) SetReadwait ¶
func (mr *MockChannelMockRecorder) SetReadwait(timeout interface{}) *gomock.Call
SetReadwait indicates an expected call of SetReadwait.
func (*MockChannelMockRecorder) SetWriteDeadline ¶
func (mr *MockChannelMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call
SetWriteDeadline indicates an expected call of SetWriteDeadline.
func (*MockChannelMockRecorder) SetWritewait ¶
func (mr *MockChannelMockRecorder) SetWritewait(timeout interface{}) *gomock.Call
SetWritewait indicates an expected call of SetWritewait.
func (*MockChannelMockRecorder) Write ¶
func (mr *MockChannelMockRecorder) Write(b interface{}) *gomock.Call
Write indicates an expected call of Write.
func (*MockChannelMockRecorder) WriteFrame ¶
func (mr *MockChannelMockRecorder) WriteFrame(opcode, payload interface{}) *gomock.Call
WriteFrame indicates an expected call of WriteFrame.
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) Connect ¶
func (m *MockClient) Connect(addr string) error
Connect mocks base method.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) GetMeta ¶
func (m *MockClient) GetMeta() map[string]string
GetMeta mocks base method.
func (*MockClient) ServiceName ¶
func (m *MockClient) ServiceName() string
ServiceName mocks base method.
func (*MockClient) SetDialer ¶
func (m *MockClient) SetDialer(dialer Dialer)
SetDialer mocks base method.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) Close ¶
func (mr *MockClientMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockClientMockRecorder) Connect ¶
func (mr *MockClientMockRecorder) Connect(addr interface{}) *gomock.Call
Connect indicates an expected call of Connect.
func (*MockClientMockRecorder) GetMeta ¶
func (mr *MockClientMockRecorder) GetMeta() *gomock.Call
GetMeta indicates an expected call of GetMeta.
func (*MockClientMockRecorder) Read ¶
func (mr *MockClientMockRecorder) Read() *gomock.Call
Read indicates an expected call of Read.
func (*MockClientMockRecorder) Send ¶
func (mr *MockClientMockRecorder) Send(payload interface{}) *gomock.Call
Send indicates an expected call of Send.
func (*MockClientMockRecorder) ServiceID ¶
func (mr *MockClientMockRecorder) ServiceID() *gomock.Call
ServiceID indicates an expected call of ServiceID.
func (*MockClientMockRecorder) ServiceName ¶
func (mr *MockClientMockRecorder) ServiceName() *gomock.Call
ServiceName indicates an expected call of ServiceName.
func (*MockClientMockRecorder) SetDialer ¶
func (mr *MockClientMockRecorder) SetDialer(dialer interface{}) *gomock.Call
SetDialer indicates an expected call of SetDialer.
type MockConn ¶
type MockConn struct {
// contains filtered or unexported fields
}
MockConn is a mock of Conn interface.
func NewMockConn ¶
func NewMockConn(ctrl *gomock.Controller) *MockConn
NewMockConn creates a new mock instance.
func (*MockConn) EXPECT ¶
func (m *MockConn) EXPECT() *MockConnMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConn) RemoteAddr ¶
RemoteAddr mocks base method.
func (*MockConn) SetDeadline ¶
SetDeadline mocks base method.
func (*MockConn) SetReadDeadline ¶
SetReadDeadline mocks base method.
func (*MockConn) SetWriteDeadline ¶
SetWriteDeadline mocks base method.
type MockConnMockRecorder ¶
type MockConnMockRecorder struct {
// contains filtered or unexported fields
}
MockConnMockRecorder is the mock recorder for MockConn.
func (*MockConnMockRecorder) Close ¶
func (mr *MockConnMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockConnMockRecorder) Flush ¶
func (mr *MockConnMockRecorder) Flush() *gomock.Call
Flush indicates an expected call of Flush.
func (*MockConnMockRecorder) LocalAddr ¶
func (mr *MockConnMockRecorder) LocalAddr() *gomock.Call
LocalAddr indicates an expected call of LocalAddr.
func (*MockConnMockRecorder) Read ¶
func (mr *MockConnMockRecorder) Read(b interface{}) *gomock.Call
Read indicates an expected call of Read.
func (*MockConnMockRecorder) ReadFrame ¶
func (mr *MockConnMockRecorder) ReadFrame() *gomock.Call
ReadFrame indicates an expected call of ReadFrame.
func (*MockConnMockRecorder) RemoteAddr ¶
func (mr *MockConnMockRecorder) RemoteAddr() *gomock.Call
RemoteAddr indicates an expected call of RemoteAddr.
func (*MockConnMockRecorder) SetDeadline ¶
func (mr *MockConnMockRecorder) SetDeadline(t interface{}) *gomock.Call
SetDeadline indicates an expected call of SetDeadline.
func (*MockConnMockRecorder) SetReadDeadline ¶
func (mr *MockConnMockRecorder) SetReadDeadline(t interface{}) *gomock.Call
SetReadDeadline indicates an expected call of SetReadDeadline.
func (*MockConnMockRecorder) SetWriteDeadline ¶
func (mr *MockConnMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call
SetWriteDeadline indicates an expected call of SetWriteDeadline.
func (*MockConnMockRecorder) Write ¶
func (mr *MockConnMockRecorder) Write(b interface{}) *gomock.Call
Write indicates an expected call of Write.
func (*MockConnMockRecorder) WriteFrame ¶
func (mr *MockConnMockRecorder) WriteFrame(opcode, payload interface{}) *gomock.Call
WriteFrame indicates an expected call of WriteFrame.
type MockDialer ¶
type MockDialer struct {
// contains filtered or unexported fields
}
MockDialer is a mock of Dialer interface.
func NewMockDialer ¶
func NewMockDialer(ctrl *gomock.Controller) *MockDialer
NewMockDialer creates a new mock instance.
func (*MockDialer) DialAndHandshake ¶
func (m *MockDialer) DialAndHandshake(ctx DialerContext) (net.Conn, error)
DialAndHandshake mocks base method.
func (*MockDialer) EXPECT ¶
func (m *MockDialer) EXPECT() *MockDialerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDialerMockRecorder ¶
type MockDialerMockRecorder struct {
// contains filtered or unexported fields
}
MockDialerMockRecorder is the mock recorder for MockDialer.
func (*MockDialerMockRecorder) DialAndHandshake ¶
func (mr *MockDialerMockRecorder) DialAndHandshake(ctx interface{}) *gomock.Call
DialAndHandshake indicates an expected call of DialAndHandshake.
type MockDispatcher ¶
type MockDispatcher struct {
// contains filtered or unexported fields
}
MockDispatcher is a mock of Dispatcher interface.
func NewMockDispatcher ¶
func NewMockDispatcher(ctrl *gomock.Controller) *MockDispatcher
NewMockDispatcher creates a new mock instance.
func (*MockDispatcher) EXPECT ¶
func (m *MockDispatcher) EXPECT() *MockDispatcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDispatcherMockRecorder ¶
type MockDispatcherMockRecorder struct {
// contains filtered or unexported fields
}
MockDispatcherMockRecorder is the mock recorder for MockDispatcher.
func (*MockDispatcherMockRecorder) Push ¶
func (mr *MockDispatcherMockRecorder) Push(gateway, channels, p interface{}) *gomock.Call
Push indicates an expected call of Push.
type MockFrame ¶
type MockFrame struct {
// contains filtered or unexported fields
}
MockFrame is a mock of Frame interface.
func NewMockFrame ¶
func NewMockFrame(ctrl *gomock.Controller) *MockFrame
NewMockFrame creates a new mock instance.
func (*MockFrame) EXPECT ¶
func (m *MockFrame) EXPECT() *MockFrameMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockFrame) GetPayload ¶
GetPayload mocks base method.
func (*MockFrame) SetPayload ¶
SetPayload mocks base method.
type MockFrameMockRecorder ¶
type MockFrameMockRecorder struct {
// contains filtered or unexported fields
}
MockFrameMockRecorder is the mock recorder for MockFrame.
func (*MockFrameMockRecorder) GetOpCode ¶
func (mr *MockFrameMockRecorder) GetOpCode() *gomock.Call
GetOpCode indicates an expected call of GetOpCode.
func (*MockFrameMockRecorder) GetPayload ¶
func (mr *MockFrameMockRecorder) GetPayload() *gomock.Call
GetPayload indicates an expected call of GetPayload.
func (*MockFrameMockRecorder) SetOpCode ¶
func (mr *MockFrameMockRecorder) SetOpCode(opcode interface{}) *gomock.Call
SetOpCode indicates an expected call of SetOpCode.
func (*MockFrameMockRecorder) SetPayload ¶
func (mr *MockFrameMockRecorder) SetPayload(payload interface{}) *gomock.Call
SetPayload indicates an expected call of SetPayload.
type MockMessageListener ¶
type MockMessageListener struct {
// contains filtered or unexported fields
}
MockMessageListener is a mock of MessageListener interface.
func NewMockMessageListener ¶
func NewMockMessageListener(ctrl *gomock.Controller) *MockMessageListener
NewMockMessageListener creates a new mock instance.
func (*MockMessageListener) EXPECT ¶
func (m *MockMessageListener) EXPECT() *MockMessageListenerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMessageListener) Receive ¶
func (m *MockMessageListener) Receive(agent Agent, payload []byte)
Receive mocks base method.
type MockMessageListenerMockRecorder ¶
type MockMessageListenerMockRecorder struct {
// contains filtered or unexported fields
}
MockMessageListenerMockRecorder is the mock recorder for MockMessageListener.
func (*MockMessageListenerMockRecorder) Receive ¶
func (mr *MockMessageListenerMockRecorder) Receive(agent, payload interface{}) *gomock.Call
Receive indicates an expected call of Receive.
type MockServer ¶
type MockServer struct {
// contains filtered or unexported fields
}
MockServer is a mock of Server interface.
func NewMockServer ¶
func NewMockServer(ctrl *gomock.Controller) *MockServer
NewMockServer creates a new mock instance.
func (*MockServer) EXPECT ¶
func (m *MockServer) EXPECT() *MockServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockServer) GetMeta ¶
func (m *MockServer) GetMeta() map[string]string
GetMeta mocks base method.
func (*MockServer) GetNamespace ¶
func (m *MockServer) GetNamespace() string
GetNamespace mocks base method.
func (*MockServer) GetProtocol ¶
func (m *MockServer) GetProtocol() string
GetProtocol mocks base method.
func (*MockServer) PublicAddress ¶
func (m *MockServer) PublicAddress() string
PublicAddress mocks base method.
func (*MockServer) PublicPort ¶
func (m *MockServer) PublicPort() uint16
PublicPort mocks base method.
func (*MockServer) Push ¶
func (m *MockServer) Push(channelID string, payload []byte) error
Push mocks base method.
func (*MockServer) ServiceName ¶
func (m *MockServer) ServiceName() string
ServiceName mocks base method.
func (*MockServer) SetAcceptor ¶
func (m *MockServer) SetAcceptor(acceptor Acceptor)
SetAcceptor mocks base method.
func (*MockServer) SetChannelMap ¶
func (m *MockServer) SetChannelMap(channelMap ChannelMap)
SetChannelMap mocks base method.
func (*MockServer) SetMessageListener ¶
func (m *MockServer) SetMessageListener(messageListener MessageListener)
SetMessageListener mocks base method.
func (*MockServer) SetReadwait ¶
func (m *MockServer) SetReadwait(readwait time.Duration)
SetReadwait mocks base method.
func (*MockServer) SetStateListener ¶
func (m *MockServer) SetStateListener(stateListener StateListener)
SetStateListener mocks base method.
type MockServerMockRecorder ¶
type MockServerMockRecorder struct {
// contains filtered or unexported fields
}
MockServerMockRecorder is the mock recorder for MockServer.
func (*MockServerMockRecorder) DialURL ¶
func (mr *MockServerMockRecorder) DialURL() *gomock.Call
DialURL indicates an expected call of DialURL.
func (*MockServerMockRecorder) GetMeta ¶
func (mr *MockServerMockRecorder) GetMeta() *gomock.Call
GetMeta indicates an expected call of GetMeta.
func (*MockServerMockRecorder) GetNamespace ¶
func (mr *MockServerMockRecorder) GetNamespace() *gomock.Call
GetNamespace indicates an expected call of GetNamespace.
func (*MockServerMockRecorder) GetProtocol ¶
func (mr *MockServerMockRecorder) GetProtocol() *gomock.Call
GetProtocol indicates an expected call of GetProtocol.
func (*MockServerMockRecorder) GetTags ¶
func (mr *MockServerMockRecorder) GetTags() *gomock.Call
GetTags indicates an expected call of GetTags.
func (*MockServerMockRecorder) PublicAddress ¶
func (mr *MockServerMockRecorder) PublicAddress() *gomock.Call
PublicAddress indicates an expected call of PublicAddress.
func (*MockServerMockRecorder) PublicPort ¶
func (mr *MockServerMockRecorder) PublicPort() *gomock.Call
PublicPort indicates an expected call of PublicPort.
func (*MockServerMockRecorder) Push ¶
func (mr *MockServerMockRecorder) Push(channelID, payload interface{}) *gomock.Call
Push indicates an expected call of Push.
func (*MockServerMockRecorder) ServiceID ¶
func (mr *MockServerMockRecorder) ServiceID() *gomock.Call
ServiceID indicates an expected call of ServiceID.
func (*MockServerMockRecorder) ServiceName ¶
func (mr *MockServerMockRecorder) ServiceName() *gomock.Call
ServiceName indicates an expected call of ServiceName.
func (*MockServerMockRecorder) SetAcceptor ¶
func (mr *MockServerMockRecorder) SetAcceptor(acceptor interface{}) *gomock.Call
SetAcceptor indicates an expected call of SetAcceptor.
func (*MockServerMockRecorder) SetChannelMap ¶
func (mr *MockServerMockRecorder) SetChannelMap(channelMap interface{}) *gomock.Call
SetChannelMap indicates an expected call of SetChannelMap.
func (*MockServerMockRecorder) SetMessageListener ¶
func (mr *MockServerMockRecorder) SetMessageListener(messageListener interface{}) *gomock.Call
SetMessageListener indicates an expected call of SetMessageListener.
func (*MockServerMockRecorder) SetReadwait ¶
func (mr *MockServerMockRecorder) SetReadwait(readwait interface{}) *gomock.Call
SetReadwait indicates an expected call of SetReadwait.
func (*MockServerMockRecorder) SetStateListener ¶
func (mr *MockServerMockRecorder) SetStateListener(stateListener interface{}) *gomock.Call
SetStateListener indicates an expected call of SetStateListener.
func (*MockServerMockRecorder) Shutdown ¶
func (mr *MockServerMockRecorder) Shutdown(ctx interface{}) *gomock.Call
Shutdown indicates an expected call of Shutdown.
func (*MockServerMockRecorder) Start ¶
func (mr *MockServerMockRecorder) Start() *gomock.Call
Start indicates an expected call of Start.
func (*MockServerMockRecorder) String ¶
func (mr *MockServerMockRecorder) String() *gomock.Call
String indicates an expected call of String.
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of Service interface.
func NewMockService ¶
func NewMockService(ctrl *gomock.Controller) *MockService
NewMockService creates a new mock instance.
func (*MockService) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockService) GetMeta ¶
func (m *MockService) GetMeta() map[string]string
GetMeta mocks base method.
func (*MockService) ServiceID ¶
func (m *MockService) ServiceID() string
ServiceID mocks base method.
func (*MockService) ServiceName ¶
func (m *MockService) ServiceName() string
ServiceName mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) GetMeta ¶
func (mr *MockServiceMockRecorder) GetMeta() *gomock.Call
GetMeta indicates an expected call of GetMeta.
func (*MockServiceMockRecorder) ServiceID ¶
func (mr *MockServiceMockRecorder) ServiceID() *gomock.Call
ServiceID indicates an expected call of ServiceID.
func (*MockServiceMockRecorder) ServiceName ¶
func (mr *MockServiceMockRecorder) ServiceName() *gomock.Call
ServiceName indicates an expected call of ServiceName.
type MockServiceRegistration ¶
type MockServiceRegistration struct {
// contains filtered or unexported fields
}
MockServiceRegistration is a mock of ServiceRegistration interface.
func NewMockServiceRegistration ¶
func NewMockServiceRegistration(ctrl *gomock.Controller) *MockServiceRegistration
NewMockServiceRegistration creates a new mock instance.
func (*MockServiceRegistration) DialURL ¶
func (m *MockServiceRegistration) DialURL() string
DialURL mocks base method.
func (*MockServiceRegistration) EXPECT ¶
func (m *MockServiceRegistration) EXPECT() *MockServiceRegistrationMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockServiceRegistration) GetMeta ¶
func (m *MockServiceRegistration) GetMeta() map[string]string
GetMeta mocks base method.
func (*MockServiceRegistration) GetNamespace ¶
func (m *MockServiceRegistration) GetNamespace() string
GetNamespace mocks base method.
func (*MockServiceRegistration) GetProtocol ¶
func (m *MockServiceRegistration) GetProtocol() string
GetProtocol mocks base method.
func (*MockServiceRegistration) GetTags ¶
func (m *MockServiceRegistration) GetTags() []string
GetTags mocks base method.
func (*MockServiceRegistration) PublicAddress ¶
func (m *MockServiceRegistration) PublicAddress() string
PublicAddress mocks base method.
func (*MockServiceRegistration) PublicPort ¶
func (m *MockServiceRegistration) PublicPort() uint16
PublicPort mocks base method.
func (*MockServiceRegistration) ServiceID ¶
func (m *MockServiceRegistration) ServiceID() string
ServiceID mocks base method.
func (*MockServiceRegistration) ServiceName ¶
func (m *MockServiceRegistration) ServiceName() string
ServiceName mocks base method.
func (*MockServiceRegistration) String ¶
func (m *MockServiceRegistration) String() string
String mocks base method.
type MockServiceRegistrationMockRecorder ¶
type MockServiceRegistrationMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceRegistrationMockRecorder is the mock recorder for MockServiceRegistration.
func (*MockServiceRegistrationMockRecorder) DialURL ¶
func (mr *MockServiceRegistrationMockRecorder) DialURL() *gomock.Call
DialURL indicates an expected call of DialURL.
func (*MockServiceRegistrationMockRecorder) GetMeta ¶
func (mr *MockServiceRegistrationMockRecorder) GetMeta() *gomock.Call
GetMeta indicates an expected call of GetMeta.
func (*MockServiceRegistrationMockRecorder) GetNamespace ¶
func (mr *MockServiceRegistrationMockRecorder) GetNamespace() *gomock.Call
GetNamespace indicates an expected call of GetNamespace.
func (*MockServiceRegistrationMockRecorder) GetProtocol ¶
func (mr *MockServiceRegistrationMockRecorder) GetProtocol() *gomock.Call
GetProtocol indicates an expected call of GetProtocol.
func (*MockServiceRegistrationMockRecorder) GetTags ¶
func (mr *MockServiceRegistrationMockRecorder) GetTags() *gomock.Call
GetTags indicates an expected call of GetTags.
func (*MockServiceRegistrationMockRecorder) PublicAddress ¶
func (mr *MockServiceRegistrationMockRecorder) PublicAddress() *gomock.Call
PublicAddress indicates an expected call of PublicAddress.
func (*MockServiceRegistrationMockRecorder) PublicPort ¶
func (mr *MockServiceRegistrationMockRecorder) PublicPort() *gomock.Call
PublicPort indicates an expected call of PublicPort.
func (*MockServiceRegistrationMockRecorder) ServiceID ¶
func (mr *MockServiceRegistrationMockRecorder) ServiceID() *gomock.Call
ServiceID indicates an expected call of ServiceID.
func (*MockServiceRegistrationMockRecorder) ServiceName ¶
func (mr *MockServiceRegistrationMockRecorder) ServiceName() *gomock.Call
ServiceName indicates an expected call of ServiceName.
func (*MockServiceRegistrationMockRecorder) String ¶
func (mr *MockServiceRegistrationMockRecorder) String() *gomock.Call
String indicates an expected call of String.
type MockSessionStorage ¶
type MockSessionStorage struct {
// contains filtered or unexported fields
}
MockSessionStorage is a mock of SessionStorage interface.
func NewMockSessionStorage ¶
func NewMockSessionStorage(ctrl *gomock.Controller) *MockSessionStorage
NewMockSessionStorage creates a new mock instance.
func (*MockSessionStorage) Add ¶
func (m *MockSessionStorage) Add(session *pkt.Session) error
Add mocks base method.
func (*MockSessionStorage) Delete ¶
func (m *MockSessionStorage) Delete(account, channelID string) error
Delete mocks base method.
func (*MockSessionStorage) EXPECT ¶
func (m *MockSessionStorage) EXPECT() *MockSessionStorageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSessionStorage) Get ¶
func (m *MockSessionStorage) Get(channelID string) (*pkt.Session, error)
Get mocks base method.
func (*MockSessionStorage) GetLocation ¶
func (m *MockSessionStorage) GetLocation(account, device string) (*Location, error)
GetLocation mocks base method.
func (*MockSessionStorage) GetLocations ¶
func (m *MockSessionStorage) GetLocations(account ...string) ([]*Location, error)
GetLocations mocks base method.
type MockSessionStorageMockRecorder ¶
type MockSessionStorageMockRecorder struct {
// contains filtered or unexported fields
}
MockSessionStorageMockRecorder is the mock recorder for MockSessionStorage.
func (*MockSessionStorageMockRecorder) Add ¶
func (mr *MockSessionStorageMockRecorder) Add(session interface{}) *gomock.Call
Add indicates an expected call of Add.
func (*MockSessionStorageMockRecorder) Delete ¶
func (mr *MockSessionStorageMockRecorder) Delete(account, channelID interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockSessionStorageMockRecorder) Get ¶
func (mr *MockSessionStorageMockRecorder) Get(channelID interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockSessionStorageMockRecorder) GetLocation ¶
func (mr *MockSessionStorageMockRecorder) GetLocation(account, device interface{}) *gomock.Call
GetLocation indicates an expected call of GetLocation.
func (*MockSessionStorageMockRecorder) GetLocations ¶
func (mr *MockSessionStorageMockRecorder) GetLocations(account ...interface{}) *gomock.Call
GetLocations indicates an expected call of GetLocations.
type MockStateListener ¶
type MockStateListener struct {
// contains filtered or unexported fields
}
MockStateListener is a mock of StateListener interface.
func NewMockStateListener ¶
func NewMockStateListener(ctrl *gomock.Controller) *MockStateListener
NewMockStateListener creates a new mock instance.
func (*MockStateListener) Disconnect ¶
func (m *MockStateListener) Disconnect(channelID string) error
Disconnect mocks base method.
func (*MockStateListener) EXPECT ¶
func (m *MockStateListener) EXPECT() *MockStateListenerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockStateListenerMockRecorder ¶
type MockStateListenerMockRecorder struct {
// contains filtered or unexported fields
}
MockStateListenerMockRecorder is the mock recorder for MockStateListener.
func (*MockStateListenerMockRecorder) Disconnect ¶
func (mr *MockStateListenerMockRecorder) Disconnect(channelID interface{}) *gomock.Call
Disconnect indicates an expected call of Disconnect.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) Handle ¶
func (r *Router) Handle(command string, handlers ...HandlerFunc)
Handle register a command handler
func (*Router) Serve ¶
func (r *Router) Serve(packet *pkt.LogicPkt, dispacther Dispatcher, cache SessionStorage, session Session) error
func (*Router) Use ¶
func (r *Router) Use(handlers ...HandlerFunc)
type Server ¶
type Server interface { ServiceRegistration SetAcceptor(acceptor Acceptor) SetMessageListener(messageListener MessageListener) SetStateListener(stateListener StateListener) SetReadwait(readwait time.Duration) SetChannelMap(channelMap ChannelMap) // Start 用于在内部实现网络端口的监听和接收连接, // 并完成一个Channel的初始化过程。 Start() error // Push消息到指定的Channel中, Push(channelID string, payload []byte) error // 服务下线,关闭连接 Shutdown(ctx context.Context) error }
适用于不同底层协议(tcp、websocket)的通用服务端接口
type ServerOption ¶
type ServerOption func(*ServerOptions)
func WithConnectionGPool ¶
func WithConnectionGPool(val int) ServerOption
func WithMessageGPool ¶
func WithMessageGPool(val int) ServerOption
type ServerOptions ¶
type ServiceRegistration ¶
type ServiceRegistration interface { Service PublicAddress() string PublicPort() uint16 DialURL() string GetTags() []string GetProtocol() string GetNamespace() string String() string }
服务注册的抽象接口
type Session ¶
type Session interface { GetChannelId() string GetGateId() string GetAccount() string GetRemoteIp() string GetApp() string GetTags() []string }
Session read only
type SessionStorage ¶
type StateListener ¶
状态监听器