Documentation
¶
Overview ¶
Package engine provides a core interface for flotilla routing as well as a default engine flotilla based on https://github.com/julienschmidt/httprouter, in addition to associated functionality managing for routing results across packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEngine ¶
func DefaultEngine(status Rule) *engine
Provided a default status Rule, DefaultEngine returns a default engine instance.
Types ¶
type Engine ¶
type Engine interface {
Handle(string, string, Rule)
ServeHTTP(http.ResponseWriter, *http.Request)
}
The Engine interface encapsulates routing management and satisfies the net/http ServeHTTP interface function.
type Recorded ¶
type Recorded struct {
Start, Stop time.Time
Latency time.Duration
Status int
Method, Path, Requester string
}
The Recorded struct holds request & handling data.
type Result ¶
type Result struct {
Rule Rule
TSR bool
xrr.Xrroror
Recorder
// contains filtered or unexported fields
}
Result is a struct for holding information on found routes when handled by an Engine.
func NewResult ¶
NewResult provides a Result instance, provided an integer code, a Rule, Params, and a boolean indicating trailing slash redirect.