route

package
v0.2.1 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 (
	ErrNilGroup      = errors.New("route group 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 {
	GroupWrapper
	// contains filtered or unexported fields
}

Controller is the struct for the controller

type Group

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

Group is the route group struct

func NewGroup

func NewGroup(mux *http.ServeMux) *Group

NewGroup creates a new route group

func (*Group) Group added in v0.2.1

func (g *Group) Group() *http.ServeMux

Group returns the ServeMux

func (*Group) HandleFunc

func (g *Group) HandleFunc(path string, handler http.HandlerFunc)

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

func (*Group) RegisterGroup

func (g *Group) RegisterGroup(path string, handler http.Handler)

RegisterGroup registers a new group with a path and a handler function

type GroupWrapper added in v0.2.1

type GroupWrapper interface {
	Group() *http.ServeMux
	HandleFunc(string, http.HandlerFunc)
	RegisterGroup(string, http.Handler)
}

GroupWrapper is the interface for the route group

type Service added in v0.2.1

type Service struct {
}

Service is the structure for the service route

Jump to

Keyboard shortcuts

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