Documentation ¶
Index ¶
- Constants
- func BindKeyDown(key string, callback func())
- func BindKeysDown(keys []string, callback func())
- func KeyDownSendChan(key rune) <-chan bool
- func MakeListInputFunc(kv map[string]string, callBack func()) func()
- func MakeUniListInputFunc(kv uniKVMap, callBack func()) func()
- func MakeUntilPressForFunc(f func()) func()
- func MakeUntilPressForShowFunc(printFunc func(), waitSecond int) func()
- func MakeUntilPressFunc(f func(chan bool)) func()
- func UniListFind(kv uniKVSlice, nowSearch string) []int
- func UniListFindNext(kv uniKVSlice, nowSearch string, nowIndex int) int
- func UniListFindPre(kv uniKVSlice, nowSearch string, nowIndex int) int
- func WaitKeyDown() rune
- type BindInfo
- type BindJson
- type FuncBind
- type Menu
- type MenuFuncNode
- type MenuLogicNode
- type MenuNode
- type NormalMenuFuncNode
- type NormalMenuLogicNode
- func (n *NormalMenuLogicNode) BindChild(child MenuNode)
- func (n *NormalMenuLogicNode) BindParent(parent MenuNode)
- func (n *NormalMenuLogicNode) BindRoot(root MenuNode)
- func (n *NormalMenuLogicNode) GetAllChild() []MenuNode
- func (n *NormalMenuLogicNode) GetID() int
- func (n *NormalMenuLogicNode) GetName() string
- func (n *NormalMenuLogicNode) GetParent() MenuNode
- func (n *NormalMenuLogicNode) GetRoot() MenuNode
- func (n *NormalMenuLogicNode) SetID(ID int)
- func (n *NormalMenuLogicNode) SetName(name string)
- type NormalMenuNode
- type UnCallableMenuLogicNode
Constants ¶
View Source
const PAGE_NUM = 10
Variables ¶
This section is empty.
Functions ¶
func BindKeyDown ¶
func BindKeyDown(key string, callback func())
func BindKeysDown ¶
func BindKeysDown(keys []string, callback func())
func KeyDownSendChan ¶
KeyDownSendChan 返回一个chan,第一次按下key时发送到chan中,后续按下key时不发送
func MakeListInputFunc ¶
MakeListInputFunc 创建一个输入列表的函数
func MakeUniListInputFunc ¶
func MakeUniListInputFunc(kv uniKVMap, callBack func()) func()
MakeUniListInputFunc 创建一个通用输入列表的函数
func MakeUntilPressForFunc ¶
func MakeUntilPressForFunc(f func()) func()
MakeUntilPressForFunc 创建一个按下esc才停止否则会一直循环调用的函数
func MakeUntilPressForShowFunc ¶
func MakeUntilPressForShowFunc(printFunc func(), waitSecond int) func()
MakeUntilPressForShowFunc 返回一个每隔waitSecond刷新一次printFunc,收到endChan则停止的函数
func MakeUntilPressFunc ¶
func MakeUntilPressFunc(f func(chan bool)) func()
MakeUntilPressFunc 创建一个按下一般都会返回的函数
func UniListFind ¶
func UniListFindNext ¶
func UniListFindPre ¶
Types ¶
type BindJson ¶
type BindJson struct { Nodes []struct { Id int `json:"id"` Name string `json:"name"` Child []int `json:"child"` } `json:"nodes"` Root int `json:"root"` }
BindJson 用来确认菜单结构
{ "nodes" : [ { "id":0, "name" : "0号节点", "child" : [1,2,3] } ], "root" : 0 }
type MenuFuncNode ¶
MenuFuncNode 菜单功能节点
type MenuLogicNode ¶
type MenuLogicNode interface { GetParent() MenuNode GetRoot() MenuNode GetAllChild() []MenuNode GetName() string GetID() int BindParent(parent MenuNode) BindChild(child MenuNode) BindRoot(root MenuNode) SetName(name string) SetID(ID int) }
MenuLogicNode 菜单逻辑节点
type NormalMenuFuncNode ¶
type NormalMenuFuncNode struct {
// contains filtered or unexported fields
}
func (*NormalMenuFuncNode) BindDo ¶
func (n *NormalMenuFuncNode) BindDo(f func()) bool
func (*NormalMenuFuncNode) Do ¶
func (n *NormalMenuFuncNode) Do()
func (*NormalMenuFuncNode) IsCallAble ¶
func (n *NormalMenuFuncNode) IsCallAble() bool
type NormalMenuLogicNode ¶
type NormalMenuLogicNode struct {
// contains filtered or unexported fields
}
func (*NormalMenuLogicNode) BindChild ¶
func (n *NormalMenuLogicNode) BindChild(child MenuNode)
func (*NormalMenuLogicNode) BindParent ¶
func (n *NormalMenuLogicNode) BindParent(parent MenuNode)
func (*NormalMenuLogicNode) BindRoot ¶
func (n *NormalMenuLogicNode) BindRoot(root MenuNode)
func (*NormalMenuLogicNode) GetAllChild ¶
func (n *NormalMenuLogicNode) GetAllChild() []MenuNode
func (*NormalMenuLogicNode) GetID ¶
func (n *NormalMenuLogicNode) GetID() int
func (*NormalMenuLogicNode) GetName ¶
func (n *NormalMenuLogicNode) GetName() string
func (*NormalMenuLogicNode) GetParent ¶
func (n *NormalMenuLogicNode) GetParent() MenuNode
func (*NormalMenuLogicNode) GetRoot ¶
func (n *NormalMenuLogicNode) GetRoot() MenuNode
func (*NormalMenuLogicNode) SetID ¶
func (n *NormalMenuLogicNode) SetID(ID int)
func (*NormalMenuLogicNode) SetName ¶
func (n *NormalMenuLogicNode) SetName(name string)
type NormalMenuNode ¶
type NormalMenuNode struct { NormalMenuFuncNode NormalMenuLogicNode }
type UnCallableMenuLogicNode ¶
type UnCallableMenuLogicNode struct { }
func (UnCallableMenuLogicNode) Do ¶
func (receiver UnCallableMenuLogicNode) Do()
func (UnCallableMenuLogicNode) IsCallAble ¶
func (receiver UnCallableMenuLogicNode) IsCallAble() bool
Click to show internal directories.
Click to hide internal directories.