2024-09-02 18:07:30 +00:00

63 lines
1.4 KiB
Go

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
)