Documentation
¶
Index ¶
- func JsonToJson[Payload any, Response any](cb PipelineHandler[Payload, Response]) gin.HandlerFunc
- func ToJson[Response any](cb ResponseHandler[Response]) gin.HandlerFunc
- type BaseController
- type Controller
- type ControllerConfig
- type ControllersModule
- type HttpConfig
- type MigrationsModule
- type Module
- type ModuleApi
- type ModuleBase
- type PipelineHandler
- type RequestHandler
- type ResponseHandler
- type RootConfig
- type RootModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonToJson ¶
func JsonToJson[Payload any, Response any](cb PipelineHandler[Payload, Response]) gin.HandlerFunc
func ToJson ¶
func ToJson[Response any](cb ResponseHandler[Response]) gin.HandlerFunc
Types ¶
type BaseController ¶
type BaseController struct{}
func (*BaseController) Init ¶
func (c *BaseController) Init(config ControllerConfig) (err error)
type Controller ¶
type Controller interface { Init(config ControllerConfig) (err error) MountHTTP(router gin.IRouter) (err error) }
type ControllerConfig ¶
type ControllersModule ¶
type ControllersModule interface {
Controllers(db *sqlx.DB) []Controller
}
type HttpConfig ¶
type MigrationsModule ¶
type ModuleBase ¶
type ModuleBase struct{}
func (*ModuleBase) Close ¶
func (m *ModuleBase) Close() (err error)
func (*ModuleBase) Init ¶
func (m *ModuleBase) Init(api ModuleApi, config interface{}) (err error)
func (*ModuleBase) PostInit ¶
func (m *ModuleBase) PostInit(api ModuleApi, config interface{}) (err error)
func (*ModuleBase) PreInit ¶
func (m *ModuleBase) PreInit(api ModuleApi, config interface{}) (err error)
type PipelineHandler ¶
type RootConfig ¶
type RootModule ¶
type RootModule struct { Config RootConfig // contains filtered or unexported fields }
func (*RootModule) Add ¶
func (r *RootModule) Add(modules ...Module)
Add a module to the root module. Modules are initialized in the order they are added.
func (*RootModule) AddMiddleware ¶
func (r *RootModule) AddMiddleware(middleware ...gin.HandlerFunc)
Add a middleware to every route in under the root module. Middlewares are applied in the order they are added.
func (*RootModule) Init ¶
func (r *RootModule) Init() (err error)
Init the root module. All modules should be added before calling Init.
func (*RootModule) Run ¶
func (r *RootModule) Run() (err error)
Start the server. This will initialize the server if it has not already been initialized.
Click to show internal directories.
Click to hide internal directories.