constant

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DefaultUser             = "test.user"
	DefaultWorkspace        = "default"
	DefaultBackend          = "default"
	DefaultOrgOwner         = "kusion"
	DefaultSourceType       = SourceProviderTypeGit
	DefaultSourceDesc       = "Default source"
	DefaultSystemName       = "kusion"
	DefaultReleaseNamespace = "server"
	MaxConcurrent           = 10
	MaxAsyncConcurrent      = 1
	MaxAsyncBuffer          = 100
	DefaultLogFilePath      = "/home/admin/logs/kusion.log"
	RepoCacheTTL            = 60 * time.Minute
	RunTimeOut              = 60 * time.Minute
	DefaultWorkloadSig      = "kusion.io/is-workload"
	ResourcePageDefault     = 1
	ResourcePageSizeDefault = 100
	ResourcePageSizeLarge   = 1000
	CommonPageDefault       = 1
	CommonPageSizeDefault   = 10
	SortByCreateTimestamp   = "createTimestamp"
	SortByModifiedTimestamp = "modifiedTimestamp"
	SortByName              = "name"
	SortByID                = "id"
	SortByResourceName      = "resourceName"
	SortByResourceURN       = "resourceURN"
)

These constants represent the possible states of a stack.

View Source
const (
	AWSProviderType         = "aws"
	AliCloudProviderType    = "alicloud"
	AzureProviderType       = "azure"
	GoogleProviderType      = "google"
	CustomProviderType      = "custom"
	HashicorpProviderType   = "hashicorp"
	StatusResourceApplied   = "applied"
	StatusResourceDestroyed = "destroyed"
	StatusResourceFailed    = "failed"
	StatusResourceUnknown   = "unknown"
	TmpDirPrefix            = "/tmp"
)
View Source
const (
	RunTypeGenerate     RunType   = "Generate"
	RunTypePreview      RunType   = "Preview"
	RunTypeApply        RunType   = "Apply"
	RunTypeDestroy      RunType   = "Destroy"
	RunStatusScheduling RunStatus = "Scheduling"
	RunStatusInProgress RunStatus = "InProgress"
	RunStatusFailed     RunStatus = "Failed"
	RunStatusSucceeded  RunStatus = "Succeeded"
	RunStatusCancelled  RunStatus = "Cancelled"
	RunStatusQueued     RunStatus = "Queued"
	RunResultFailed     string    = "{\"result\":\"Operation Failed\"}"
	RunResultCancelled  string    = "{\"result\":\"Operation Cancelled\"}"
)
View Source
const (
	// StackStateUnSynced represents state of stack has not been synced with the remote runtime.
	StackStateUnSynced StackState = "UnSynced"
	// StackStateSynced represents state of stack is synced with the remote runtime.
	StackStateSynced StackState = "Synced"
	// StackStateOutOfSync represents state of stack has out of sync from the remote runtime.
	StackStateOutOfSync StackState = "OutOfSync"

	StackStateCreating         StackState = "Creating"
	StackStateGenerating       StackState = "Generating"
	StackStateGenerateFailed   StackState = "GenerateFailed"
	StackStateGenerated        StackState = "Generated"
	StackStatePreviewing       StackState = "Previewing"
	StackStatePreviewFailed    StackState = "PreviewFailed"
	StackStatePreviewed        StackState = "Previewed"
	StackStateApplying         StackState = "Applying"
	StackStateApplyFailed      StackState = "ApplyFailed"
	StackStateApplySucceeded   StackState = "ApplySucceeded"
	StackStateDestroying       StackState = "Destroying"
	StackStateDestroyFailed    StackState = "DestroyFailed"
	StackStateDestroySucceeded StackState = "DestroySucceeded"

	StackTypeGlobal StackType = "global"
	StackTypeCloud  StackType = "cloud"
	StackTypeTenant StackType = "tenant"
	StackTypeCell   StackType = "cell"
	StackTypeBase   StackType = "base"
	StackTypeMain   StackType = "main"

	FirstSemanticVersion = "1.0.0"
	BaseStackName        = "base"
)

These constants represent the possible states of a stack.

Variables

View Source
var (
	ErrInvalidBackendName = errors.New("backend name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
	ErrEmptyBackendType   = errors.New("backend type is required")
	ErrInvalidBackendType = errors.New("backend type is should be one of the following: [local, oss, s3, google]")
)
View Source
var (
	ErrEmptyURL   = errors.New("URL is empty")
	ErrInvalidURL = errors.New("invalid URL")
)
View Source
var (
	ErrOrgNil                  = errors.New("organization is nil")
	ErrOrgNameEmpty            = errors.New("organization must have a name")
	ErrOrgOwnerNil             = errors.New("org must have at least one owner")
	ErrWorkspaceNil            = errors.New("workspace is nil")
	ErrWorkspaceNameEmpty      = errors.New("workspace must have a name")
	ErrWorkspaceBackendNil     = errors.New("workspace must have a backend")
	ErrWorkspaceOwnerNil       = errors.New("workspace must have at least one owner")
	ErrBackendNil              = errors.New("backend is nil")
	ErrBackendNameEmpty        = errors.New("backend must have a name")
	ErrBackendTypeEmpty        = errors.New("backend must have a type")
	ErrDefaultBackendNotSet    = errors.New("default backend not set properly")
	ErrAppConfigHasNilStack    = errors.New("appConfig has nil stack")
	ErrInvalidOrganizationName = errors.New("organization name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
	ErrInvalidOrganizationID   = errors.New("the organization ID should be a uuid")
)
View Source
var (
	ErrProjectNil               = errors.New("project is nil")
	ErrProjectName              = errors.New("project must have a name")
	ErrProjectSource            = errors.New("project must have a source")
	ErrProjectOrganization      = errors.New("project must have an organization")
	ErrProjectSourceProvider    = errors.New("project source must have a source provider")
	ErrProjectRemote            = errors.New("project source must have a remote")
	ErrProjectCreationTimestamp = errors.New("project must have a creation timestamp")
	ErrProjectUpdateTimestamp   = errors.New("project must have a update timestamp")
	ErrProjectPath              = errors.New("project must have a path")
	ErrInvalidProjectPath       = errors.New("project path can only have alphanumeric characters, slashes and underscores with [\\/a-zA-Z0-9_]")
	ErrOrgIDOrDomainRequired    = errors.New("either domain or organization ID is required")
	ErrInvalidStackPath         = errors.New("stack path can only have alphanumeric characters, slashes and underscores with [\\/a-zA-Z0-9_]")
	ErrInvalidProjectName       = errors.New("project name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
	ErrInvalidStackName         = errors.New("stack name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
	ErrInvalidAppConfigName     = errors.New("appConfig name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
	ErrInvalidProjectID         = errors.New("the project ID should be a uuid")
	ErrInvalidStackID           = errors.New("the stack ID should be a uuid")
	ErrProjectNameAndFuzzyName  = errors.New("project name and fuzzy name cannot be set at the same time")
)
View Source
var (
	ErrSourceNil               = errors.New("source is nil")
	ErrDirectoryToCleanupEmpty = errors.New("temp kcp-kusion directory to clean up is empty")
	ErrEmptySourceName         = errors.New("source must have a name")
	ErrInvalidSourceName       = errors.New("project name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
	ErrEmptySourceProvider     = errors.New("source must have a source provider")
	ErrInvalidSourceProvider   = errors.New("source provider is should be one of the following: [git, github, oci, local]")
	ErrEmptySourceRemote       = errors.New("source must have a remote")
	ErrInvalidSourceRemote     = errors.New("source remote is not a valid URL")
)
View Source
var (
	ErrStackNil                  = errors.New("stack is nil")
	ErrStackName                 = errors.New("stack must have a name")
	ErrStackPath                 = errors.New("stack must have a path")
	ErrStackNilOrPathEmpty       = errors.New("stack is nil or path is empty")
	ErrStackTypeInvalid          = errors.New("stack type is invalid")
	ErrStackFrameworkType        = errors.New("stack must have a framework type")
	ErrStackDesiredVersion       = errors.New("stack must have a desired version")
	ErrStackSource               = errors.New("stack must have a source")
	ErrStackSourceProvider       = errors.New("stack source must have a source provider")
	ErrStackRemote               = errors.New("stack source must have a remote")
	ErrStackSyncState            = errors.New("stack must have a sync state")
	ErrStackLastAppliedTimestamp = errors.New("stack must have a last sync timestamp")
	ErrStackCreationTimestamp    = errors.New("stack must have a creation timestamp")
	ErrStackUpdateTimestamp      = errors.New("stack must have a update timestamp")
	ErrStackHasNilProject        = errors.New("stack must have a project")
	ErrStackAlreadyExists        = errors.New("stack already exists")
	ErrProjectNameOrIDRequired   = errors.New("either project name or project ID is required")
	ErrGettingNonExistingProject = errors.New("project does not exist")
)
View Source
var (
	ErrEmptyWorkspaceName          = errors.New("workspace must have a name")
	ErrInvalidWorkspaceName        = errors.New("workspace name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
	ErrEmptyOwners                 = errors.New("workspace must have at least one owner")
	ErrEmptyBackendID              = errors.New("workspace must have a backend id")
	ErrInvalidDefaultWorkspaceName = errors.New("workspace name cannot be \"default\"")
)
View Source
var ErrInvalidModuleName = errors.New("module name can only have alphanumeric characters and underscores with [a-zA-Z0-9_]")
View Source
var ErrResourceHasNilStack = errors.New("resource has nil stack")

Functions

This section is empty.

Types

type RunStatus added in v0.14.0

type RunStatus string

func ParseRunStatus added in v0.14.0

func ParseRunStatus(s string) (RunStatus, error)

ParseRunStatus parses a string into a RunStatus. If the string is not a valid RunStatus, it returns an error.

type RunType added in v0.14.0

type RunType string

func ParseRunType added in v0.14.0

func ParseRunType(s string) (RunType, error)

ParseRunType parses a string into a RunType. If the string is not a valid RunType, it returns an error.

type SourceProviderType

type SourceProviderType string

SourceProviderType represents the type of varying source providers, source provider is the general abstraction of version control systems (VCS), also known as source control systems (SCM).

const (
	// SourceProviderTypeGit represents git source provider type.
	SourceProviderTypeGit SourceProviderType = "git"

	// SourceProviderTypeGithub represents github source provider type.
	SourceProviderTypeGithub SourceProviderType = "github"

	// SourceProviderTypeOCI represents oci source provider type.
	SourceProviderTypeOCI SourceProviderType = "oci"

	// SourceProviderTypeLocal represents local source provider type.
	SourceProviderTypeLocal SourceProviderType = "local"
)

func ParseSourceProviderType

func ParseSourceProviderType(s string) (SourceProviderType, error)

ParseSourceProviderType parses a string into a SourceProviderType. If the string is not a valid SourceProviderType, it returns an error.

type StackState

type StackState string

StackState represents the state of a stack.

func ParseStackState

func ParseStackState(s string) (StackState, error)

ParseStackState parses a string into a StackState. If the string is not a valid StackState, it returns an error.

type StackType added in v0.13.0

type StackType string

StackType represents the type of a stack.

Jump to

Keyboard shortcuts

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