Documentation ¶
Index ¶
- Variables
- func ProjectAdd(index int, list ...*ProjectItem)
- func ProjectAddNavList(name string, ident string, url string, navList *List)
- func ProjectIdent(urlPath string) string
- func ProjectRemove(index int)
- func ProjectSearchIdent(ident string) int
- func ProjectSet(index int, list ...*ProjectItem)
- func ProjectURLsIdent() map[string]string
- func TopNavURLs() map[string]int
- type Checker
- type Collection
- type Filter
- type Item
- type List
- func (a *List) Add(index int, list ...*Item) *List
- func (a *List) AddChild(action string, index int, list ...*Item)
- func (a *List) ChildrenBy(index int) *List
- func (a *List) FullPath(parentPath string) []string
- func (a *List) Get(index int) *Item
- func (a *List) Remove(index int) *List
- func (a *List) Set(index int, list ...*Item) *List
- func (a *List) Size() int
- type NavigateType
- type Navigates
- func (n *Navigates) Add(typ NavigateType, nav *List)
- func (n *Navigates) AddBottomItems(index int, items ...*Item)
- func (n *Navigates) AddItems(typ NavigateType, index int, items ...*Item)
- func (n *Navigates) AddLeftItems(index int, items ...*Item)
- func (n *Navigates) AddRightItems(index int, items ...*Item)
- func (n *Navigates) AddTopItems(index int, items ...*Item)
- func (n *Navigates) Get(typ NavigateType) (nav *List)
- func (n *Navigates) GetBottom() *List
- func (n *Navigates) GetLeft() *List
- func (n *Navigates) GetRight() *List
- func (n *Navigates) GetTop() *List
- func (n *Navigates) Remove(typ NavigateType) bool
- type ProjectItem
- type ProjectList
- type ProjectNavigates
- type Projects
- func (p *Projects) Add(index int, list ...*ProjectItem) *Projects
- func (p *Projects) First(notEmptyOpts ...bool) *ProjectItem
- func (p *Projects) Get(ident string) *ProjectItem
- func (p *Projects) InitURLsIdent() *Projects
- func (p *Projects) Remove(index int) *Projects
- func (p *Projects) Set(index int, list ...*ProjectItem) *Projects
- func (p *Projects) URLsIdent() map[string]string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // EmptyList 空菜单列表 EmptyList = List{} LeftNavigate = &List{} TopNavigate = &List{} )
View Source
var Default = NewCollection(`nging`)
Functions ¶
func ProjectAdd ¶
func ProjectAdd(index int, list ...*ProjectItem)
func ProjectAddNavList ¶
func ProjectIdent ¶
func ProjectRemove ¶
func ProjectRemove(index int)
func ProjectSearchIdent ¶
func ProjectSet ¶
func ProjectSet(index int, list ...*ProjectItem)
func ProjectURLsIdent ¶
func TopNavURLs ¶
Types ¶
type Collection ¶
type Collection struct { Backend *ProjectNavigates Frontend *Navigates }
func NewCollection ¶
func NewCollection(baseProject string) *Collection
type Item ¶
type Item struct { Display bool `json:",omitempty" xml:",omitempty"` //是否在菜单上显示 Name string `json:",omitempty" xml:",omitempty"` //名称 Action string `json:",omitempty" xml:",omitempty"` //操作(一般为网址) Icon string `json:",omitempty" xml:",omitempty"` //图标 Badge string `json:",omitempty" xml:",omitempty"` // <sup class="badge badge-danger">123</sup> Target string `json:",omitempty" xml:",omitempty"` //打开方式 Unlimited bool `json:",omitempty" xml:",omitempty"` //是否不限制权限 Attributes echo.KVList `json:",omitempty" xml:",omitempty"` //HTML标签a属性 Children *List `json:",omitempty" xml:",omitempty"` //子菜单 }
Item 操作
type NavigateType ¶
type NavigateType string
const ( Left NavigateType = `left` Top NavigateType = `top` Right NavigateType = `right` Bottom NavigateType = `bottom` )
type Navigates ¶
type Navigates map[NavigateType]*List
func (*Navigates) Add ¶
func (n *Navigates) Add(typ NavigateType, nav *List)
func (*Navigates) AddBottomItems ¶
func (*Navigates) AddItems ¶
func (n *Navigates) AddItems(typ NavigateType, index int, items ...*Item)
func (*Navigates) AddLeftItems ¶
func (*Navigates) AddRightItems ¶
func (*Navigates) AddTopItems ¶
func (*Navigates) Get ¶
func (n *Navigates) Get(typ NavigateType) (nav *List)
func (*Navigates) Remove ¶
func (n *Navigates) Remove(typ NavigateType) bool
type ProjectItem ¶
func NewProject ¶
func NewProject(name string, ident string, url string, navLists ...*List) *ProjectItem
func ProjectFirst ¶
func ProjectFirst(notEmptyOpts ...bool) *ProjectItem
func ProjectGet ¶
func ProjectGet(ident string) *ProjectItem
func (*ProjectItem) GetIdent ¶
func (a *ProjectItem) GetIdent() string
func (*ProjectItem) GetName ¶
func (a *ProjectItem) GetName() string
func (*ProjectItem) GetURL ¶
func (a *ProjectItem) GetURL() string
func (*ProjectItem) Is ¶
func (a *ProjectItem) Is(ident string) bool
type ProjectList ¶
type ProjectList []*ProjectItem
func ProjectListAll ¶
func ProjectListAll() ProjectList
func (*ProjectList) Add ¶
func (a *ProjectList) Add(index int, list ...*ProjectItem) *ProjectList
Add 添加列表项
func (*ProjectList) SearchIdent ¶
func (a *ProjectList) SearchIdent(ident string) int
func (*ProjectList) Set ¶
func (a *ProjectList) Set(index int, list ...*ProjectItem) *ProjectList
Set 设置元素
type ProjectNavigates ¶ added in v4.1.0
type ProjectNavigates struct { // contains filtered or unexported fields }
func (*ProjectNavigates) Project ¶ added in v4.1.0
func (p *ProjectNavigates) Project(project string) *Navigates
func (*ProjectNavigates) RemoveProject ¶ added in v4.1.0
func (p *ProjectNavigates) RemoveProject(project string)
type Projects ¶
type Projects struct { List *ProjectList Hash map[string]*ProjectItem //项目标识(Ident)=>项目信息 // contains filtered or unexported fields }
func NewProjects ¶
func NewProjects() *Projects
func ProjectInitURLsIdent ¶
func ProjectInitURLsIdent() *Projects
func (*Projects) First ¶
func (p *Projects) First(notEmptyOpts ...bool) *ProjectItem
func (*Projects) Get ¶
func (p *Projects) Get(ident string) *ProjectItem
func (*Projects) InitURLsIdent ¶
Click to show internal directories.
Click to hide internal directories.