Documentation ¶
Index ¶
- Variables
- func Decode(data []byte) (string, string, []byte)
- func DecodeProto(data []byte, dataProto proto.Message) proto.Message
- func Encode(dataHandler, dataType string, dataProto proto.Message) []byte
- func TLSCert(domain string) (tls.Certificate, error)
- type CTcp
- type CWs
- type Client
- type ClientConfig
- type ConnPool
- type SMessage
- func (*SMessage) Descriptor() ([]byte, []int)deprecated
- func (x *SMessage) GetHandler() string
- func (x *SMessage) GetProto() []byte
- func (x *SMessage) GetType() string
- func (*SMessage) ProtoMessage()
- func (x *SMessage) ProtoReflect() protoreflect.Message
- func (x *SMessage) Reset()
- func (x *SMessage) String() string
- type STcp
- func (s *STcp) Broadcast(data []byte, except ...map[string]bool)
- func (s *STcp) GetConnection(connectionID string) net.Conn
- func (s *STcp) IsConnection(connectionID string) bool
- func (s *STcp) Listen(ctx context.Context) error
- func (s *STcp) Send(connectionID string, data []byte)
- func (s *STcp) Shutdown()
- type SWs
- func (s *SWs) Broadcast(data []byte, except ...map[string]bool)
- func (s *SWs) GetConnection(connectionID string) *websocket.Conn
- func (s *SWs) IsConnection(connectionID string) bool
- func (s *SWs) Listen(ctx context.Context) error
- func (s *SWs) Send(connectionID string, data []byte)
- func (s *SWs) Shutdown()
- type Server
- func (s *Server) Broadcast(dataHandler, dataType string, data proto.Message, except ...map[string]bool)
- func (s *Server) GetConnection(connectionID string) interface{}
- func (s *Server) Listen()
- func (s *Server) Send(connectionID string, dataHandler, dataType string, data proto.Message)
- func (s *Server) Shutdown()
- type ServerConfig
- type TCPConnectionEntry
- type WSConnectionEntry
Constants ¶
This section is empty.
Variables ¶
View Source
var File_pb_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type CTcp ¶
type CTcp struct {
// contains filtered or unexported fields
}
func TCPNewC ¶
func TCPNewC(config ClientConfig, ctx context.Context, cancel context.CancelFunc) *CTcp
func (*CTcp) Disconnect ¶
func (c *CTcp) Disconnect()
type CWs ¶
type CWs struct {
// contains filtered or unexported fields
}
func WSNewC ¶
func WSNewC(config ClientConfig, ctx context.Context, cancel context.CancelFunc) *CWs
func (*CWs) Disconnect ¶
func (c *CWs) Disconnect()
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config ClientConfig) *Client
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
type ClientConfig ¶
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
func NewConnPool ¶
type SMessage ¶
type SMessage struct { Handler string `protobuf:"bytes,1,opt,name=handler,proto3" json:"handler,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Proto []byte `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"` // contains filtered or unexported fields }
func (*SMessage) Descriptor
deprecated
func (*SMessage) GetHandler ¶
func (*SMessage) ProtoMessage ¶
func (*SMessage) ProtoMessage()
func (*SMessage) ProtoReflect ¶
func (x *SMessage) ProtoReflect() protoreflect.Message
type STcp ¶
type STcp struct {
// contains filtered or unexported fields
}
func TCPNewS ¶
func TCPNewS(config ServerConfig) *STcp
func (*STcp) IsConnection ¶
type SWs ¶
type SWs struct {
// contains filtered or unexported fields
}
func WSNewS ¶
func WSNewS(config ServerConfig) *SWs
func (*SWs) IsConnection ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(config ServerConfig) *Server
func (*Server) GetConnection ¶
type ServerConfig ¶
type TCPConnectionEntry ¶
type WSConnectionEntry ¶
Click to show internal directories.
Click to hide internal directories.