constant

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Running     = "Running"
	UnHealthy   = "UnHealthy"
	Error       = "Error"
	Stopped     = "Stopped"
	Installing  = "Installing"
	Syncing     = "Syncing"
	DownloadErr = "DownloadErr"
	DirNotFound = "DirNotFound"
	Upgrading   = "Upgrading"
	UpgradeErr  = "UpgradeErr"

	ContainerPrefix = "1Panel-"

	AppNormal   = "Normal"
	AppTakeDown = "TakeDown"

	AppOpenresty = "openresty"
	AppMysql     = "mysql"
	AppRedis     = "redis"

	AppResourceLocal  = "local"
	AppResourceRemote = "remote"

	CPUS          = "CPUS"
	MemoryLimit   = "MEMORY_LIMIT"
	HostIP        = "HOST_IP"
	ContainerName = "CONTAINER_NAME"
)
View Source
const (
	Valid        = "VALID"
	DisConnect   = "DISCONNECT"
	VerifyFailed = "VERIFYFAILED"
	S3           = "S3"
	OSS          = "OSS"
	Sftp         = "SFTP"
	MinIo        = "MINIO"
	Cos          = "COS"
	Kodo         = "KODO"
)
View Source
const (
	ContainerOpStart   = "start"
	ContainerOpStop    = "stop"
	ContainerOpRestart = "restart"
	ContainerOpKill    = "kill"
	ContainerOpPause   = "pause"
	ContainerOpUnpause = "unpause"
	ContainerOpRename  = "rename"
	ContainerOpRemove  = "remove"

	ComposeOpStop    = "stop"
	ComposeOpRestart = "restart"
	ComposeOpRemove  = "remove"

	DaemonJsonPath = "/etc/docker/daemon.json"
)
View Source
const (
	CodeSuccess           = 200
	CodeErrBadRequest     = 400
	CodeErrUnauthorized   = 401
	CodeErrUnSafety       = 402
	CodeErrForbidden      = 403
	CodeErrNotFound       = 404
	CodePasswordExpired   = 405
	CodeAuth              = 406
	CodeGlobalLoading     = 407
	CodeErrIP             = 408
	CodeErrDomain         = 409
	CodeErrInternalServer = 500
	CodeErrHeader         = 406
)
View Source
const (
	NginxScopeServer = "server"
	NginxScopeHttp   = "http"
	NginxScopeOut    = "out"

	NginxReload  = "reload"
	NginxCheck   = "check"
	NginxRestart = "restart"

	ConfigNew    = "add"
	ConfigUpdate = "update"
	ConfigDel    = "delete"
)
View Source
const (
	ResourceLocal    = "local"
	ResourceAppstore = "appstore"

	RuntimeNormal   = "normal"
	RuntimeError    = "error"
	RuntimeBuildIng = "building"

	RuntimePHP = "php"

	RuntimeProxyUnix = "unix"
	RuntimeProxyTcp  = "tcp"
)
View Source
const (
	AuthMethodSession = "session"
	SessionName       = "psession"

	AuthMethodJWT = "jwt"
	JWTHeaderName = "PanelAuthorization"
	JWTBufferTime = 3600
	JWTIssuer     = "1Panel"

	PasswordExpiredName = "expired"
)
View Source
const (
	StatusRunning   = "Running"
	StatusStoped    = "Stoped"
	StatusWaiting   = "Waiting"
	StatusSuccess   = "Success"
	StatusFailed    = "Failed"
	StatusUploading = "Uploading"
	StatusEnable    = "Enable"
	StatusDisable   = "Disable"
	StatusNone      = "None"
)
View Source
const (
	WebRunning = "Running"
	WebStopped = "Stopped"

	DateLayout     = "2006-01-02"
	DateTimeLayout = "2006-01-02 15:04:05"
	DefaultDate    = "1970-01-01"

	ProtocolHTTP  = "HTTP"
	ProtocolHTTPS = "HTTPS"

	NewApp       = "new"
	InstalledApp = "installed"

	Deployment = "deployment"
	Static     = "static"
	Proxy      = "proxy"
	Runtime    = "runtime"

	SSLExisted = "existed"
	SSLAuto    = "auto"
	SSLManual  = "manual"

	DNSAccount = "dnsAccount"
	DnsManual  = "dnsManual"
	Http       = "http"
	Manual     = "manual"

	StartWeb = "start"
	StopWeb  = "stop"

	HTTPSOnly   = "HTTPSOnly"
	HTTPAlso    = "HTTPAlso"
	HTTPToHTTPS = "HTTPToHTTPS"

	GetLog     = "get"
	DisableLog = "disable"
	EnableLog  = "enable"
	DeleteLog  = "delete"

	AccessLog = "access.log"
	ErrorLog  = "error.log"

	ConfigPHP = "php"
	ConfigFPM = "fpm"
)

Variables

View Source
var (
	DataDir              = global.CONF.System.DataDir
	ResourceDir          = path.Join(DataDir, "resource")
	AppResourceDir       = path.Join(ResourceDir, "apps")
	AppInstallDir        = path.Join(DataDir, "apps")
	LocalAppResourceDir  = path.Join(AppResourceDir, "local")
	LocalAppInstallDir   = path.Join(AppInstallDir, "local")
	RemoteAppResourceDir = path.Join(AppResourceDir, "remote")
	RuntimeDir           = path.Join(DataDir, "runtime")
)
View Source
var (
	ErrCaptchaCode     = errors.New("ErrCaptchaCode")
	ErrAuth            = errors.New("ErrAuth")
	ErrRecordExist     = errors.New("ErrRecordExist")
	ErrRecordNotFound  = errors.New("ErrRecordNotFound")
	ErrStructTransform = errors.New("ErrStructTransform")
	ErrInitialPassword = errors.New("ErrInitialPassword")
	ErrNotSupportType  = errors.New("ErrNotSupportType")
	ErrInvalidParams   = errors.New("ErrInvalidParams")

	ErrTokenParse = errors.New("ErrTokenParse")
)

internal

View Source
var (
	ErrTypeInternalServer  = "ErrInternalServer"
	ErrTypeInvalidParams   = "ErrInvalidParams"
	ErrTypeNotLogin        = "ErrNotLogin"
	ErrTypePasswordExpired = "ErrPasswordExpired"
	ErrNameIsExist         = "ErrNameIsExist"
	ErrDemoEnvironment     = "ErrDemoEnvironment"
)

api

View Source
var (
	ErrPortInUsed          = "ErrPortInUsed"
	ErrAppLimit            = "ErrAppLimit"
	ErrFileToLarge         = "ErrFileToLarge"
	ErrFileCanNotRead      = "ErrFileCanNotRead"
	ErrNotInstall          = "ErrNotInstall"
	ErrPortInOtherApp      = "ErrPortInOtherApp"
	ErrDbUserNotValid      = "ErrDbUserNotValid"
	ErrUpdateBuWebsite     = "ErrUpdateBuWebsite"
	Err1PanelNetworkFailed = "Err1PanelNetworkFailed"
	ErrCmdTimeout          = "ErrCmdTimeout"
	ErrFileParse           = "ErrFileParse"
	ErrInstallDirNotFound  = "ErrInstallDirNotFound"
	ErrContainerName       = "ErrContainerName"
)

app

View Source
var (
	ErrDomainIsExist      = "ErrDomainIsExist"
	ErrAliasIsExist       = "ErrAliasIsExist"
	ErrGroupIsUsed        = "ErrGroupIsUsed"
	ErrUsernameIsExist    = "ErrUsernameIsExist"
	ErrUsernameIsNotExist = "ErrUsernameIsNotExist"
)

website

View Source
var (
	ErrSSLCannotDelete     = "ErrSSLCannotDelete"
	ErrAccountCannotDelete = "ErrAccountCannotDelete"
	ErrSSLApply            = "ErrSSLApply"
	ErrEmailIsExist        = "ErrEmailIsExist"
)

ssl

View Source
var (
	ErrPathNotFound     = "ErrPathNotFound"
	ErrMovePathFailed   = "ErrMovePathFailed"
	ErrLinkPathNotFound = "ErrLinkPathNotFound"
	ErrFileIsExit       = "ErrFileIsExit"
	ErrFileUpload       = "ErrFileUpload"
	ErrFileDownloadDir  = "ErrFileDownloadDir"
)

file

View Source
var (
	ErrUserIsExist     = "ErrUserIsExist"
	ErrDatabaseIsExist = "ErrDatabaseIsExist"
	ErrExecTimeOut     = "ErrExecTimeOut"
)

mysql

View Source
var (
	ErrInUsed       = "ErrInUsed"
	ErrObjectInUsed = "ErrObjectInUsed"
	ErrPortRules    = "ErrPortRules"
)

container

View Source
var (
	ErrDirNotFound    = "ErrDirNotFound"
	ErrFileNotExist   = "ErrFileNotExist"
	ErrImageBuildErr  = "ErrImageBuildErr"
	ErrImageExist     = "ErrImageExist"
	ErrDelWithWebsite = "ErrDelWithWebsite"
)

runtime

View Source
var (
	ErrBackupInUsed = "ErrBackupInUsed"
	ErrOSSConn      = "ErrOSSConn"
)
View Source
var (
	ErrTypeOfRedis = "ErrTypeOfRedis"
)

redis

Functions

This section is empty.

Types

type AppOperate

type AppOperate string
var (
	Up      AppOperate = "up"
	Down    AppOperate = "down"
	Start   AppOperate = "start"
	Stop    AppOperate = "stop"
	Restart AppOperate = "restart"
	Delete  AppOperate = "delete"
	Sync    AppOperate = "sync"
	Backup  AppOperate = "backup"
	Restore AppOperate = "restore"
	Update  AppOperate = "update"
	Rebuild AppOperate = "rebuild"
	Upgrade AppOperate = "upgrade"
)

type DBContext

type DBContext string
const (
	DB DBContext = "db"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL