Documentation ¶
Overview ¶
A URL router implemented by Double-Array Trie.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoubleArray ¶
type DoubleArray struct {
// contains filtered or unexported fields
}
DoubleArray represents a URLRouter by Double-Array.
func (*DoubleArray) Build ¶
func (da *DoubleArray) Build(records []urlrouter.Record) error
Build builds Double-Array routing table from records.
func (*DoubleArray) Lookup ¶
func (da *DoubleArray) Lookup(path string) (data interface{}, params []urlrouter.Param)
Lookup returns result data of lookup from Double-Array routing table by given path.
type DoubleArrayRouter ¶
type DoubleArrayRouter struct{}
DoubleArrayRouter represents the Router of Double-Array.
func (*DoubleArrayRouter) New ¶
func (router *DoubleArrayRouter) New() urlrouter.URLRouter
New returns a new URLRouter that implemented by Double-Array.
type Record ¶
type Record struct { urlrouter.Record // contains filtered or unexported fields }
Record represents a record that use to build the Double-Array.
type RecordSlice ¶
type RecordSlice []*Record
RecordSlice represents a slice of Record for sort and implements the sort.Interface.
func (RecordSlice) Less ¶
func (rs RecordSlice) Less(i, j int) bool
Less implements the sort.Interface.Less.
func (RecordSlice) Swap ¶
func (rs RecordSlice) Swap(i, j int)
Swap implements the sort.Interface.Swap.
Click to show internal directories.
Click to hide internal directories.