path

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCollision = errors.New("Path collision")

Functions

This section is empty.

Types

type Path

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

A matching path

func Parse

func Parse(s string) Path

Parse a path using the default separator '/'

func ParseSeparator added in v1.2.0

func ParseSeparator(s string, sep rune) Path

Parse a path using the specified separator

func (Path) Matches

func (p Path) Matches(s string) (bool, Vars)

Does a path match

func (Path) String

func (p Path) String() string

Describe this path

type Tree added in v1.2.0

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

A path prefix tree

func NewTree added in v1.2.4

func NewTree(sep rune) *Tree

Create a tree with the specified separator. The zero value of a tree uses the default separator: '/'.

func (*Tree) Add added in v1.2.0

func (t *Tree) Add(p string, v interface{}) error

func (*Tree) Describe added in v1.2.0

func (t *Tree) Describe() string

func (*Tree) Find added in v1.2.0

func (t *Tree) Find(s string) (interface{}, Vars, bool)

func (*Tree) Iter added in v1.2.3

func (t *Tree) Iter(f func(string, interface{}) bool)

type Vars

type Vars map[string]string

Jump to

Keyboard shortcuts

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