router

package
v0.6.9-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Routable

type Routable interface {
	Routes() []RoutePair
}

type RoutePair

type RoutePair struct {
	Path string
	Data any
}

type Router

type Router struct {
	*tview.Pages
	// contains filtered or unexported fields
}

func New

func New(getLastCmd func() string, setLastCmd func(string)) *Router

func (*Router) AddRoute

func (R *Router) AddRoute(path string, thing interface{}) error

func (*Router) AddRouteHandler

func (R *Router) AddRouteHandler(path string, handler mux.Handler) error

func (*Router) AddRouteHandlerFunc

func (R *Router) AddRouteHandlerFunc(path string, handler mux.HandlerFunc) error

func (*Router) AddRouteLayout

func (R *Router) AddRouteLayout(path string, layout tview.Primitive) error

func (*Router) SetActive

func (R *Router) SetActive(path string, context map[string]interface{})

func (*Router) SetNotFound

func (R *Router) SetNotFound(layout tview.Primitive)

Jump to

Keyboard shortcuts

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