node

package
v10.6.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDublicate = errors.New("two or more routes have the same registered path")

ErrDublicate returnned from `Add` when two or more routes have the same registered path.

Functions

This section is empty.

Types

type Nodes

type Nodes []*node

Nodes a conversion type for []*node.

func (*Nodes) Add

func (nodes *Nodes) Add(routeName string, path string, handlers context.Handlers) error

Add adds a node to the tree, returns an ErrDublicate error on failure.

func (Nodes) Exists

func (nodes Nodes) Exists(path string) bool

Exists returns true if a node with that "path" exists, otherise false.

We don't care about parameters here.

func (Nodes) Find

func (nodes Nodes) Find(path string, params *context.RequestParams) (string, context.Handlers)

Find resolves the path, fills its params and returns the registered to the resolved node's handlers.

Jump to

Keyboard shortcuts

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