Documentation ¶
Index ¶
- Constants
- func Decode(conn net.Conn) (byte, []byte, error)
- func Encode(cmd byte, payload []byte) ([]byte, error)
- func OSID(goos string) int
- func Response(data interface{}, err error) []byte
- func Version() string
- type C2GRegister
- type C2SAuthorize
- type G2CRegister
- type G2SRgister
- type ResponseBody
- type S2CAuthorize
- type S2GRegister
- type S2GUpdate
Constants ¶
View Source
const ( CODE_SUCCESS = 10000 CODE_REGISTER_FAIL = 10001 CODE_FAIL = 99999 )
View Source
const ( C2C_DATA = byte(0x00) C2S_DATA = byte(0x01) S2C_DATA = byte(0x02) C2S_HEARTBEAT = byte(0x03) S2C_HEARTBEAT = byte(0x04) C2S_AUTHORIZE = byte(0x05) S2C_AUTHORIZE = byte(0x06) )
S => gtund(gtun server) C => gtun(gtun client)
View Source
const ( S2G_REGISTER = iota G2S_REGISTER S2G_HEARTBEAT G2S_HEARTBEAT S2G_UPDATE_CLIENT_COUNT G2S_UPDATE_CLIENT_COUNT )
S => gtund(gtun server) G => god
View Source
const (
MAX_PAYLOAD = 1<<16 - 1
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type C2GRegister ¶
type C2SAuthorize ¶
type G2CRegister ¶
type G2CRegister struct {
ServerAddress string `json:"server_address"`
}
type G2SRgister ¶
type G2SRgister struct {
GtundAddress string `json:"gtund_addr"`
}
type ResponseBody ¶
type S2CAuthorize ¶
type S2GRegister ¶
Click to show internal directories.
Click to hide internal directories.