Documentation ¶
Index ¶
- func Area(area string, f func())
- func GetHttpContext() *context.HttpContext
- func HttpHandler(route *context.HttpRoute) http.HandlerFunc
- func NewApplicationBuilder() *applicationBuilder
- func PrintRoute()
- func RegisterController(c controller.IController)
- func RegisterDELETE(route string, actionFunc any, params ...string)
- func RegisterGET(route string, actionFunc any, params ...string)
- func RegisterMiddleware(m context.IMiddleware)
- func RegisterPOST(route string, actionFunc any, params ...string)
- func RegisterPUT(route string, actionFunc any, params ...string)
- func RegisterRoutes(routes ...Route)
- func Run(params ...string)
- func UseApiDoc()
- func UseApiResponse()
- func UseCors()
- func UseHealthCheck(routes ...string)
- func UsePprof()
- func UseSession()
- func UseStaticFiles()
- func UseTLS(certFile, keyFile string)
- func UseValidate()
- func UseWebApi()
- type ISessionMiddlewareCreat
- type Module
- type Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHttpContext ¶ added in v0.8.0
func GetHttpContext() *context.HttpContext
GetHttpContext 在minimalApi模式下也可以获取到上下文
func HttpHandler ¶ added in v0.15.0
func HttpHandler(route *context.HttpRoute) http.HandlerFunc
func NewApplicationBuilder ¶ added in v0.3.0
func NewApplicationBuilder() *applicationBuilder
func RegisterController ¶
func RegisterController(c controller.IController)
RegisterController 自动注册控制器下的所有Action方法
func RegisterDELETE ¶
RegisterDELETE 注册单个Api(支持占位符,例如:/{cateId}/{Id})
func RegisterGET ¶
RegisterGET 注册单个Api(支持占位符,例如:/{cateId}/{Id})
func RegisterMiddleware ¶
func RegisterMiddleware(m context.IMiddleware)
func RegisterPOST ¶
RegisterPOST 注册单个Api(支持占位符,例如:/{cateId}/{Id})
func RegisterPUT ¶
RegisterPUT 注册单个Api(支持占位符,例如:/{cateId}/{Id})
func UseHealthCheck ¶ added in v0.12.0
func UseHealthCheck(routes ...string)
UseHealthCheck 【GET】开启健康检查(默认route = "/healthCheck")
Types ¶
type ISessionMiddlewareCreat ¶ added in v0.11.0
type ISessionMiddlewareCreat interface { // Create 创建Session中间件 Create() context.IMiddleware }
type Module ¶
type Module struct { }
func (Module) DependsModule ¶
func (module Module) DependsModule() []modules.FarseerModule
func (Module) PostInitialize ¶
func (module Module) PostInitialize()
func (Module) PreInitialize ¶
func (module Module) PreInitialize()
type Route ¶ added in v0.2.0
type Route struct { Method string // Method类型(GET|POST|PUT|DELETE) Url string // 路由地址 Action any // Handle Message string // api返回的StatusMessage Filters []context.IFilter // 过滤器(对单个路由的执行单元) Params []string // Handle的入参 }
Route 路由配置
Source Files ¶
Click to show internal directories.
Click to hide internal directories.