constants

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 4 Imported by: 71

Documentation

Index

Constants

View Source
const (
	ColumnAppId                    = "app_id"
	ColumnCategoryId               = "category_id"
	ColumnChartName                = "chart_name"
	ColumnClusterId                = "cluster_id"
	ColumnClusterType              = "cluster_type"
	ColumnCreateTime               = "create_time"
	ColumnCredential               = "credential"
	ColumnDescription              = "description"
	ColumnExecutor                 = "executor"
	ColumnFrontgateId              = "frontgate_id"
	ColumnHome                     = "home"
	ColumnIcon                     = "icon"
	ColumnInstanceId               = "instance_id"
	ColumnJobAction                = "job_action"
	ColumnJobId                    = "job_id"
	ColumnKeywords                 = "keywords"
	ColumnLabelKey                 = "label_key"
	ColumnLabelValue               = "label_value"
	ColumnLocale                   = "locale"
	ColumnMaintainers              = "maintainers"
	ColumnName                     = "name"
	ColumnNodeId                   = "node_id"
	ColumnKeyPairId                = "key_pair_id"
	ColumnOwner                    = "owner"
	ColumnOwnerPath                = "owner_path"
	ColumnPackageName              = "package_name"
	ColumnPrivateIp                = "private_ip"
	ColumnProvider                 = "provider"
	ColumnReadme                   = "readme"
	ColumnRepoEventId              = "repo_event_id"
	ColumnRepoId                   = "repo_id"
	ColumnRepoLabelId              = "repo_label_id"
	ColumnRepoSelectorId           = "repo_selector_id"
	ColumnResouceId                = "resource_id"
	ColumnRole                     = "role"
	ColumnRuntimeId                = "runtime_id"
	ColumnRuntimeCredentialId      = "runtime_credential_id"
	ColumnRuntimeUrl               = "runtime_url"
	ColumnDebug                    = "debug"
	ColumnRuntimeLabelId           = "runtime_label_id"
	ColumnScreenshots              = "screenshots"
	ColumnSelectorKey              = "selector_key"
	ColumnSelectorValue            = "selector_value"
	ColumnSequence                 = "sequence"
	ColumnSources                  = "sources"
	ColumnStatus                   = "status"
	ColumnStatusTime               = "status_time"
	ColumnTarget                   = "target"
	ColumnTaskAction               = "task_action"
	ColumnTaskId                   = "task_id"
	ColumnTransitionStatus         = "transition_status"
	ColumnType                     = "type"
	ColumnUpdateTime               = "update_time"
	ColumnUrl                      = "url"
	ColumnVersionId                = "version_id"
	ColumnVisibility               = "visibility"
	ColumnVolumeId                 = "volume_id"
	ColumnZone                     = "zone"
	ColumnVpcId                    = "vpc_id"
	ColumnEnv                      = "env"
	ColumnLoadbalancerListenerId   = "loadbalancer_listener_id"
	ColumnResult                   = "result"
	ColumnDirective                = "directive"
	ColumnRuntimeCredentialContent = "runtime_credential_content"
	ColumnUserId                   = "user_id"
	ColumnGroupId                  = "group_id"
	ColumnResetId                  = "reset_id"
	ColumnPassword                 = "password"
	ColumnEmail                    = "email"
	ColumnClientId                 = "client_id"
	ColumnClientSecret             = "client_secret"
	ColumnRefreshToken             = "refresh_token"
	ColumnAccessToken              = "access_token"
	ColumnTokenId                  = "token_id"
	ColumnScope                    = "scope"
	ColumnUsername                 = "username"
	ColumnAttachmentId             = "attachment_id"
	ColumnMessage                  = "message"
	ColumnAppDefaultStatus         = "app_default_status"
	ColumnMarketId                 = "market_id"
	ColumnController               = "controller"
	ColumnActive                   = "active"
	ColumnOperator                 = "operator"
	ColumnReviewId                 = "review_id"
	ColumnPhase                    = "phase"
	ColumnReviewer                 = "reviewer"
	ColumnCompanyName              = "company_name"
	ColumnCompanyWebsite           = "company_website"
	ColumnCompanyProfile           = "company_profile"
	ColumnAuthorizerName           = "authorizer_name"
	ColumnAuthorizerEmail          = "authorizer_email"
	ColumnAuthorizerPhone          = "authorizer_phone"
	ColumnBankName                 = "bank_name"
	ColumnBankAccountName          = "bank_account_name"
	ColumnBankAccountNumber        = "bank_account_number"
	ColumnRejectMessage            = "reject_message"
	ColumnSubmitTime               = "submit_time"
	ColumnApprover                 = "approver"
	ColumnIsv                      = "isv"
)
View Source
const (
	ProviderPrefix             = "openpitrix-rp-"
	ApiGatewayHost             = prefix + "api-gateway"
	RepoManagerHost            = prefix + "repo-manager"
	AppManagerHost             = prefix + "app-manager"
	RuntimeManagerHost         = prefix + "runtime-manager"
	ClusterManagerHost         = prefix + "cluster-manager"
	JobManagerHost             = prefix + "job-manager"
	TaskManagerHost            = prefix + "task-manager"
	PilotServiceHost           = prefix + "pilot-service"
	AccountServiceHost         = prefix + "account-service"
	IMServiceHost              = prefix + "im-service"
	AMServiceHost              = prefix + "am-service"
	RepoIndexerHost            = prefix + "repo-indexer"
	CategoryManagerHost        = prefix + "category-manager"
	RuntimeProviderManagerHost = prefix + "rp-manager"
	NotificationHost           = prefix + "notification"
	MarketManagerHost          = prefix + "market-manager"
	AttachmentManagerHost      = prefix + "attachment-manager"
	IsvManagerHost             = prefix + "isv-manager"
)
View Source
const (
	ApiGatewayPort             = 9100 // 91 is similar as Pi, Open[Pi]trix
	RepoManagerPort            = 9101
	AppManagerPort             = 9102
	RuntimeManagerPort         = 9103
	ClusterManagerPort         = 9104
	JobManagerPort             = 9106
	TaskManagerPort            = 9107
	RepoIndexerPort            = 9108
	PilotServicePort           = 9110
	FrontgateServicePort       = 9111
	DroneServicePort           = 9112
	CategoryManagerPort        = 9113
	PilotTlsListenPort         = 9114 // public service for frontgate
	AccountServicePort         = 9115
	FrontgateFileServerPort    = 9116
	MarketManagerPort          = 9117
	IsvManagerPort             = 9118
	IMServicePort              = 9119
	AMServicePort              = 9120
	EtcdServicePort            = 2379
	AttachmentManagerPort      = 9122
	RuntimeProviderManagerPort = 9121
	NotificationPort           = 9201
	ServiceConfigPort          = 9202
	ServicePushPort            = 9203
)
View Source
const (
	StatusActive      = "active"
	StatusUsed        = "used"
	StatusEnabled     = "enabled"
	StatusDisabled    = "disabled"
	StatusCreating    = "creating"
	StatusDeleted     = "deleted"
	StatusDeleting    = "deleting"
	StatusUpgrading   = "upgrading"
	StatusUpdating    = "updating"
	StatusRollbacking = "rollbacking"
	StatusStopped     = "stopped"
	StatusStopping    = "stopping"
	StatusStarting    = "starting"
	StatusRecovering  = "recovering"
	StatusCeased      = "ceased"
	StatusCeasing     = "ceasing"
	StatusResizing    = "resizing"
	StatusScaling     = "scaling"
	StatusWorking     = "working"
	StatusPending     = "pending"
	StatusSuccessful  = "successful"
	StatusFailed      = "failed"

	StatusRunning    = "running"
	StatusTerminated = "terminated"

	StatusAvailable = "available"
	StatusInUse     = "in-use"

	StatusInUse2 = "in_use"

	StatusDraft     = "draft"
	StatusSubmitted = "submitted"
	StatusPassed    = "passed"
	StatusRejected  = "rejected"
	StatusSuspended = "suspended"
	StatusInReview  = "in-review"
	StatusNew       = "new"
)
View Source
const (
	VisibilityPublic  = "public"
	VisibilityPrivate = "private"
)
View Source
const (
	DefaultMaxWorkingJobs  = 20
	DefaultMaxWorkingTasks = 20
	DefaultMaxRepoEvents   = 20
)
View Source
const (
	MaxTaskTimeout               = 3600 * time.Second
	WaitHelmTaskTimeout          = 7200 * time.Second
	WaitTaskTimeout              = 600 * time.Second
	WaitFrontgateServiceTimeout  = 1800 * time.Second
	WaitDroneServiceTimeout      = 1800 * time.Second
	WaitTaskInterval             = 3 * time.Second
	WaitFrontgateServiceInterval = 10 * time.Second
	WaitDroneServiceInterval     = 10 * time.Second

	GrpcToPilotTimeout = 10 * time.Second

	TimeoutName           = "timeout"
	DefaultServiceTimeout = 600

	// Maybe metadata is upgrading
	PilotTasksRetry = 5
	PilotTasksSleep = 2 * time.Second
)
View Source
const (
	ActionCreateCluster      = "CreateCluster"
	ActionUpgradeCluster     = "UpgradeCluster"
	ActionRollbackCluster    = "RollbackCluster"
	ActionResizeCluster      = "ResizeCluster"
	ActionAddClusterNodes    = "AddClusterNodes"
	ActionDeleteClusterNodes = "DeleteClusterNodes"
	ActionStopClusters       = "StopClusters"
	ActionStartClusters      = "StartClusters"
	ActionDeleteClusters     = "DeleteClusters"
	ActionRecoverClusters    = "RecoverClusters"
	ActionCeaseClusters      = "CeaseClusters"
	ActionUpdateClusterEnv   = "UpdateClusterEnv"
	ActionAttachKeyPairs     = "AttachKeyPairs"
	ActionDetachKeyPairs     = "DetachKeyPairs"
)
View Source
const (
	ProviderQingCloud   = "qingcloud"
	ProviderKubernetes  = "kubernetes"
	ProviderAWS         = "aws"
	ProviderAliyun      = "aliyun"
	ProviderTypeVmbased = "vmbased"
	TargetPilot         = "pilot"
)
View Source
const (
	PlaceHolder       = "*"
	ReplicaRoleSuffix = "-replica"
)
View Source
const (
	NodesToExecuteOnName    = "nodes_to_execute_on"
	PostStartServiceName    = "post_start_service"
	PostStopServiceName     = "post_stop_service"
	AgentInstalledName      = "agent_installed"
	ServiceOrderName        = "order"
	ServiceTimeoutName      = "timeout"
	ServiceCmdName          = "cmd"
	ServicePreCheckName     = "pre_check"
	ScalingPolicyParallel   = "parallel"
	ScalingPolicySequential = "sequential"

	NormalClusterType    = 0
	FrontgateClusterType = 1

	ServiceInit           = "init"
	ServiceStart          = "start"
	ServiceStop           = "stop"
	ServiceScaleIn        = "scale_in"
	ServiceScaleOut       = "scale_out"
	ServiceCustom         = "custom_service"
	ServiceRestart        = "restart"
	ServiceDestroy        = "destroy"
	ServiceBackup         = "backup"
	ServiceRestore        = "restore"
	ServiceDeleteSnapshot = "delete_snapshot"
	ServiceUpgrade        = "upgrade"
)
View Source
const (
	NfContentTypeInvite = "invite"
	NfContentTypeVerify = "verify"

	NfTypeEmail = "email"
)
View Source
const (
	TypeS3    = "s3"
	TypeHttp  = "http"
	TypeHttps = "https"
)
View Source
const (
	RoleUser        = "user"
	RoleDeveloper   = "developer"
	RoleIsv         = "isv"
	RoleGlobalAdmin = "global_admin"

	PortalGlobalAdmin = "global_admin"

	GrantTypeClientCredentials = "client_credentials"
	GrantTypePassword          = "password"
	GrantTypeRefreshToken      = "refresh_token"

	OperatorTypeGlobalAdmin = "global_admin"
	OperatorTypeDeveloper   = "developer"
	OperatorTypeBusiness    = "business"
	OperatorTypeTechnical   = "technical"
	OperatorTypeIsv         = "isv"
	OperatorTypeAdmin       = "admin"

	ActionBundleBusinessReview  = "business_review"
	ActionBundleTechnicalReview = "technical_review"
	ActionBundleIsvReview       = "isv_review"
	ActionBundleIsvApply        = "isv_apply"
	ActionBundleIsvAuth         = "isv_auth"
)
View Source
const (
	ServiceTypeNotification = "notification"
	ServiceTypeRuntime      = "runtime"
	ServiceTypeBasicConfig  = "basic_config"
)
View Source
const (
	RepoIndexPrefix = "repo_index_"
	ClusterPrefix   = "cluster_"
)
View Source
const (
	TableApp                 = "app"
	TableAppVersion          = "app_version"
	TableCategory            = "category"
	TableCategoryResource    = "category_resource"
	TableCluster             = "cluster"
	TableClusterCommon       = "cluster_common"
	TableClusterLink         = "cluster_link"
	TableClusterLoadbalancer = "cluster_loadbalancer"
	TableClusterNode         = "cluster_node"
	TableClusterRole         = "cluster_role"
	TableJob                 = "job"
	TableKeyPair             = "key_pair"
	TableNodeKeyPair         = "node_key_pair"
	TableRepo                = "repo"
	TableRepoEvent           = "repo_event"
	TableRepoLabel           = "repo_label"
	TableRepoProvider        = "repo_provider"
	TableRepoSelector        = "repo_selector"
	TableRuntime             = "runtime"
	TableRuntimeCredential   = "runtime_credential"
	TableTask                = "task"
	TableAttachment          = "attachment"

	TableUser              = "user"
	TableGroupMember       = "group_member"
	TableUserPasswordReset = "user_password_reset"
	TableGroup             = "group"
	TableUserClient        = "user_client"
	TableToken             = "token"

	TableMarket     = "market"
	TableMarketUser = "market_user"

	TableAppVersionAudit  = "app_version_audit"
	TableAppVersionReview = "app_version_review"
	TableVendorVerifyInfo = "vendor_verify_info"
)
View Source
const EmailNotifyName = "email"
View Source
const (
	EmailNotifyTemplate = `` /* 11163-byte string literal not displayed */

)
View Source
const FrontgateAppId = "app-ABCDEFGHIJKLMNOPQRST"
View Source
const FrontgateDefaultConf = `` /* 362-byte string literal not displayed */
View Source
const FrontgateVersionId = "appv-ABCDEFGHIJKLMNOPQRST"

can use this id for internal test

View Source
const (
	RetryInterval = 3 * time.Second
)
View Source
const UserSystem = "system"

Variables

View Source
var (
	AdminInviteIsvNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	AdminInviteIsvNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	AdminInviteUserNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	AdminInviteUserNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	IsvInviteMemberNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	IsvInviteMemberNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	SubmitVendorNotifyAdminTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	SubmitVendorNotifyAdminContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	SubmitVendorNotifyIsvTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	SubmitVendorNotifyIsvContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	PassVendorNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	PassVendorNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	RejectVendorNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	RejectVendorNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	SubmitAppVersionNotifyReviewerTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	SubmitAppVersionNotifyReviewerContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	SubmitAppVersionNotifySubmitterTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	SubmitAppVersionNotifySubmitterContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	PassAppVersionInfoNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	PassAppVersionInfoNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	PassAppVersionBusinessNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	PassAppVersionBusinessNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	PassAppVersionTechnicalNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	PassAppVersionTechnicalNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	RejectAppVersionInfoNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	RejectAppVersionInfoNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	RejectAppVersionBusinessNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	RejectAppVersionBusinessNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	RejectAppVersionTechnicalNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	RejectAppVersionTechnicalNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	ReleaseAppVersionNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	ReleaseAppVersionNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}

	SuspendAppVersionNotifyTitle = NotifyTitle{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
	SuspendAppVersionNotifyContent = NotifyContent{
		NotifyMessage: NotifyMessage{
			// contains filtered or unexported fields
		},
	}
)
View Source
var AllowedAppDefaultStatus = []string{
	"",
	StatusDraft,
	StatusActive,
}
View Source
var DeletedStatuses = []string{
	StatusDeleted,
	StatusCeased,
}
View Source
var IndexedColumns = map[string][]string{
	TableApp: {
		ColumnAppId, ColumnName, ColumnRepoId, ColumnDescription, ColumnStatus,
		ColumnHome, ColumnIcon, ColumnScreenshots, ColumnMaintainers, ColumnSources,
		ColumnReadme, ColumnOwner, ColumnChartName, ColumnIsv,
	},
	TableAppVersion: {
		ColumnVersionId, ColumnAppId, ColumnName, ColumnOwner, ColumnDescription,
		ColumnPackageName, ColumnStatus, ColumnType,
	},
	TableJob: {
		ColumnJobId, ColumnClusterId, ColumnAppId, ColumnVersionId,
		ColumnExecutor, ColumnProvider, ColumnStatus, ColumnOwner,
	},
	TableTask: {
		ColumnJobId, ColumnTaskId, ColumnExecutor, ColumnStatus, ColumnOwner,
	},
	TableRepo: {
		ColumnRepoId, ColumnName, ColumnType, ColumnVisibility, ColumnStatus,
		ColumnAppDefaultStatus, ColumnOwner, ColumnController,
	},
	TableRuntime: {
		ColumnRuntimeId, ColumnProvider, ColumnZone, ColumnStatus, ColumnOwner, ColumnRuntimeCredentialId,
	},
	TableRuntimeCredential: {
		ColumnRuntimeCredentialId, ColumnStatus, ColumnProvider, ColumnOwner,
	},
	TableRepoLabel: {
		ColumnRepoId, ColumnRepoLabelId, ColumnStatus,
	},
	TableRepoSelector: {
		ColumnRepoId, ColumnRepoSelectorId, ColumnStatus,
	},
	TableRepoEvent: {
		ColumnRepoEventId, ColumnRepoId, ColumnStatus, ColumnOwner,
	},
	TableCluster: {
		ColumnClusterId, ColumnAppId, ColumnVersionId, ColumnStatus,
		ColumnRuntimeId, ColumnFrontgateId, ColumnOwner, ColumnClusterType,
	},
	TableKeyPair: {
		ColumnKeyPairId, ColumnName, ColumnOwner,
	},
	TableClusterNode: {
		ColumnClusterId, ColumnNodeId, ColumnStatus, ColumnOwner,
	},
	TableCategory: {
		ColumnCategoryId, ColumnStatus, ColumnLocale, ColumnOwner, ColumnName,
	},
	TableMarket: {
		ColumnMarketId, ColumnName, ColumnVisibility, ColumnStatus, ColumnOwner,
	},
	TableMarketUser: {
		ColumnMarketId, ColumnUserId,
	},
	TableAppVersionAudit: {
		ColumnVersionId, ColumnAppId, ColumnStatus, ColumnOperator, ColumnRole,
	},
	TableAppVersionReview: {
		ColumnReviewId, ColumnVersionId, ColumnAppId, ColumnStatus, ColumnReviewer,
	},
	TableVendorVerifyInfo: {
		ColumnUserId, ColumnStatus,
	},
}

columns that can be search through sql '=' operator

View Source
var InternalRepos = []string{
	"repo-vmbased", "repo-helm",
}
View Source
var InternalUsers = []string{
	UserSystem,
}

columns that can be search through sql 'like' operator

Functions

This section is empty.

Types

type EmailNotifyContent added in v0.4.0

type EmailNotifyContent struct {
	Content string
}

type NotifyContent added in v0.4.0

type NotifyContent struct {
	NotifyMessage
}

func (*NotifyContent) GetDefaultMessage added in v0.4.0

func (n *NotifyContent) GetDefaultMessage(params ...interface{}) string

type NotifyMessage added in v0.4.0

type NotifyMessage struct {
	// contains filtered or unexported fields
}

func (*NotifyMessage) GetMessage added in v0.4.0

func (n *NotifyMessage) GetMessage(locale string, params ...interface{}) string

type NotifyTitle added in v0.4.0

type NotifyTitle struct {
	NotifyMessage
}

func (*NotifyTitle) GetDefaultMessage added in v0.4.0

func (n *NotifyTitle) GetDefaultMessage(params ...interface{}) string

Jump to

Keyboard shortcuts

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