httprule

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler interface {
	Compile() Template
}

Compiler compiles utilities representation of path templates into marshallable operations. They can be unmarshalled by runtime.NewPattern.

func Parse

func Parse(tmpl string) (Compiler, error)

Parse parses the string representation of path template

type InvalidTemplateError

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

InvalidTemplateError indicates that the path template is not valid.

func (InvalidTemplateError) Error

func (e InvalidTemplateError) Error() string

type Template

type Template struct {
	// Version is the version number of the format.
	Version int
	// OpCodes is a sequence of operations.
	OpCodes []int
	// Pool is a constant pool
	Pool []string
	// Verb is a VERB part in the template.
	Verb string
	// Fields is a list of field paths bound in this template.
	Fields []string
	// Original template (example: /v1/a_bit_of_everything)
	Template string
}

Template is a compiled representation of path templates.

Jump to

Keyboard shortcuts

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