Documentation
¶
Index ¶
- Variables
- func GetClientIP(r *http.Request) string
- func NewSubmodules(submodules ...ModuleWrapper) *[]ModuleWrapper
- type Module
- func (m *Module) Create(baseRouter gonethttproute.RouterWrapper) error
- func (m *Module) GetController() interface{}
- func (m *Module) GetLoadFn() func(*Module)
- func (m *Module) GetPath() string
- func (m *Module) GetRegisterRoutesFn() func(*Module)
- func (m *Module) GetRouter() gonethttproute.RouterWrapper
- func (m *Module) GetService() interface{}
- func (m *Module) GetSubmodules() *[]ModuleWrapper
- func (m *Module) GetValidator() interface{}
- func (m *Module) Handler() http.Handler
- type ModuleWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilRequestBody = errors.New("request body cannot be nil") ErrInvalidRequestBody = "invalid request body type, expected: %v" ErrInDevelopment = errors.New("in development") )
Functions ¶
func GetClientIP ¶ added in v0.5.8
GetClientIP returns the client's IP address from the request
func NewSubmodules ¶ added in v0.6.24
func NewSubmodules(submodules ...ModuleWrapper) *[]ModuleWrapper
NewSubmodules is a function that creates a new submodules
Types ¶
type Module ¶ added in v0.6.24
type Module struct {
Path string
Service interface{}
Validator interface{}
Controller interface{}
LoadFn func(*Module)
RegisterRoutesFn func(*Module)
Submodules *[]ModuleWrapper
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) GetController ¶ added in v0.6.24
func (m *Module) GetController() interface{}
GetController is a function that returns the controller
func (*Module) GetRegisterRoutesFn ¶ added in v0.6.25
GetRegisterRoutesFn is a function that returns the register routes function
func (*Module) GetRouter ¶ added in v0.6.24
func (m *Module) GetRouter() gonethttproute.RouterWrapper
GetRouter returns the router
func (*Module) GetService ¶ added in v0.6.24
func (m *Module) GetService() interface{}
GetService is a function that returns the service
func (*Module) GetSubmodules ¶ added in v0.6.24
func (m *Module) GetSubmodules() *[]ModuleWrapper
GetSubmodules is a function that returns the submodules
func (*Module) GetValidator ¶ added in v0.6.24
func (m *Module) GetValidator() interface{}
GetValidator is a function that returns the validator
type ModuleWrapper ¶ added in v0.6.24
type ModuleWrapper interface {
Create(baseRouter gonethttproute.RouterWrapper) error
GetRouter() gonethttproute.RouterWrapper
Handler() http.Handler
GetService() interface{}
GetValidator() interface{}
GetController() interface{}
GetPath() string
GetLoadFn() func(*Module)
GetRegisterRoutesFn() func(*Module)
GetSubmodules() *[]ModuleWrapper
gonethttproute.RouterWrapper
}
ModuleWrapper is the interface for the route module
Click to show internal directories.
Click to hide internal directories.