Documentation
¶
Index ¶
- func Auth(userService interfaces.UserService, cfg *config.Config) gin.HandlerFunc
- func ErrorHandler() gin.HandlerFunc
- func GetTenantIDFromContext(ctx context.Context) (uint64, error)
- func Logger() gin.HandlerFunc
- func Recovery() gin.HandlerFunc
- func RequestID() gin.HandlerFunc
- func SetBypassUserProvider(provider func() *types.User)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Auth ¶
func Auth( userService interfaces.UserService, cfg *config.Config, ) gin.HandlerFunc
Auth 认证中间件
func GetTenantIDFromContext ¶
GetTenantIDFromContext helper function to get tenant ID from context
func Logger ¶
func Logger() gin.HandlerFunc
Logger middleware logs request details with request ID, input and output
func RequestID ¶
func RequestID() gin.HandlerFunc
RequestID middleware adds a unique request ID to the context
func SetBypassUserProvider ¶ added in v0.2.1
SetBypassUserProvider 关闭认证校验,所有请求都以 provider 返回的用户身份执行。 必须在校由构建前调用(即 appsrv.New 之前);传 nil 恢复认证。 provider 延迟调用,因此可在容器就绪后初始化/落库用户。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.