routes

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 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 {
	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) IncludeRoutes added in v0.9.2

func (r *Router) IncludeRoutes(routes []Route)

IncludeRoutes basically appends routes to list

func (*Router) Prepare

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

Prepare parses Endpoints property and returns mux with applied routes

Jump to

Keyboard shortcuts

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