2022-08-16 23:30:23 +08:00
|
|
|
package constant
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
CodeSuccess = 200
|
|
|
|
CodeErrBadRequest = 400
|
|
|
|
CodeErrUnauthorized = 401
|
2022-09-15 17:15:03 +08:00
|
|
|
CodeErrUnSafety = 402
|
2022-08-16 23:30:23 +08:00
|
|
|
CodeErrForbidden = 403
|
|
|
|
CodeErrNotFound = 404
|
2022-09-29 16:15:59 +08:00
|
|
|
CodePasswordExpired = 405
|
2022-12-05 11:12:07 +08:00
|
|
|
CodeAuth = 406
|
2023-01-31 15:22:05 +08:00
|
|
|
CodeGlobalLoading = 407
|
2023-05-19 21:47:46 +08:00
|
|
|
CodeErrIP = 408
|
|
|
|
CodeErrDomain = 409
|
2022-08-16 23:30:23 +08:00
|
|
|
CodeErrInternalServer = 500
|
|
|
|
CodeErrHeader = 406
|
|
|
|
)
|
|
|
|
|
|
|
|
// internal
|
|
|
|
var (
|
|
|
|
ErrCaptchaCode = errors.New("ErrCaptchaCode")
|
2022-12-02 18:52:43 +08:00
|
|
|
ErrAuth = errors.New("ErrAuth")
|
2022-08-16 23:30:23 +08:00
|
|
|
ErrRecordExist = errors.New("ErrRecordExist")
|
|
|
|
ErrRecordNotFound = errors.New("ErrRecordNotFound")
|
|
|
|
ErrStructTransform = errors.New("ErrStructTransform")
|
2022-09-08 18:47:15 +08:00
|
|
|
ErrInitialPassword = errors.New("ErrInitialPassword")
|
2022-09-16 18:53:45 +08:00
|
|
|
ErrNotSupportType = errors.New("ErrNotSupportType")
|
|
|
|
ErrInvalidParams = errors.New("ErrInvalidParams")
|
2022-08-16 23:30:23 +08:00
|
|
|
|
|
|
|
ErrTokenParse = errors.New("ErrTokenParse")
|
|
|
|
)
|
|
|
|
|
|
|
|
// api
|
|
|
|
var (
|
2022-09-29 16:15:59 +08:00
|
|
|
ErrTypeInternalServer = "ErrInternalServer"
|
|
|
|
ErrTypeInvalidParams = "ErrInvalidParams"
|
|
|
|
ErrTypeNotLogin = "ErrNotLogin"
|
|
|
|
ErrTypePasswordExpired = "ErrPasswordExpired"
|
2022-12-02 10:31:07 +08:00
|
|
|
ErrNameIsExist = "ErrNameIsExist"
|
2023-02-21 15:19:12 +08:00
|
|
|
ErrDemoEnvironment = "ErrDemoEnvironment"
|
2022-08-16 23:30:23 +08:00
|
|
|
)
|
2022-12-01 15:48:40 +08:00
|
|
|
|
|
|
|
// app
|
|
|
|
var (
|
2023-03-22 18:22:29 +08:00
|
|
|
ErrPortInUsed = "ErrPortInUsed"
|
|
|
|
ErrAppLimit = "ErrAppLimit"
|
2023-05-17 13:46:28 +08:00
|
|
|
ErrFileToLarge = "ErrFileToLarge"
|
2023-03-22 18:22:29 +08:00
|
|
|
ErrFileCanNotRead = "ErrFileCanNotRead"
|
|
|
|
ErrNotInstall = "ErrNotInstall"
|
|
|
|
ErrPortInOtherApp = "ErrPortInOtherApp"
|
|
|
|
ErrDbUserNotValid = "ErrDbUserNotValid"
|
|
|
|
ErrUpdateBuWebsite = "ErrUpdateBuWebsite"
|
|
|
|
Err1PanelNetworkFailed = "Err1PanelNetworkFailed"
|
2023-04-12 14:16:29 +08:00
|
|
|
ErrCmdTimeout = "ErrCmdTimeout"
|
2023-05-15 22:40:05 +08:00
|
|
|
ErrFileParse = "ErrFileParse"
|
|
|
|
ErrInstallDirNotFound = "ErrInstallDirNotFound"
|
2022-12-01 15:48:40 +08:00
|
|
|
)
|
2022-12-04 16:10:48 +08:00
|
|
|
|
2023-03-30 16:47:47 +08:00
|
|
|
// website
|
2022-12-04 16:10:48 +08:00
|
|
|
var (
|
2023-04-25 18:10:17 +08:00
|
|
|
ErrDomainIsExist = "ErrDomainIsExist"
|
|
|
|
ErrAliasIsExist = "ErrAliasIsExist"
|
|
|
|
ErrGroupIsUsed = "ErrGroupIsUsed"
|
|
|
|
ErrUsernameIsExist = "ErrUsernameIsExist"
|
|
|
|
ErrUsernameIsNotExist = "ErrUsernameIsNotExist"
|
2022-12-04 16:10:48 +08:00
|
|
|
)
|
2022-12-05 15:50:53 +08:00
|
|
|
|
2023-03-30 16:47:47 +08:00
|
|
|
// ssl
|
2022-12-05 15:50:53 +08:00
|
|
|
var (
|
|
|
|
ErrSSLCannotDelete = "ErrSSLCannotDelete"
|
|
|
|
ErrAccountCannotDelete = "ErrAccountCannotDelete"
|
2023-01-04 11:44:43 +08:00
|
|
|
ErrSSLApply = "ErrSSLApply"
|
2023-02-20 17:04:59 +08:00
|
|
|
ErrEmailIsExist = "ErrEmailIsExist"
|
2022-12-05 15:50:53 +08:00
|
|
|
)
|
2023-02-09 14:31:05 +08:00
|
|
|
|
2023-03-30 16:47:47 +08:00
|
|
|
// file
|
2023-02-09 14:31:05 +08:00
|
|
|
var (
|
2023-03-10 16:01:36 +08:00
|
|
|
ErrPathNotFound = "ErrPathNotFound"
|
|
|
|
ErrMovePathFailed = "ErrMovePathFailed"
|
|
|
|
ErrLinkPathNotFound = "ErrLinkPathNotFound"
|
|
|
|
ErrFileIsExit = "ErrFileIsExit"
|
2023-03-22 18:34:29 +08:00
|
|
|
ErrFileUpload = "ErrFileUpload"
|
2023-02-09 14:31:05 +08:00
|
|
|
)
|
2023-03-07 16:44:16 +08:00
|
|
|
|
2023-03-30 16:47:47 +08:00
|
|
|
// mysql
|
2023-03-07 16:44:16 +08:00
|
|
|
var (
|
|
|
|
ErrUserIsExist = "ErrUserIsExist"
|
|
|
|
ErrDatabaseIsExist = "ErrDatabaseIsExist"
|
2023-04-11 14:38:27 +08:00
|
|
|
ErrExecTimeOut = "ErrExecTimeOut"
|
2023-03-07 16:44:16 +08:00
|
|
|
)
|
2023-03-08 17:02:06 +08:00
|
|
|
|
2023-03-30 16:47:47 +08:00
|
|
|
// redis
|
2023-03-08 17:02:06 +08:00
|
|
|
var (
|
|
|
|
ErrTypeOfRedis = "ErrTypeOfRedis"
|
|
|
|
)
|
2023-03-15 16:48:26 +08:00
|
|
|
|
2023-03-30 16:47:47 +08:00
|
|
|
// container
|
2023-03-15 16:48:26 +08:00
|
|
|
var (
|
2023-03-16 15:03:44 +08:00
|
|
|
ErrInUsed = "ErrInUsed"
|
|
|
|
ErrObjectInUsed = "ErrObjectInUsed"
|
2023-04-28 22:46:20 +08:00
|
|
|
ErrPortRules = "ErrPortRules"
|
2023-03-15 16:48:26 +08:00
|
|
|
)
|
2023-03-30 16:47:47 +08:00
|
|
|
|
2023-03-31 14:02:28 +08:00
|
|
|
// runtime
|
2023-03-30 16:47:47 +08:00
|
|
|
var (
|
2023-04-06 00:09:58 +08:00
|
|
|
ErrDirNotFound = "ErrDirNotFound"
|
|
|
|
ErrFileNotExist = "ErrFileNotExist"
|
|
|
|
ErrImageBuildErr = "ErrImageBuildErr"
|
|
|
|
ErrImageExist = "ErrImageExist"
|
|
|
|
ErrDelWithWebsite = "ErrDelWithWebsite"
|
2023-03-30 16:47:47 +08:00
|
|
|
)
|
2023-04-17 16:06:28 +08:00
|
|
|
|
|
|
|
var (
|
|
|
|
ErrBackupInUsed = "ErrBackupInUsed"
|
|
|
|
)
|