Documentation ¶
Index ¶
- func Debug(config *Config) gin.HandlerFunc
- func Metric(config *Config) gin.HandlerFunc
- func RateLimit(config *Config) gin.HandlerFunc
- func SignalNotify(srv *Server)
- func SysAuth(config *Config) gin.HandlerFunc
- type BaseHandle
- type Config
- type Context
- type Engine
- type ErrorType
- type HandlerFunc
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(config *Config) gin.HandlerFunc
func Metric ¶
func Metric(config *Config) gin.HandlerFunc
func RateLimit ¶
func RateLimit(config *Config) gin.HandlerFunc
func SignalNotify ¶
func SignalNotify(srv *Server)
func SysAuth ¶
func SysAuth(config *Config) gin.HandlerFunc
Types ¶
type BaseHandle ¶
type BaseHandle struct{}
func (*BaseHandle) FailWithMessage ¶
func (b *BaseHandle) FailWithMessage(c *gin.Context, message string)
func (*BaseHandle) OKWithData ¶
func (b *BaseHandle) OKWithData(c *gin.Context, message string, data interface{})
func (*BaseHandle) OKWithMessage ¶
func (b *BaseHandle) OKWithMessage(c *gin.Context, message string)
type Config ¶
type Config struct { Address string `json:"address" yaml:"address"` //gin服务的启动地址 Mode string `json:"mode" yaml:"mode"` //gin的启动模式 Debug bool `json:"debug" yaml:"debug"` //是否打印调试日志 SecretKey string `json:"secretKey" yaml:"secretKey"` //内部系统调用的对称秘钥 DisableMetric bool `json:"disableMetric" yaml:"disableMetric"` //是否进行监控 DisableTrace bool `json:"disableTrace" yaml:"disableTrace"` //是否进行链路追踪 RateLimit int `json:"rateLimit" yaml:"rateLimit"` //限速 }
func DefaultConfig ¶
func DefaultConfig() Config
type ErrorType ¶
type ErrorType uint64
ErrorType is an unsigned 64-bit error code as defined in the gin spec.
const ( // ErrorTypeBind is used when Context.Bind() fails. ErrorTypeBind ErrorType = 1 << 63 // ErrorTypeRender is used when Context.Render() fails. ErrorTypeRender ErrorType = 1 << 62 // ErrorTypePrivate indicates a private error. ErrorTypePrivate ErrorType = 1 << 0 // ErrorTypePublic indicates a public error. ErrorTypePublic ErrorType = 1 << 1 // ErrorTypeAny indicates any other error. ErrorTypeAny ErrorType = 1<<64 - 1 // ErrorTypeNu indicates any other error. ErrorTypeNu = 2 )
type HandlerFunc ¶
type HandlerFunc = gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.