Documentation ¶
Overview ¶
Code generated by smist. DO NOT EDIT.
Code generated by smist. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func Pack_hnep_BeHackAns(email string, msg *hnep.BeHackAns) (resp *hmsg.Message, err error)
- func Pack_hnep_HackAsk(email string, msg *hnep.HackAsk) (resp *hmsg.Message, err error)
- func Pack_hnep_StrMsg(email string, msg *hnep.StrMsg) (resp *hmsg.Message, err error)
- func Pack_hnp_CheckEmail(email string, msg *hnp.CheckEmail) (resp *hmsg.Message, err error)
- func Pack_hnp_Forward(email string, msg *hnp.Forward) (resp *hmsg.Message, err error)
- func Pack_hnp_ForwardMsg(email string, msg *hnp.ForwardMsg) (resp *hmsg.Message, err error)
- func Pack_hnp_HeartJump(email string, msg *hnp.HeartJump) (resp *hmsg.Message, err error)
- func Pack_hnp_Register(email string, msg *hnp.Register) (resp *hmsg.Message, err error)
- func Pack_hnp_Result(email string, msg *hnp.Result) (resp *hmsg.Message, err error)
- func Pack_udpfwd_UDPFwdMsg(email string, msg *udpfwd.UDPFwdMsg) (resp *hmsg.Message, err error)
- func SetServerForClientFactory(factory ServerFactory)
- type OnForwardMsg
- type OnResultMsg
- type ServerFactory
- type ServerItf
Constants ¶
const (
// FailAddrNotEqual ip not equal.
FailAddrNotEqual = "FailIpNotEqual"
)
const MaxPackageSize = 1024
MaxPackageSize udp package's max size.
Variables ¶
var ( // ErrNoSuchHacker can't found this hacker by email. ErrNoSuchHacker = errors.New("ErrNoSuchHacker") // ErrUnexceptEnum enum not in except in this deal function. ErrUnexceptEnum = errors.New("ErrUnexceptEnum") // ErrHackerExist hacker is exist. ErrHackerExist = errors.New("ErrHackerExist") )
Functions ¶
func Pack_hnep_BeHackAns ¶
Pack_hnep_BeHackAns pack message hnep_BeHackAns.
func Pack_hnep_HackAsk ¶
Pack_hnep_HackAsk pack message hnep_HackAsk.
func Pack_hnep_StrMsg ¶
Pack_hnep_StrMsg pack message hnep_StrMsg.
func Pack_hnp_CheckEmail ¶
Pack_hnp_CheckEmail pack message hnp_CheckEmail.
func Pack_hnp_Forward ¶
Pack_hnp_Forward pack message hnp_Forward.
func Pack_hnp_ForwardMsg ¶
Pack_hnp_ForwardMsg pack message hnp_ForwardMsg.
func Pack_hnp_HeartJump ¶
Pack_hnp_HeartJump pack message hnp_HeartJump.
func Pack_hnp_Register ¶
@SMIST setIgnoreInput(true); include('parseProtos.js'); packMsgs("./datas/protos/hnp.proto") packMsgs("./datas/protos/hnep.proto") packMsgs("./datas/protos/udpfwd.proto")
Pack_hnp_Register pack message hnp_Register.
func Pack_hnp_Result ¶
Pack_hnp_Result pack message hnp_Result.
func Pack_udpfwd_UDPFwdMsg ¶
Pack_udpfwd_UDPFwdMsg pack message udpfwd_UDPFwdMsg.
func SetServerForClientFactory ¶
func SetServerForClientFactory(factory ServerFactory)
SetServerForClientFactory set factory.
Types ¶
type OnForwardMsg ¶
type OnForwardMsg func(email string, hackerAddr *net.UDPAddr, msg *hnp.ForwardMsg) ( string, map[string]interface{}, error)
OnForwardMsg on forward msg.
type OnResultMsg ¶
type OnResultMsg func(email string, hackerAddr *net.UDPAddr, msg *hnp.Result) ( string, map[string]interface{}, error)
OnResultMsg on result msg.
type ServerFactory ¶
type ServerFactory func(port int, email, pubKey string, onForwardMsg OnForwardMsg, onResultMsg OnResultMsg) ServerItf
ServerFactory product server for client.
type ServerItf ¶
type ServerItf interface { // GetUDPConn get server's udp conn. GetUDPConn() *net.UDPConn // GetPointMgr get server's poingMgr. GetPointMgr() pinfo.PointInfoMgrItf // Register register this client to server. Register(email string, hackerAddr *net.UDPAddr, msg *hnp.Register) (string, map[string]interface{}, error) // Result register result Result(email string, hackerAddr *net.UDPAddr, msg *hnp.Result) (string, map[string]interface{}, error) // CheckEmail check if email belong to register. CheckEmail(email string, hackerAddr *net.UDPAddr, msg *hnp.CheckEmail) (string, map[string]interface{}, error) // Forward send email to another point. Forward(email string, hackerAddr *net.UDPAddr, msg *hnp.Forward) (string, map[string]interface{}, error) // ForwardMsg send message to the point. ForwardMsg(email string, hackerAddr *net.UDPAddr, msg *hnp.ForwardMsg) (string, map[string]interface{}, error) // HeartJump heart jump just for keep alive. HeartJump(email string, hackerAddr *net.UDPAddr, msg *hnp.HeartJump) (string, map[string]interface{}, error) }
@SMIST include("parseProtos.js"); setIgnoreInput(true); proto2GoItf("./datas/protos/hnp.proto", "ServerItf", "server for client")
ServerItf server for client.
func NewServer ¶
func NewServer(port int, email, pubKey string, onForwardMsg OnForwardMsg, onResultMsg OnResultMsg) ServerItf
NewServer create.