route

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigName = iota
	ConfigPath
	ConfigHandler
	ConfigLocalize
	ConfigLayout
)

Variables

This section is empty.

Functions

func IsLocalized

func IsLocalized(configs ...Config) bool

func Process

func Process(b *Builder, parent *Builder, languages cfg.Languages, rc cfg.Router)

Types

type Builder

type Builder struct {
	Route
	Configs        []Config
	Localized      bool
	LocalizedRoute map[string]*Builder
	Subroutes      []*Builder
}

func CreateBuilder

func CreateBuilder(configs ...Config) *Builder

func CreateFlatBuilders

func CreateFlatBuilders(builders ...*Builder) []*Builder

func (*Builder) Group

func (b *Builder) Group(builders ...*Builder) *Builder

type Config

type Config interface {
}

func CreateConfig

func CreateConfig[T any](configType int, value T) Config

func CreateMethodConfig

func CreateMethodConfig(methods ...Config) Config

func CreateMethodPathConfig added in v0.1.5

func CreateMethodPathConfig(method string, path ...PathValue) Config

func CreatePathConfig

func CreatePathConfig(path PathValue) Config

type PathValue

type PathValue interface{}

type Route

type Route struct {
	Controller       string
	Firewalls        map[string]*firewall.Route
	Fn               handler.Fn
	Layout           string
	Matcher          *regexp.Regexp
	Method           []string
	Module           string
	Name             string
	Ok               bool
	Path             string
	VarsPlaceholders map[string]string
}

func (Route) Map

func (r Route) Map() map[string]any

Jump to

Keyboard shortcuts

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