Documentation ¶
Index ¶
- Constants
- Variables
- func Interface2String(srcs []interface{}) []string
- func ParseResult2String(result int) string
- func String2Interface(strs []string) []interface{}
- type Args
- type Callback
- type Cmd
- func (c *Cmd) FirstCommands(mode string, privilege uint32) (cmds string)
- func (c *Cmd) InstallMode(name string, header string, prompt string) *Mode
- func (c *Cmd) InstallSubMode(mode *Mode, name string, header string, prompt string) *Mode
- func (c *Cmd) LookupMode(name string) *Mode
- func (c *Cmd) ParseLine(mode string, line string, args ...*Param) (int, Callback, []interface{}, CompSlice)
- type Comp
- type CompSlice
- type Hook
- type MatchState
- type MatchType
- func MatchIPv4(str string) (pos int, match MatchType)
- func MatchIPv4Prefix(line string) (pos int, match MatchType)
- func MatchIPv6(line string) (pos int, match MatchType)
- func MatchIPv6Prefix(line string) (pos int, match MatchType)
- func MatchKeyword(str, name string) (pos int, match MatchType)
- func MatchLine(str string) (pos int, match MatchType)
- func MatchRange(line string, min, max uint64) (pos int, match MatchType)
- func MatchWord(str string) (pos int, match MatchType)
- type Mode
- type Node
- func (p *Node) Dump()
- func (n *Node) DumpNode(depth int)
- func (p *Node) Install(s Scanner, fn Callback, args []*Param)
- func (p *Node) InstallCmd(cmd []string, fn Callback, args ...*Param)
- func (p *Node) InstallLine(line string, fn Callback, args ...*Param)
- func (n *Node) LinkNodes(node *Node)
- func (n *Node) Lookup(name string) *Node
- func (n *Node) Match(str string, name string) (pos int, match MatchType)
- func (n *Node) MatchDynamic(line string, command []string, state *MatchState)
- func (n *Node) MatchNode(str string, name string, state *MatchState)
- func (n *Node) Parse(line string, param *Param) (int, Callback, []interface{}, CompSlice)
- func (n *Node) ParseArgSet(str string, param *Param)
- func (n *Node) ParseCmd(cmd []string, args ...*Param) (int, Callback, []interface{}, CompSlice)
- func (n *Node) ParseLine(line string, args ...*Param) (int, Callback, []interface{}, CompSlice)
- func (n *Node) ParseMatch(line string, param *Param, state *MatchState)
- func (n *Node) String() string
- type NodeSlice
- type NodeType
- type Param
- type Scanner
- type ScannerCmd
- type ScannerLine
Constants ¶
View Source
const ( Set int = iota Delete SetValidate DeleteValidate Subscribe )
View Source
const ( ParseNoMatch = iota ParseAmbiguous ParseIncomplete ParseSuccess )
View Source
const (
Success int = iota
)
Variables ¶
View Source
var (
DynamicFunc func([]string, string, []string) []string
)
View Source
var String2NodeTypeMap = map[string]NodeType{}
Functions ¶
func Interface2String ¶
func Interface2String(srcs []interface{}) []string
func ParseResult2String ¶
func String2Interface ¶
func String2Interface(strs []string) []interface{}
Types ¶
type Cmd ¶
func (*Cmd) FirstCommands ¶
func (*Cmd) InstallMode ¶
func (*Cmd) InstallSubMode ¶
func (*Cmd) LookupMode ¶
type MatchState ¶
type MatchState struct {
// contains filtered or unexported fields
}
type MatchType ¶
type MatchType int
func MatchIPv4Prefix ¶
func MatchIPv6Prefix ¶
func MatchKeyword ¶
type Mode ¶
type Node ¶
type Node struct { Name string Help string Type NodeType Privilege uint32 Fn Callback Hook Hook Nodes *NodeSlice Min uint64 Max uint64 Module string Dynamic []string Paren bool }
func (*Node) MatchDynamic ¶
func (n *Node) MatchDynamic(line string, command []string, state *MatchState)
func (*Node) ParseArgSet ¶
func (*Node) ParseMatch ¶
func (n *Node) ParseMatch(line string, param *Param, state *MatchState)
type ScannerCmd ¶
type ScannerCmd struct {
// contains filtered or unexported fields
}
ScannerCmd start.
func (*ScannerCmd) Scan ¶
func (s *ScannerCmd) Scan() (typ NodeType, lit string)
type ScannerLine ¶
type ScannerLine struct {
// contains filtered or unexported fields
}
func (*ScannerLine) Scan ¶
func (s *ScannerLine) Scan() (typ NodeType, lit string)
Click to show internal directories.
Click to hide internal directories.