router

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route struct {
	Pattern    string
	FilePath   string
	Type       RouteType
	ParamNames []string
	Priority   int
	Regex      *regexp.Regexp
	IsEndpoint bool
}

type RouteType

type RouteType int
const (
	RouteStatic RouteType = iota
	RouteDynamic
	RouteCatchAll
	RouteEndpoint
	RouteMarkdown
)

type Router

type Router struct {
	Routes   []*Route
	PagesDir string
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(pagesDir string) *Router

func (*Router) Discover

func (r *Router) Discover() error

func (*Router) Match

func (r *Router) Match(path string) (*Route, map[string]string)

func (*Router) Reload

func (r *Router) Reload() error

func (*Router) Sort

func (r *Router) Sort()

func (*Router) String

func (r *Router) String() string

Jump to

Keyboard shortcuts

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