Documentation ¶
Index ¶
- Variables
- func Base64SuccMessage() []byte
- func CalReadData(readLen int, buf []byte, temp []byte) (int32, []byte, []byte)
- func CalSendByteData(writeData []byte) []byte
- func CalSendData(writeData string) []byte
- func CommonInit()
- func Debug(args ...interface{})
- func Error(args ...interface{})
- func Handle(conn net.Conn, agent net.Conn, gate *Gate)
- func HandlerShake(conn net.Conn, dialTimeout time.Duration, conType ConnectType) (net.Conn, error)
- func Info(args ...interface{})
- func InitConfig()
- func InitLog(logPath string, errorPath string)
- func InitLogSimple()
- func WsHandle(conn net.Conn, agent net.Conn, gate *Gate)
- func WsHandshake(conn net.Conn, dialTimeout time.Duration) (net.Conn, error)
- type CommonConfig
- type ConnectType
- type Gate
- type IKeyIdentify
- type IpHostIdentify
- type JwtKeyIdentify
Constants ¶
This section is empty.
Variables ¶
View Source
var BytesPool = sync.Pool{ New: func() interface{} { var buffer = bytes.NewBuffer(make([]byte, 2048)) return buffer }, }
BytesPool 字节数据流 池化
View Source
var TomlConfig = &tomlConfig{}
TomlConfig 配置
Functions ¶
func Base64SuccMessage ¶
func Base64SuccMessage() []byte
func CalSendByteData ¶
func CalSendData ¶
func HandlerShake ¶
HandlerShake 握手
func InitLogSimple ¶
func InitLogSimple()
Types ¶
type CommonConfig ¶
type ConnectType ¶
type ConnectType int
const ( CONNECT_TYPE_TCP ConnectType = 0 CONNECT_TYPE_KCP ConnectType = 1 CONNECT_TYPE_WS ConnectType = 2 )
type Gate ¶
type Gate struct { Port int `toml:"port"` Enabled bool `toml:"enabled"` DialTimeout int `toml:"dial_timeout"` ZeroCopy bool `toml:"zero_copy"` }
Gate 配置
type IKeyIdentify ¶
type IKeyIdentify interface {
// contains filtered or unexported methods
}
IKeyIdentify 接口
Click to show internal directories.
Click to hide internal directories.