init: 1.0.0
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package constant
|
||||
|
||||
type CtxKey string
|
||||
|
||||
const (
|
||||
CtxKeyUser CtxKey = "user"
|
||||
CtxKeySessionID CtxKey = "sessionId"
|
||||
CtxKeyRequestHost CtxKey = "requestHost"
|
||||
CtxKeyPlatform CtxKey = "platform"
|
||||
CtxKeyPayment CtxKey = "payment"
|
||||
)
|
||||
@@ -0,0 +1,52 @@
|
||||
package constant
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Used for type cloning conversion
|
||||
const (
|
||||
Int64 int64 = 0
|
||||
Uint32 uint32 = 0
|
||||
DevMode = "dev"
|
||||
)
|
||||
|
||||
// VerifyType is the type of verification code
|
||||
type VerifyType uint8
|
||||
|
||||
const (
|
||||
Register VerifyType = iota + 1
|
||||
Security
|
||||
)
|
||||
|
||||
func ParseVerifyType(i uint8) VerifyType {
|
||||
return VerifyType(i)
|
||||
}
|
||||
|
||||
func (v VerifyType) String() string {
|
||||
switch v {
|
||||
case Register:
|
||||
return "register"
|
||||
case Security:
|
||||
return "security"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
// TempOrderCacheKey Cache to Redis Key
|
||||
// eg: temp_order:order_no
|
||||
const TempOrderCacheKey = "temp_order:%s"
|
||||
|
||||
type TemporaryOrderInfo struct {
|
||||
OrderNo string `json:"order_no"`
|
||||
Identifier string `json:"identifier"`
|
||||
AuthType string `json:"auth_type"`
|
||||
Password string `json:"password"`
|
||||
InviteCode string `json:"invite_code,omitempty"`
|
||||
}
|
||||
|
||||
func (t TemporaryOrderInfo) Marshal() string {
|
||||
value, _ := json.Marshal(t)
|
||||
return string(value)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package constant
|
||||
|
||||
// Version PPanel version
|
||||
const (
|
||||
Version = "unknown"
|
||||
BuildNumber = "unknown"
|
||||
)
|
||||
Reference in New Issue
Block a user