routing

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecorateRoutes

func DecorateRoutes(routes *RouteCollection)

func NewRoute

func NewRoute(url string, method string, controller inter.Controller) inter.Route

Types

type Route

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

func (*Route) Constraint

func (r *Route) Constraint() map[string]string

func (*Route) Controller

func (r *Route) Controller() inter.Controller

func (*Route) Method

func (r *Route) Method() string

func (*Route) RouteOptions

func (r *Route) RouteOptions() inter.RouteOptions

func (*Route) SetConstraint

func (r *Route) SetConstraint(parameter string, regex string) inter.Route

func (*Route) SetDestination

func (r *Route) SetDestination(destination string) inter.Route

func (*Route) SetPrefix

func (r *Route) SetPrefix(prefix string) inter.Route

func (*Route) SetStatus

func (r *Route) SetStatus(status int) inter.Route

func (*Route) SetUrl

func (r *Route) SetUrl(url string) inter.Route

func (*Route) Url

func (r *Route) Url() string

type RouteCollection

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

func Any

func Any(uri string, controller inter.Controller) *RouteCollection

Register a new route responding to all methods

func Delete

func Delete(uri string, controller inter.Controller) *RouteCollection

Register new DELETE routes

func Get

func Get(uri string, controller inter.Controller) *RouteCollection

Register new GET routes

func Group

func Group(routeCollections ...inter.RouteCollection) *RouteCollection

func Match

func Match(methods []string, uri string, controller inter.Controller) *RouteCollection

Register a new route with multiple methods

func NewRouteCollection

func NewRouteCollection(routeCollections ...inter.RouteCollection) *RouteCollection

func Options

func Options(uri string, controller inter.Controller) *RouteCollection

Register new OPTIONS routes

func Patch

func Patch(uri string, controller inter.Controller) *RouteCollection

Register new PATCH routes

func PermanentRedirect

func PermanentRedirect(uri string, destination string) *RouteCollection

Create a permanent redirect from one URI to another.

func Post

func Post(uri string, controller inter.Controller) *RouteCollection

Register new POST routes

func Put

func Put(uri string, controller inter.Controller) *RouteCollection

Register new PUT routes

func Redirect

func Redirect(uri string, destination string, status int) *RouteCollection

Create a redirect from one URI to another.

func TemporaryRedirect

func TemporaryRedirect(uri string, destination string) *RouteCollection

Create a temporary redirect from one URI to another.

func (RouteCollection) All

func (c RouteCollection) All() []inter.Route

func (*RouteCollection) App

func (c *RouteCollection) App() inter.App

func (RouteCollection) Match

func (c RouteCollection) Match(request inter.Request) inter.Route

func (*RouteCollection) Merge

func (c *RouteCollection) Merge(routeCollection inter.RouteCollection) inter.RouteCollection

func (*RouteCollection) Prefix

func (c *RouteCollection) Prefix(prefix string) inter.RouteCollection

func (*RouteCollection) Push

func (*RouteCollection) SetApp

func (c *RouteCollection) SetApp(app inter.App)

func (*RouteCollection) Where

func (c *RouteCollection) Where(parameter, regex string) *RouteCollection

Set a group of global where patterns on the routes.

func (*RouteCollection) WhereMulti

func (c *RouteCollection) WhereMulti(constraints map[string]string) *RouteCollection

type RouteOptions

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

func (RouteOptions) Constraints

func (r RouteOptions) Constraints() map[string]string

func (RouteOptions) Destination

func (r RouteOptions) Destination() string

func (RouteOptions) Prefixes

func (r RouteOptions) Prefixes() []string

func (RouteOptions) Status

func (r RouteOptions) Status() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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