Documentation ¶
Index ¶
- Constants
- func ClientRegisterSimple(moduleId ModuleId, module CmdHelper, operates []CmdHelper) *cobra.Command
- func CommmandGetResult(mid ModuleId, operate int, arg string) (string, error)
- func GetOrgId() uint16
- func RecvFromServer(conn *net.UDPConn) (*bytes.Buffer, error)
- func RecvFromServerMulti(conn *net.UDPConn) (*bytes.Buffer, error)
- func Register(module ModuleId, process CommandLineProcess)
- func RegisterCommand(root *cobra.Command, moduleId ModuleId, handle RegisterCommmandLine)
- func RegisterLogLevelCommand() *cobra.Command
- func SendToClient(conn *net.UDPConn, remote *net.UDPAddr, result uint32, args *bytes.Buffer)
- func SendToServer(module ModuleId, operate ModuleOperate, args *bytes.Buffer) (*net.UDPConn, *bytes.Buffer, error)
- func ServerRegisterSimple(module ModuleId, process CommandSimpleProcess)
- func SetIpAndPort(ip string, port int)
- func SetOrgId(id int)
- type CmdHelper
- type CommandLineProcess
- type CommandSimpleProcess
- type DebugMessage
- type LogLevelControl
- type ModuleId
- type ModuleOperate
- type RegisterCommmandLine
Constants ¶
View Source
const ( LOG_LEVEL_CMD_SHOW = iota LOG_LEVEL_CMD_SET )
View Source
const ( DEFAULT_LISTEN_PORT = 9528 UDP_MAXLEN = 9710 MAX_PAYLOAD_LEN = UDP_MAXLEN - 128 //发送时会封装为DebugMessage,净荷为DebugMessage的Args MODULE_MAX = 32 )
View Source
const (
LOG_LEVEL_CMD = 20
)
Variables ¶
This section is empty.
Functions ¶
func ClientRegisterSimple ¶
client注册命令
func CommmandGetResult ¶
func RegisterCommand ¶
func RegisterCommand(root *cobra.Command, moduleId ModuleId, handle RegisterCommmandLine)
client注册命令处理
func SendToClient ¶
func SendToServer ¶
func ServerRegisterSimple ¶
func ServerRegisterSimple(module ModuleId, process CommandSimpleProcess)
server端注册简单命令, module值要大于MODULE_MAX, 小于2*MODULE_MAX
func SetIpAndPort ¶
Types ¶
type CommandLineProcess ¶
type CommandSimpleProcess ¶
增加简单的命令接口, 支持一个字符串输入参数
type DebugMessage ¶
type LogLevelControl ¶
type LogLevelControl struct { }
func NewLogLevelControl ¶
func NewLogLevelControl() *LogLevelControl
func (*LogLevelControl) RecvCommand ¶
type ModuleOperate ¶
type ModuleOperate uint16
type RegisterCommmandLine ¶
Click to show internal directories.
Click to hide internal directories.