route

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: GPL-3.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilRouter     = errors.New("router cannot be nil")
	ErrNilController = errors.New("route controller cannot be nil")
	ErrNilService    = errors.New("route service cannot be nil")
)

Functions

This section is empty.

Types

type Controller added in v0.2.1

type Controller struct {
	Service Service
	RouterWrapper
}

Controller is the struct for the route controller

type ControllerWrapper added in v0.2.2

type ControllerWrapper interface {
	RegisterRoutes()
	RegisterRouteGroups()
}

ControllerWrapper is the interface for the route controller

type Router added in v0.2.2

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

Router is the route group struct

func NewRouter added in v0.2.2

func NewRouter() *Router

NewRouter creates a new router

func NewRouterGroup added in v0.2.2

func NewRouterGroup(baseRoute *Router, path string) (*Router, error)

NewRouterGroup creates a new route group

func (*Router) HandleFunc added in v0.2.2

func (r *Router) HandleFunc(path string, handler http.HandlerFunc)

HandleFunc registers a new route with a path and a handler function

func (*Router) Handler added in v0.2.3

func (r *Router) Handler() *http.ServeMux

Handler returns the ServeMux

func (*Router) RegisterHandler added in v0.2.2

func (r *Router) RegisterHandler(path string, handler http.Handler)

RegisterHandler registers a new route group with a path and a handler function

func (*Router) RegisterRoute added in v0.2.2

func (r *Router) RegisterRoute(path string, handler http.HandlerFunc)

RegisterRoute registers a new route with a path and a handler function

func (*Router) RegisterRouteGroup added in v0.2.2

func (r *Router) RegisterRouteGroup(path string, router *Router)

RegisterRouteGroup registers a new route group with a path and a router

type RouterWrapper added in v0.2.2

type RouterWrapper interface {
	Handler() *http.ServeMux
	HandleFunc(string, http.HandlerFunc)
	RegisterRoute(string, http.HandlerFunc)
	RegisterHandler(string, http.Handler)
	RegisterRouteGroup(string, http.Handler)
}

RouterWrapper is the interface for the routes

type Service added in v0.2.1

type Service struct {
}

Service is the structure for the service route

type ServiceWrapper added in v0.2.2

type ServiceWrapper interface {
}

ServiceWrapper is the interface for the service route

Jump to

Keyboard shortcuts

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