simplifypath

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	PathFragment

	// Greedy makes the node match all remnaining path elements as well
	Greedy bool
	// contains filtered or unexported fields
}

func L

func L(fragment string, children ...Node) Node

func V

func V(fragment string, children ...Node) Node

func VGreedy

func VGreedy(fragment string) Node

type PathFragment

type PathFragment interface {
	Matches(part string) bool
	Represent() string
}

PathFragment Interface for tree leafs to help resolve paths

type Simplifier

type Simplifier interface {
	Simplify(path string) string
}

Simplifier knows how to simplify a path

func NewSimplifier

func NewSimplifier(tree Node) Simplifier

NewSimplifier builds a new simplifier for the tree

Jump to

Keyboard shortcuts

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