router

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: BSD-3-Clause Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetURL

func GetURL() *url.URL

GetURL get current location.

func Navigate(s string)

Navigate global navigate function.

func NotFoundPage

func NotFoundPage() spago.Component

NotFoundPage pre-defined 404 page.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router definition of router.

func New

func New() *Router

New create new router instance.

func (*Router) Current

func (r *Router) Current() *url.URL

Current get current URL.

func (*Router) Handle

func (r *Router) Handle(key string, fn func(key string))

Handle register handler with key prefix.

func (*Router) Navigate

func (r *Router) Navigate(s string) error

Navigate navigate to URL.

func (*Router) Start

func (r *Router) Start() error

Start router.

Jump to

Keyboard shortcuts

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