path

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package path implement a simple dfa string pattern match.

Index

Constants

This section is empty.

Variables

View Source
var (
	// InvalidPattern 不合法的模式串
	InvalidPattern = errors.New("invalid pattern")
	// InvalidParamName 不合法的参数名
	InvalidParamName = errors.New("invalid param name")
	// UnexpectedQuestion 非法的?操作
	UnexpectedQuestion = errors.New("question only used before colon")
	// UnexpectedBrace 非法的 '{', '}'
	UnexpectedBrace = errors.New("question only used before colon")
)

Functions

This section is empty.

Types

type Route

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

Route is a simple command route

func Parse

func Parse(pattern string) (*Route, error)

Parse parses pattern to compiled Route

func (*Route) Match

func (r *Route) Match(s string) (map[string]string, bool)

Jump to

Keyboard shortcuts

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