Versions in this module Expand all Collapse all v0 v0.0.1 Jan 6, 2025 Changes in this version + func SetLogLevel(level Level) error + type CountdownTimer struct + func NewCountdownTimer(seconds int64, callback func(string)) *CountdownTimer + func (timer *CountdownTimer) Remove(key string) + func (timer *CountdownTimer) SetExpiration(seconds int64) + func (timer *CountdownTimer) Update(key string) + type Level string + var DebugLevel Level = "debug" + var ErrorLevel Level = "error" + var FatalLevel Level = "fatal" + var InfoLevel Level = "info" + var PanicLevel Level = "panic" + var TraceLevel Level = "trace" + var WarnLevel Level = "warn" + type MessageHandler func(*Session, *protocol.Message) + type MultipartFile struct + IccID uint64 + MsgID protocol.MsgID + Sum uint16 + Tag uint32 + func (m MultipartFile) IsFull() bool + func (m MultipartFile) Merge() (io.ReadCloser, error) + func (m MultipartFile) Write(seq uint16, data []byte) error + type Options struct + AutoMergePacket bool + CloseHandler func(*Session) + Keepalive int64 + PrivateKey *rsa.PrivateKey + type Protocol struct + func (p Protocol) NewCodec(rw io.ReadWriter) (link.Codec, error) + type ProtocolCodec struct + func (codec *ProtocolCodec) Close() error + func (codec *ProtocolCodec) GetPublicKey() *rsa.PublicKey + func (codec *ProtocolCodec) Receive() (interface{}, error) + func (codec *ProtocolCodec) Send(msg interface{}) error + func (codec *ProtocolCodec) SetPublicKey(publicKey *rsa.PublicKey) + type Server struct + func NewServer(options Options) (*Server, error) + func (server *Server) AddHandler(msgID protocol.MsgID, handler MessageHandler) + func (server *Server) Broadcast(entity protocol.Entity) int + func (server *Server) GetPrivateKey() *rsa.PrivateKey + func (server *Server) GetSession(id uint64) (*Session, bool) + func (server *Server) Run(network string, port int) error + func (server *Server) Stop() + type Session struct + UserData interface{} + func (session *Session) Close() error + func (session *Session) GetPublicKey() *rsa.PublicKey + func (session *Session) GetServer() *Server + func (session *Session) ID() uint64 + func (session *Session) Reply(msg *protocol.Message, result protocol.Result) (uint16, error) + func (session *Session) Request(entity protocol.Entity, cb func(answer *protocol.Message)) (uint16, error) + func (session *Session) Send(entity protocol.Entity) (uint16, error) + func (session *Session) SetPublicKey(publicKey *rsa.PublicKey)