Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToInt(b []byte) int
- func Call(m map[string]interface{}, name string, params ...interface{}) (result []reflect.Value, err error)
- func FileIsExist(FileName string) bool
- func GetRunDir() string
- func GetServiceName(str string) string
- func IntToBytes(n int) []byte
- func LogToFile()
- func Packet(message []byte) []byte
- func Unpack(buffer []byte, reader *[]byte) []byte
- type Client
- func (this *Client) ConnWrite(data Msg)
- func (this *Client) ConnWriteReturn(data Msg) (msg Msg)
- func (this *Client) HeartBeat()
- func (this *Client) InitMethods(m map[string]interface{})
- func (this *Client) MsgReturn(data Msg)
- func (this *Client) SericeInit()
- func (this *Client) ServiceHandle(conn net.Conn)
- func (this *Client) ServiceProcess(str []byte)
- func (this *Client) ServiceWriteHandle(conn net.Conn)
- type ConfigModel
- type ConnInsID
- type Msg
- type Resp
- type ServicesModel
Constants ¶
View Source
const ( ConstHeader = "{28285252_hcaiyue_top_15159898}" ConstHeaderLength = len(ConstHeader) ConstSaveDataLength = 8 )
Variables ¶
View Source
var ServiceName = GetServiceName(os.Args[0])
Functions ¶
func FileIsExist ¶
func GetServiceName ¶
Types ¶
type Client ¶
type Client struct { Conn net.Conn Msgreturn map[string]chan Msg Methods map[string]interface{} WriteChan chan []byte }
func InitClient ¶
func InitClient() *Client
func (*Client) ConnWriteReturn ¶
func (*Client) InitMethods ¶
func (*Client) SericeInit ¶
func (this *Client) SericeInit()
func (*Client) ServiceHandle ¶
func (*Client) ServiceProcess ¶
func (*Client) ServiceWriteHandle ¶
type ConfigModel ¶
type ConfigModel struct { Services []ServicesModel `json:"services"` Routing map[string]string `json:"routing"` }
type ConnInsID ¶
type ConnInsID struct { ID int64 // contains filtered or unexported fields }
var CID ConnInsID
type ServicesModel ¶
Click to show internal directories.
Click to hide internal directories.