constant

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 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"

	ContainerPrefix = "1Panel-"

	AppNormal   = "Normal"
	AppTakeDown = "TakeDown"

	AppOpenresty = "openresty"
	AppMysql     = "mysql"
	AppRedis     = "redis"
)
View Source
const (
	Valid        = "VALID"
	DisConnect   = "DISCONNECT"
	VerifyFailed = "VERIFYFAILED"
	S3           = "S3"
	OSS          = "OSS"
	Sftp         = "SFTP"
	MinIo        = "MINIO"
)
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
	CodeErrInternalServer = 500
	CodeErrHeader         = 406
)
View Source
const (
	NginxScopeServer = "server"
	NginxScopeHttp   = "http"
	NginxScopeOut    = "out"

	NginxReload = "reload"
	NginxCheck  = "check"

	ConfigNew    = "add"
	ConfigUpdate = "update"
	ConfigDel    = "delete"
)
View Source
const (
	AuthMethodSession = "session"
	SessionName       = "psession"

	AuthMethodJWT = "jwt"
	JWTHeaderName = "Authorization"
	JWTBufferTime = 86400
	JWTIssuer     = "1Panel"

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

	DateLayout  = "2006-01-02"
	DefaultDate = "1970-01-01"

	ProtocolHTTP  = "HTTP"
	ProtocolHTTPS = "HTTPS"

	NewApp       = "new"
	InstalledApp = "installed"

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

	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"

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

Variables

View Source
var (
	DataDir        = global.CONF.System.DataDir
	ResourceDir    = path.Join(DataDir, "resource")
	AppResourceDir = path.Join(ResourceDir, "apps")
	AppInstallDir  = path.Join(DataDir, "apps")
)
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")

	ErrPageGenerate = errors.New("generate page info failed")
	ErrRepoNotValid = "ErrRepoNotValid"
)

internal

View Source
var (
	ErrTypeInternalServer  = "ErrInternalServer"
	ErrTypeInvalidParams   = "ErrInvalidParams"
	ErrTypeToken           = "ErrToken"
	ErrTypeTokenTimeOut    = "ErrTokenTimeOut"
	ErrTypeNotLogin        = "ErrNotLogin"
	ErrTypePasswordExpired = "ErrPasswordExpired"
	ErrTypeNotSafety       = "ErrNotSafety"
	ErrNameIsExist         = "ErrNameIsExist"
	ErrDemoEnvironment     = "ErrDemoEnvironment"
)

api

View Source
var (
	ErrPortInUsed      = "ErrPortInUsed"
	ErrAppLimit        = "ErrAppLimit"
	ErrAppRequired     = "ErrAppRequired"
	ErrFileCanNotRead  = "ErrFileCanNotRead"
	ErrFileToLarge     = "ErrFileToLarge"
	ErrNotInstall      = "ErrNotInstall"
	ErrPortInOtherApp  = "ErrPortInOtherApp"
	ErrDbUserNotValid  = "ErrDbUserNotValid"
	ErrUpdateBuWebsite = "ErrUpdateBuWebsite"
)

app

View Source
var (
	ErrDomainIsExist = "ErrDomainIsExist"
	ErrAliasIsExist  = "ErrAliasIsExist"
	ErrAppDelete     = "ErrAppDelete"
	ErrGroupIsUsed   = "ErrGroupIsUsed"
)

website

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

ssl

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

file

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

mysql

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

container

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