Documentation
¶
Index ¶
- Variables
- func CleanGls()
- func DumpCommands() (s string)
- func GetRegisterErr() []string
- func HaveSubCommand(currentView, commandName string) bool
- func MarshalArgs(args ...interface{}) ([]string, error)
- func RegisterCommandType(commandName string, typ *CommandType) interface{}
- func SetGlsCommand(c *Command)
- func UnmarshalArgs(kinds []Kind, args ...string) ([]interface{}, error)
- type Command
- type CommandType
- type Kind
Constants ¶
This section is empty.
Variables ¶
View Source
var AnyView = "Global"
View Source
var Dummy bool
Functions ¶
func CleanGls ¶
func CleanGls()
func RegisterCommandType ¶
func RegisterCommandType(commandName string, typ *CommandType) interface{}
Types ¶
type Command ¶
type Command struct {
Type *CommandType
Key string
From net.Conn // 命令的来源
Parameters []interface{}
Results []interface{}
Err error
MaxSeq int64
EffectKeys []string
Origin []byte
}
一条指令 @server
func NewCommand ¶
func NewCommand(typ *CommandType) *Command
type CommandType ¶
type CommandType struct {
Name string // 命令名
Structure string
Parameters []Kind
Results []Kind
CreateNewKey bool // 该命令是否允许创建新的Key
ReadOnly bool // 是否只读命令
Strand bool // 该命令不允许和非只读命令并发
NoReply bool // 此命令不给回复 (仅用于内部命令 SYNC PONG)
IgnoreSync bool // 主从同步忽略这个命令(只读的同样会被忽略)
IgnoreMonitor bool // Monitor时忽略这个命令
Callee func(interface{}, *Command)
View string // 仅属于指定View的接口
Summary string // 摘要描述, 取func定义的前一行注释信息
Signature string // 函数签名信息 func(value string) string
}
指令类型 @server
func GetCommandType ¶
func GetCommandType(currentView, commandName string) (typ *CommandType)
func (*CommandType) HasKey ¶
func (this *CommandType) HasKey() bool
func (*CommandType) IsViewCommand ¶
func (this *CommandType) IsViewCommand() bool
func (*CommandType) MinParamCount ¶
func (this *CommandType) MinParamCount() (n int)
Source Files
¶
- command.go
- marshal.go
Click to show internal directories.
Click to hide internal directories.