Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultGetValidParams(c *gin.Context, params interface{}) error
- func DiffTime(t1, t2 time.Time) (days int, hours int, minutes int, seconds int)
- func GetTranslation(c *gin.Context) (ut.Translator, error)
- func GetValidator(c *gin.Context) (*validator.Validate, error)
- func MD5(s string) string
- func MustParseURL(s string) *url.URL
- func PrintFields(s interface{})
- func ProtocolConverter(protocolType int) string
- func ResponseError(c *gin.Context, code int, err error)
- func ResponseSuccess(c *gin.Context, data interface{})
- func SumArray(numbers []int64) int64
- type Response
Constants ¶
View Source
const ( TimeFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" // PassWordCost 密码加密难度 PassWordCost = 12 ValidatorKey = "ValidatorKey" TranslatorKey = "TranslatorKey" SessionID = "SessionID-" // 协议类型编码 ProtocolTypeHttp = 0 ProtocolTypeHttps = 1 ProtocolTypeWebSocket = 2 ProtocolTypeTcp = 3 ProtocolTypeGrpc = 4 // RuleTypePrefixURL 前缀匹配 RuleTypePrefixURL = 0 // RuleTypeDomain 域名匹配 RuleTypeDomain = 1 // 负载均衡器类型 LoadBalancerRandom = 0 LoadBalancerRoundRobin = 1 LoadBalancerIPHash = 2 LoadBalancerWeighted = 3 QpsLimiterByService = "flow_qps_Limiter" EasyGatewayReq = "EASY_GATEWAY_REQ" ReqCounterByService = "flow_req_counter" EasyGatewayQps = "EASY_GATEWAY_QPS" QpsCounterByService = "flow_qps_counter" )
Variables ¶
View Source
var ( // ProtocolTypeMap 获取协议编码对应的文本 ProtocolTypeMap = map[int]string{ ProtocolTypeHttp: "Http", ProtocolTypeHttps: "Https", ProtocolTypeWebSocket: "WebSocket", ProtocolTypeTcp: "Tcp", ProtocolTypeGrpc: "Grpc", } )
Functions ¶
func DefaultGetValidParams ¶
func GetTranslation ¶
func GetValidator ¶
func MustParseURL ¶
func PrintFields ¶
func PrintFields(s interface{})
func ResponseSuccess ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.