Documentation ¶
Index ¶
- type NioClientsStore
- func (instance *NioClientsStore) Count() int
- func (instance *NioClientsStore) Descriptors() []*NioConnectionDescriptor
- func (instance *NioClientsStore) Get(connId string) (response *NioConnection)
- func (instance *NioClientsStore) Ids() []string
- func (instance *NioClientsStore) Pop(connId string) (response *NioConnection)
- func (instance *NioClientsStore) Push(conn net.Conn) (response *NioConnection)
- type NioConnection
- func (instance *NioConnection) Close()
- func (instance *NioConnection) Conn() (conn net.Conn)
- func (instance *NioConnection) GetAddr() (response string)
- func (instance *NioConnection) GetId() (response string)
- func (instance *NioConnection) GetPublicKey() (response *rsa.PublicKey)
- func (instance *NioConnection) ParseDescriptor(descriptor string)
- func (instance *NioConnection) ReadMessage() (response *nio_commons.NioMessage, err error)
- func (instance *NioConnection) String() string
- func (instance *NioConnection) WriteHandshake(body interface{}) (err error)
- func (instance *NioConnection) WriteMessage(body interface{}, isHandshake bool) error
- type NioConnectionDescriptor
- type NioMessageHandler
- type NioServer
- func (instance *NioServer) ClientDescriptors() []*NioConnectionDescriptor
- func (instance *NioServer) ClientsCount() int
- func (instance *NioServer) ClientsId() []string
- func (instance *NioServer) Close() error
- func (instance *NioServer) GetPublicKey() (response *rsa.PublicKey)
- func (instance *NioServer) GetUUID() string
- func (instance *NioServer) IsOpen() bool
- func (instance *NioServer) Join()
- func (instance *NioServer) OnMessage(callback NioMessageHandler)
- func (instance *NioServer) OnNewConn(callback func(conn *NioConnection))
- func (instance *NioServer) Open() (err error)
- func (instance *NioServer) Port() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NioClientsStore ¶
type NioClientsStore struct {
// contains filtered or unexported fields
}
func NewNioClientsStore ¶
func NewNioClientsStore(publicKey func() *rsa.PublicKey) (instance *NioClientsStore)
func (*NioClientsStore) Count ¶
func (instance *NioClientsStore) Count() int
func (*NioClientsStore) Descriptors ¶
func (instance *NioClientsStore) Descriptors() []*NioConnectionDescriptor
func (*NioClientsStore) Get ¶
func (instance *NioClientsStore) Get(connId string) (response *NioConnection)
func (*NioClientsStore) Ids ¶
func (instance *NioClientsStore) Ids() []string
func (*NioClientsStore) Pop ¶
func (instance *NioClientsStore) Pop(connId string) (response *NioConnection)
func (*NioClientsStore) Push ¶
func (instance *NioClientsStore) Push(conn net.Conn) (response *NioConnection)
type NioConnection ¶
type NioConnection struct { Descriptor *NioConnectionDescriptor // contains filtered or unexported fields }
func WrapConnection ¶
func WrapConnection(conn net.Conn, serverKey *rsa.PublicKey) (instance *NioConnection)
func (*NioConnection) Close ¶
func (instance *NioConnection) Close()
func (*NioConnection) Conn ¶
func (instance *NioConnection) Conn() (conn net.Conn)
func (*NioConnection) GetAddr ¶
func (instance *NioConnection) GetAddr() (response string)
func (*NioConnection) GetId ¶
func (instance *NioConnection) GetId() (response string)
func (*NioConnection) GetPublicKey ¶
func (instance *NioConnection) GetPublicKey() (response *rsa.PublicKey)
func (*NioConnection) ParseDescriptor ¶
func (instance *NioConnection) ParseDescriptor(descriptor string)
func (*NioConnection) ReadMessage ¶
func (instance *NioConnection) ReadMessage() (response *nio_commons.NioMessage, err error)
func (*NioConnection) String ¶
func (instance *NioConnection) String() string
func (*NioConnection) WriteHandshake ¶
func (instance *NioConnection) WriteHandshake(body interface{}) (err error)
func (*NioConnection) WriteMessage ¶
func (instance *NioConnection) WriteMessage(body interface{}, isHandshake bool) error
type NioConnectionDescriptor ¶
type NioConnectionDescriptor struct { Id string `json:"id"` Addr string `json:"addr"` Name string `json:"name"` Description string `json:"description"` }
func (*NioConnectionDescriptor) String ¶
func (instance *NioConnectionDescriptor) String() string
type NioMessageHandler ¶
type NioMessageHandler func(message *nio_commons.NioMessage) interface{}
type NioServer ¶
type NioServer struct {
// contains filtered or unexported fields
}
func NewNioServer ¶
func (*NioServer) ClientDescriptors ¶
func (instance *NioServer) ClientDescriptors() []*NioConnectionDescriptor
func (*NioServer) ClientsCount ¶
func (*NioServer) GetPublicKey ¶
func (*NioServer) OnMessage ¶
func (instance *NioServer) OnMessage(callback NioMessageHandler)
func (*NioServer) OnNewConn ¶
func (instance *NioServer) OnNewConn(callback func(conn *NioConnection))
Click to show internal directories.
Click to hide internal directories.