Versions in this module Expand all Collapse all v1 v1.0.1 Jun 28, 2022 v1.0.0 Jun 24, 2022 Changes in this version + var ErrInvalidAddressFormat = errors.New("invalid address format") + var ErrInvalidPortRange = errors.New("invalid port range") + var ErrMaxPacket = errors.New("packet over size") + var ErrMinPacket = errors.New("packet short size") + var ErrShortMsgID = errors.New("short msgid") + func BytesMD5(data []byte) string + func CompressBytes(data []byte) ([]byte, error) + func DecompressBytes(data []byte) ([]byte, error) + func DetectPort(addr string, fn func(a *Address, port int) (interface{}, error)) (interface{}, error) + func FileExists(name string) bool + func FileSize(name string) int64 + func GetLocalIP() string + func GetPrivateIPv4() ([]*net.IPAddr, error) + func GetPublicIPv6() ([]*net.IPAddr, error) + func GetRemoteAddrss(ses cellnet.Session) (string, bool) + func IsEOFOrNetReadError(err error) bool + func JoinAddress(host string, port int) string + func ReadFileLines(filename string, callback func(line string) bool) error + func ReadKVFile(filename string, callback func(k, v string) bool) (ret error) + func RecvLTVPacket(reader io.Reader, maxPacketSize int) (msg interface{}, err error) + func SendLTVPacket(writer io.Writer, ctx cellnet.ContextSet, data interface{}) error + func SpliteAddress(addr string) (host string, port int, err error) + func StackToString(count int) string + func StringHash(s string) (hash uint16) + func StringMD5(str string) string + func WriteFull(writer io.Writer, buf []byte) error + type Address struct + Host string + MaxPort int + MinPort int + Path string + Scheme string + func ParseAddress(addr string) (addrObj *Address, err error) + func (self *Address) HostPortString(port int) string + func (self *Address) String(port int) string + type KVPair struct + Key string + Value string + func ReadKVFileValues(filename string) (ret []KVPair, err error) + type Queue struct + func NewQueue(size int) *Queue + func (self *Queue) Clear() + func (self *Queue) Count() int + func (self *Queue) Dequeue() (ret interface{}) + func (self *Queue) Enqueue(data interface{}) + func (self *Queue) Peek() interface{} + type RemoteAddr interface + RemoteAddr func() net.Addr