navigation

package
v1.0.0-sql.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flat

func Flat(items []*NavigationItem, r *http.Request) (f map[string]*NavigationItem)

Types

type NavigationItem struct {
	Name        string            `json:"name"`
	Uri         string            `json:"uri"`
	Template    string            `json:"template"`
	IsHeader    bool              `json:"is_header"`
	DataSources page.Data         `json:"data_sources"`
	Navigation  []*NavigationItem `json:"navigation"`
	Active      bool              `json:"-"`
	Registered  bool              `json:"-"`
}

func ForTemplate

func ForTemplate(templateName string, navs []*NavigationItem) (found *NavigationItem)

func Level

func Level(items []*NavigationItem, r *http.Request) (nav map[string]*NavigationItem, active *NavigationItem)

func New

func New(content []byte) []*NavigationItem

func NewNav

func NewNav(content []byte) ([]*NavigationItem, error)
func (n *NavigationItem) ClassName() string
func (n *NavigationItem) InUrlPath(url string) bool
func (n *NavigationItem) Matches(url string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL