init repo
This commit is contained in:
62
common/const.go
Normal file
62
common/const.go
Normal file
@@ -0,0 +1,62 @@
|
||||
package common
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
AuthorizationKey = "authorization"
|
||||
SetAuthorizationKey = "x-set-authorization"
|
||||
MsgKey = "msg"
|
||||
DataKey = "data"
|
||||
UserIDKey = "x-toyboom-userid"
|
||||
UserNameKey = "x-toyboom-username"
|
||||
CommandKey = "x-toyboom-command"
|
||||
EndpointKey = "endpoint"
|
||||
IpAddrKey = "ipaddr"
|
||||
HeaderKey = "header"
|
||||
MethodKey = "method"
|
||||
UAKey = "User-Agent"
|
||||
ContentTypeKey = "Content-Type"
|
||||
TraceIDKey = "TraceID"
|
||||
TokenKey = "token"
|
||||
ErrKey = "err"
|
||||
UserInfoKey = "x-toyboom-userinfo"
|
||||
HostKey = "Host"
|
||||
LogtoWebHookSignKey = "Logto-Signature-Sha-256"
|
||||
NormalUIDKey = "uid"
|
||||
)
|
||||
|
||||
const (
|
||||
ErrInvalidRequest = "invalid request"
|
||||
ErrUserInfoNotValid = "user info not valid"
|
||||
ErrInternalError = "internal error"
|
||||
ErrParamNotValid = "param not valid"
|
||||
ErrDB = "database error"
|
||||
ErrNotFound = "data not found"
|
||||
ErrCodeNotFound = "code not found"
|
||||
ErrCodeAlreadyUsed = "code already used"
|
||||
)
|
||||
|
||||
const (
|
||||
ReqSuccess = "success"
|
||||
)
|
||||
|
||||
const (
|
||||
TimeLayout = time.RFC3339
|
||||
)
|
||||
|
||||
const (
|
||||
StatusPending = "pending"
|
||||
StatusSuccess = "success"
|
||||
StatusFailed = "failed"
|
||||
StatusDone = "done"
|
||||
)
|
||||
|
||||
const (
|
||||
CliTypeServer = "server"
|
||||
CliTypeClient = "client"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultServerID = "default"
|
||||
DefaultAdminUserID = 1
|
||||
)
|
||||
Reference in New Issue
Block a user