menuhandler

package
v3.2.13+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2015 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDynamic

func NewDynamic(requestMenu RequestMenu, depth int, writerTo menu.WriterTo) http.Handler

func NewDynamicSub

func NewDynamicSub(requestMenu RequestMenu, fromDepth int, toDepth int, writerTo menu.WriterTo) http.Handler

NewDynamicSub creates a static menu handler that is a sub tree of the given root, starting at fromDepth until toDepth. The menu is only written to the ResponseWriter if the is a tree at the given fromDepth for a menu item that matches the request path

func NewStatic

func NewStatic(root *menu.Node, depth int, writerTo menu.WriterTo) http.Handler

NewMenuHandler creates a http.Handler that writes the given menu to the ResponseWriter, formatting it with the given menuHtml (to the given depth) while the menuHtml may handle the current request path in a special way.

func NewStaticSub

func NewStaticSub(root *menu.Node, fromDepth int, toDepth int, writerTo menu.WriterTo) http.Handler

NewStaticSub creates a static menu handler that is a sub tree of the given root, starting at fromDepth until toDepth. The menu is only written to the ResponseWriter if the is a tree at the given fromDepth for a menu item that matches the request path

Types

type RequestMenu

type RequestMenu interface {
	Menu(*http.Request) *menu.Node
}

Jump to

Keyboard shortcuts

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