pathpattern

package
v0.0.0-...-1be23ea Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pathpattern GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizePath

func NormalizePath(p string) string

Types

type Matcher

type Matcher interface {
	MatchTo(setter ValueSetter, pathname string) (string, bool)
}

type NamedSegment

type NamedSegment interface {
	Segment
	Name() string
	Multiple() bool
}

type Node

type Node interface {
	Method() string
	PathSegments() Segments
}

type PathEncoder

type PathEncoder interface {
	Encode(map[string]string) string
}

type PathValuesGetter

type PathValuesGetter interface {
	PathValues(p string) (Values, error)
}

type Pattern

type Pattern interface {
	PathEncoder
	PathValuesGetter
}

type Segment

type Segment interface {
	String() string
}

type Segments

type Segments []Segment

func Parse

func Parse(p string) Segments

func (Segments) Chunk

func (ss Segments) Chunk() iter.Seq[Segments]

func (Segments) Encode

func (ss Segments) Encode(params map[string]string) string

func (Segments) MatchTo

func (ss Segments) MatchTo(setter ValueSetter, pathname string) (string, bool)

func (Segments) PathValues

func (ss Segments) PathValues(pathname string) (Values, error)

func (Segments) RuntimeDoc

func (Segments) RuntimeDoc(names ...string) ([]string, bool)

func (Segments) String

func (ss Segments) String() string

type Tree

type Tree[N Node] struct {
	// contains filtered or unexported fields
}

func (*Tree[N]) Add

func (t *Tree[N]) Add(n N)

func (*Tree) PathSegments

func (g *Tree) PathSegments() Segments

func (*Tree) PrintTo

func (g *Tree) PrintTo(w io.Writer, level int)

func (*Tree) Route

func (g *Tree) Route() iter.Seq[N]

func (*Tree[N]) String

func (t *Tree[N]) String() string

type ValueSetter

type ValueSetter interface {
	Set(key string, value string)
}

type Values

type Values map[string]string

func (Values) RuntimeDoc

func (Values) RuntimeDoc(names ...string) ([]string, bool)

func (Values) Set

func (values Values) Set(key string, value string)

Jump to

Keyboard shortcuts

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