Documentation ¶
Index ¶
- Constants
- Variables
- func ComLogNotice(c *gin.Context, dltag string, m map[string]interface{})
- func ComLogWarning(c *gin.Context, dltag string, m map[string]interface{})
- func ContextError(c context.Context, dltag string, m map[string]interface{})
- func ContextNotice(c context.Context, dltag string, m map[string]interface{})
- func ContextWarning(c context.Context, dltag string, m map[string]interface{})
- func DefaultGetValidParams(c *gin.Context, params interface{}) error
- func GenSaltPassword(salt, password string) string
- func GetGinTraceContext(c *gin.Context) *lib.TraceContext
- func GetTraceContext(c context.Context) *lib.TraceContext
- func GetTranslation(c *gin.Context) (ut.Translator, error)
- func GetValidator(c *gin.Context) (*validator.Validate, error)
- func InStringSlice(slice []string, str string) bool
- func MD5(s string) string
- func Obj2Json(s interface{}) string
Constants ¶
View Source
const ( ValidatorKey = "ValidatorKey" TranslatorKey = "TranslatorKey" AdminSessionInfoKey = "AdminSessionInfoKey" LoadTypeHTTP = 0 LoadTypeTCP = 1 LoadTypeGRPC = 2 HTTPRuleTypePrefixURL = 0 HTTPRuleTypeDomain = 1 RedisFlowDayKey = "flow_day_count" RedisFlowHourKey = "flow_hour_count" FlowTotal = "flow_total" FlowServicePrefix = "flow_service_" FlowAppPrefix = "flow_app_" JwtSignKey = "my_sign_key" JwtExpires = 60 * 60 )
Variables ¶
View Source
var ( LoadTypeMap = map[int]string{ LoadTypeHTTP: "HTTP", LoadTypeTCP: "TCP", LoadTypeGRPC: "GRPC", } )
Functions ¶
func ComLogWarning ¶
错误日志
func ContextError ¶
错误日志
func ContextNotice ¶
普通日志
func ContextWarning ¶
错误日志
func DefaultGetValidParams ¶
func GenSaltPassword ¶
func GetGinTraceContext ¶
func GetGinTraceContext(c *gin.Context) *lib.TraceContext
从gin的Context中获取数据
func GetTranslation ¶
func GetValidator ¶
func InStringSlice ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.