Documentation ¶
Index ¶
- func SetLogger(l *zap.Logger)
- type ConfigOption
- type ConfigOptions
- type ControllerOption
- type ControllerOptions
- type IConfigDefine
- type IConsumer
- type IController
- type ID
- type IGrpcMiddleware
- type IGrpcServiceHandler
- type IHttpMiddleware
- type IRepo
- type IScheduler
- type JwtClaims
- type LogLayout
- type ModelPO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigOption ¶
type ConfigOption func(*ConfigOptions)
func ConfigCanLoadByConsul ¶
func ConfigCanLoadByConsul(canLoadByConsul bool) ConfigOption
func ConfigFileName ¶
func ConfigFileName(configFileName string) ConfigOption
func ConfigKey ¶
func ConfigKey(configKey string) ConfigOption
type ConfigOptions ¶
type ConfigOptions struct { // ConfigKey 配置标识 ConfigKey string // CanLoadByConsul 是否从配置中心读取 CanLoadByConsul bool // ConfigFileName 配置文件在根路径下的路径 ConfigFileName string }
func NewConfigOptions ¶
func NewConfigOptions(opts ...ConfigOption) ConfigOptions
type ControllerOption ¶
type ControllerOption func(*ControllerOptions)
func AuthCodes ¶
func AuthCodes(authCodes ...string) ControllerOption
func HttpMethod ¶
func HttpMethod(httpMethod string) ControllerOption
func Middlewares ¶
func Middlewares(middlewares ...IHttpMiddleware) ControllerOption
func RelativePath ¶
func RelativePath(relativePath string) ControllerOption
func SentinelStrategy ¶
func SentinelStrategy(sentinelStrategy string) ControllerOption
type ControllerOptions ¶
type ControllerOptions struct { // RelativePath 接口路径 RelativePath string `validate:"required"` // HttpMethod 请求方法 使用 http.MethodGet 等相关枚举 HttpMethod string `validate:"required"` // AuthCodes 接口资源编码,拥有任意一个资源就算通过 AuthCodes []string `validate:"dive,required"` // Middlewares 自定义中间件 Middlewares []IHttpMiddleware // SentinelStrategy 熔断限流策略,不同得接口不要使用相同得策略 SentinelStrategy string }
ControllerOptions 接口配置
func NewControllerOptions ¶
func NewControllerOptions(opts ...ControllerOption) ControllerOptions
type IConfigDefine ¶
type IConfigDefine interface { // GetOption 配置标识 GetOption() ConfigOptions // ReloadConfig 配置变更通知,传入指针对象 ReloadConfig(any) error // Unmarshal 反序列化对象,返回指针对象 Unmarshal([]byte) (any, error) }
IConfigDefine 动态配置定义
type IController ¶
type IController interface { // GetOption 关键配置 GetOption() ControllerOptions // Handle 核心方法 Handle(c *gin.Context) }
type IGrpcMiddleware ¶
type IGrpcMiddleware interface {
MiddlewareWrapHandler() server.HandlerWrapper
}
type IGrpcServiceHandler ¶
type IHttpMiddleware ¶
type IHttpMiddleware interface {
MiddlewareHandlerFunc(option *ControllerOptions) gin.HandlerFunc
}
type IScheduler ¶
type LogLayout ¶
type LogLayout struct {
// contains filtered or unexported fields
}
LogLayout 日志layout
func NewLogLayout ¶
func (*LogLayout) AppendLogsFields ¶
type ModelPO ¶
Click to show internal directories.
Click to hide internal directories.