routes

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route added in v0.5.0

type Route struct {
	Name    string
	Path    string
	Method  string
	Handler http.HandlerFunc
}

route structure

type Router

type Router struct {
	Mux *mux.Router

	Routes []Route
}

Router structure is a url handler

func NewRouter

func NewRouter(r *mux.Router) Router

NewRouter basically creates router

func (*Router) AddRoute

func (r *Router) AddRoute(route Route)

AddRoute will append your route to Endpoints

func (*Router) GetRouteByName added in v0.7.0

func (r *Router) GetRouteByName(name string) Route

func (*Router) Prepare

func (r *Router) Prepare() *mux.Router

Prepare parses Endpoints property and returns mux with applied routes

func (*Router) RouteUrl added in v0.7.0

func (r *Router) RouteUrl(name string) string

Jump to

Keyboard shortcuts

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