Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCookieNotFound = errors.New("cookie not found") ErrNilRequestBody = errors.New("request body cannot be nil") ErrInvalidRequestBody = "invalid request body type, expected: %v" ErrInDevelopment = errors.New("in development") ErrNilSubmodule = "%s: submodule at index %d is nil" )
View Source
var (
ErrCodeCookieNotFound *string
)
Functions ¶
func GetClientIP ¶ added in v0.5.8
GetClientIP returns the client's IP address from the request
func NewMiddlewares ¶ added in v0.7.8
func NewMiddlewares(middlewares ...func(next http.Handler) http.Handler) *[]func(next http.Handler) http.Handler
NewMiddlewares is a function that creates a new middlewares slice
func NewSubmodules ¶ added in v0.6.24
NewSubmodules is a function that creates a new submodules slice
Types ¶
type Module ¶ added in v0.6.24
type Module struct { Pattern string Service interface{} Controller interface{} BeforeLoadFn func(m *Module) RegisterRoutesFn func(m *Module) AfterLoadFn func(m *Module) Middlewares *[]func(next http.Handler) http.Handler Submodules *[]*Module gonethttproute.RouterWrapper }
Module is the struct for the route module
func (*Module) Create ¶ added in v0.6.24
func (m *Module) Create( baseRouter gonethttproute.RouterWrapper, ) error
Create is a function that creates the router for the controller and its submodules, and loads the module
func (*Module) GetRouter ¶ added in v0.6.24
func (m *Module) GetRouter() gonethttproute.RouterWrapper
GetRouter returns the router
Click to show internal directories.
Click to hide internal directories.