enum

package
v0.0.1-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationStatusRunning  = "running"
	ApplicationStatusPaused   = "paused"
	ApplicationStatusSleeping = "sleeping"
	ApplicationStatusError    = "error"
)
View Source
const (
	ApplicationDeploymentStatusNeedsDeployment = "needs deployment"
	ApplicationDeploymentStatusDeploying       = "deploying"
	ApplicationDeploymentStatusFailed          = "failed"
	ApplicationDeploymentStatusSuccess         = "success"
)
View Source
const (
	DeploymentStatusPending   = "pending"
	DeploymentStatusRunning   = "running"
	DeploymentStatusSuccess   = "success"
	DeploymentStatusSkipped   = "skipped"
	DeploymentStatusFailed    = "failed"
	DeploymentStatusCancelled = "cancelled"
)

Variables

View Source
var DNSProviders = sortEnum([]DNSProvider{
	DNSProviderNone,
	DNSProviderCloudflare,
})
View Source
var TenantRoles = sortEnum([]TenantRole{
	TenantRoleAdmin,
	TenantRoleMember,
})

Functions

func GetAllBuilderTypeStr

func GetAllBuilderTypeStr() []string

func GetAllJobStates

func GetAllJobStates() ([]JobState, JobState)

func GetAllPrincipalTypes

func GetAllPrincipalTypes() ([]PrincipalType, PrincipalType)

func GetAllRestartPolicyStr

func GetAllRestartPolicyStr() []string

func Sanitize

func Sanitize[E constraints.Ordered](element E, all func() ([]E, E)) (E, bool)

Types

type ApplicationAttr

type ApplicationAttr int

ApplicationAttr defines application attributes that can be used for sorting and filtering.

const (
	ApplicationAttrNone ApplicationAttr = iota
	ApplicationAttrCreated
	ApplicationAttrUpdated
	ApplicationAttrDeleted
)

ApplicationAttr enumeration.

func ParseApplicationAttr

func ParseApplicationAttr(s string) ApplicationAttr

ParseApplicationAttr parses the application attribute string and returns the equivalent enumeration.

func (ApplicationAttr) String

func (a ApplicationAttr) String() string

String returns the string representation of the attribute.

type ApplicationDeploymentStatus

type ApplicationDeploymentStatus string

type ApplicationSource

type ApplicationSource string
const (
	ApplicationSourceGit      ApplicationSource = "Git"
	ApplicationSourceGithub   ApplicationSource = "GitHub"
	ApplicationSourceTemplate ApplicationSource = "Template"
)

type ApplicationStatus

type ApplicationStatus string

type ApplicationType

type ApplicationType string
const (
	ApplicationTypeStateless  ApplicationType = "Stateless"
	ApplicationTypeStateful   ApplicationType = "Stateful"
	ApplicationTypePostgresHA ApplicationType = "PostgresHA"
)

type AuthProvider

type AuthProvider string
const (
	AuthProviderPassword AuthProvider = "password"
	AuthProviderGithub   AuthProvider = "github"
	AuthProviderGitlab   AuthProvider = "gitlab"
	AuthProviderGoogle   AuthProvider = "google"
)

func ProviderFromString

func ProviderFromString(s string) AuthProvider

type BuilderType

type BuilderType string

BuilderType represents the type of the Builder.

const (
	BuilderTypeDockerfile BuilderType = "Dockerfile"

	BuilderTypeNixpacks BuilderType = "Nixpacks"

	BuilderTypeStatic BuilderType = "Static"
)

type DNSProvider

type DNSProvider string
const (
	DNSProviderNone       DNSProvider = "none"
	DNSProviderCloudflare DNSProvider = "cloudflare"
)

func DNSProviderFromString

func DNSProviderFromString(s string) DNSProvider

type DeploymentStatus

type DeploymentStatus string

func (DeploymentStatus) ToApplicationDeploymentStatus

func (s DeploymentStatus) ToApplicationDeploymentStatus() ApplicationDeploymentStatus

type EnvironmentAttr

type EnvironmentAttr int

EnvironmentAttr defines project attibutes that can be used for sorting and filtering.

const (
	EnvironmentAttrNone EnvironmentAttr = iota
	EnvironmentAttrUID
	EnvironmentAttrCreated
	EnvironmentAttrUpdated
	EnvironmentAttrDeleted
)

Order enumeration.

func ParseEnvironmentAttr

func ParseEnvironmentAttr(s string) EnvironmentAttr

ParseEnvironmentAttr parses the space attribute string and returns the equivalent enumeration.

func (EnvironmentAttr) String

func (a EnvironmentAttr) String() string

String returns the string representation of the attribute.

type GitProvider

type GitProvider string
const (
	GitHubProvider GitProvider = "GITHUB"

	GitLabProvider GitProvider = "GITLAB"
)

type JobPriority

type JobPriority int

JobPriority represents priority of a background job.

const (
	JobPriorityNormal   JobPriority = 0
	JobPriorityElevated JobPriority = 1
)

JobPriority enumeration.

type JobState

type JobState string

JobState represents state of a background job.

const (
	JobStateScheduled JobState = "scheduled"
	JobStateRunning   JobState = "running"
	JobStateFinished  JobState = "finished"
	JobStateFailed    JobState = "failed"
	JobStateCanceled  JobState = "canceled"
)

JobState enumeration.

func (JobState) Enum

func (JobState) Enum() []interface{}

func (JobState) IsCompleted

func (s JobState) IsCompleted() bool

func (JobState) Sanitize

func (s JobState) Sanitize() (JobState, bool)

type Order

type Order int

Order defines the sort order.

const (
	OrderDefault Order = iota
	OrderAsc
	OrderDesc
)

Order enumeration.

func ParseOrder

func ParseOrder(s string) Order

ParseOrder parses the order string and returns an order enumeration.

func (Order) String

func (e Order) String() string

String returns the Order as a string.

type Permission

type Permission string

Permission represents the different types of permissions a principal can have.

const (
	/*
	   ----- SPACE -----
	*/
	PermissionSpaceView   Permission = "space_view"
	PermissionSpaceEdit   Permission = "space_edit"
	PermissionSpaceDelete Permission = "space_delete"
)
const (
	/*
		----- REPOSITORY -----
	*/
	PermissionRepoView              Permission = "repo_view"
	PermissionRepoEdit              Permission = "repo_edit"
	PermissionRepoDelete            Permission = "repo_delete"
	PermissionRepoPush              Permission = "repo_push"
	PermissionRepoReview            Permission = "repo_review"
	PermissionRepoReportCommitCheck Permission = "repo_reportCommitCheck"
)
const (
	/*
		----- USER -----
	*/
	PermissionUserView      Permission = "user_view"
	PermissionUserEdit      Permission = "user_edit"
	PermissionUserDelete    Permission = "user_delete"
	PermissionUserEditAdmin Permission = "user_editAdmin"
)
const (
	/*
		----- SERVICE ACCOUNT -----
	*/
	PermissionServiceAccountView   Permission = "serviceaccount_view"
	PermissionServiceAccountEdit   Permission = "serviceaccount_edit"
	PermissionServiceAccountDelete Permission = "serviceaccount_delete"
)
const (
	/*
		----- SERVICE -----
	*/
	PermissionServiceView      Permission = "service_view"
	PermissionServiceEdit      Permission = "service_edit"
	PermissionServiceDelete    Permission = "service_delete"
	PermissionServiceEditAdmin Permission = "service_editAdmin"
)
const (
	/*
		----- PIPELINE -----
	*/
	PermissionPipelineView    Permission = "pipeline_view"
	PermissionPipelineEdit    Permission = "pipeline_edit"
	PermissionPipelineDelete  Permission = "pipeline_delete"
	PermissionPipelineExecute Permission = "pipeline_execute"
)
const (
	/*
		----- SECRET -----
	*/
	PermissionSecretView   Permission = "secret_view"
	PermissionSecretEdit   Permission = "secret_edit"
	PermissionSecretDelete Permission = "secret_delete"
	PermissionSecretAccess Permission = "secret_access"
)
const (
	/*
		----- CONNECTOR -----
	*/
	PermissionConnectorView   Permission = "connector_view"
	PermissionConnectorEdit   Permission = "connector_edit"
	PermissionConnectorDelete Permission = "connector_delete"
	PermissionConnectorAccess Permission = "connector_access"
)
const (
	/*
		----- TEMPLATE -----
	*/
	PermissionTemplateView   Permission = "template_view"
	PermissionTemplateEdit   Permission = "template_edit"
	PermissionTemplateDelete Permission = "template_delete"
	PermissionTemplateAccess Permission = "template_access"
)

type PrincipalType

type PrincipalType string

PrincipalType defines the supported types of principals.

const (
	// PrincipalTypeUser represents a user.
	PrincipalTypeUser PrincipalType = "user"
	// PrincipalTypeServiceAccount represents a service account.
	PrincipalTypeServiceAccount PrincipalType = "serviceaccount"
	// PrincipalTypeService represents a service.
	PrincipalTypeService PrincipalType = "service"
)

func (PrincipalType) Enum

func (PrincipalType) Enum() []interface{}

func (PrincipalType) Sanitize

func (s PrincipalType) Sanitize() (PrincipalType, bool)

type ProjectAttr

type ProjectAttr int

ProjectAttr defines project attibutes that can be used for sorting and filtering.

const (
	ProjectAttrNone ProjectAttr = iota
	ProjectAttrUID
	ProjectAttrCreated
	ProjectAttrUpdated
	ProjectAttrDeleted
)

Order enumeration.

func ParseProjectAttr

func ParseProjectAttr(s string) ProjectAttr

ParseProjectAttr parses the space attribute string and returns the equivalent enumeration.

func (ProjectAttr) String

func (a ProjectAttr) String() string

String returns the string representation of the attribute.

type ProjectRole

type ProjectRole string
const (
	ProjectRoleViewer      ProjectRole = "reader"
	ProjectRoleContributor ProjectRole = "contributor"
	ProjectRoleOwner       ProjectRole = "owner"
)

func ProjectRoleFromString

func ProjectRoleFromString(s string) ProjectRole

type ResourceType

type ResourceType string

ResourceType represents the different types of resources that can be guarded with permissions.

const (
	ResourceTypeSpace          ResourceType = "SPACE"
	ResourceTypeRepo           ResourceType = "REPOSITORY"
	ResourceTypeUser           ResourceType = "USER"
	ResourceTypeServiceAccount ResourceType = "SERVICEACCOUNT"
	ResourceTypeService        ResourceType = "SERVICE"
	ResourceTypePipeline       ResourceType = "PIPELINE"
	ResourceTypeSecret         ResourceType = "SECRET"
	ResourceTypeConnector      ResourceType = "CONNECTOR"
	ResourceTypeTemplate       ResourceType = "TEMPLATE"
)

type RestartPolicyType

type RestartPolicyType string
const (
	RestartPolicyTypeOnFailure RestartPolicyType = "ON_FAILURE"

	RestartPolicyTypeAlways RestartPolicyType = "ALWAYS"

	RestartPolicyTypeNever RestartPolicyType = "NEVER"
)

type SSEType

type SSEType string
const (
	SSETypeApplicationUpdated SSEType = "application_updated"
	SSETypeDeploymentUpdated  SSEType = "deployment_updated"
)

type ServerType

type ServerType string
const (
	ServerTypeK8s    ServerType = "k8s"
	ServerTypeDocker ServerType = "docker"
)

type TenantAttr

type TenantAttr int

TenantAttr defines tenant attibutes that can be used for sorting and filtering.

const (
	TenantAttrNone TenantAttr = iota
	TenantAttrUID
	TenantAttrCreated
	TenantAttrUpdated
	TenantAttrDeleted
)

Order enumeration.

func ParseTenantAttr

func ParseTenantAttr(s string) TenantAttr

ParseTenantAttr parses the space attribute string and returns the equivalent enumeration.

func (TenantAttr) String

func (a TenantAttr) String() string

String returns the string representation of the attribute.

type TenantRole

type TenantRole string
const (
	TenantRoleAdmin  TenantRole = "admin"
	TenantRoleMember TenantRole = "member"
)

func TenantRoleFromString

func TenantRoleFromString(s string) TenantRole

type TokenType

type TokenType string

TokenType represents the type of the JWT token.

const (
	// TokenTypeSession is the token returned during user login or signup.
	TokenTypeSession TokenType = "session"

	// TokenTypePAT is a personal access token.
	TokenTypePAT TokenType = "pat"

	// TokenTypeSAT is a service account access token.
	TokenTypeSAT TokenType = "sat"
)

type TriggerAction

type TriggerAction string
const (
	TriggerActionCreate TriggerAction = "Created"
	TriggerActionManual TriggerAction = "Manual"
	TriggerActionHook   TriggerAction = "Hook"
)

type VariableType

type VariableType string
const (
	// VariableTypeBuild represents a build variable
	VariableTypeBuild VariableType = "build"

	// VariableTypeRun represents a run variable
	VariableTypeRun VariableType = "run"

	// VariableTypeBuildAndRun represents a build and run variable
	VariableTypeBuildAndRun VariableType = "build_run"
)

type VolumeAttr

type VolumeAttr int

VolumeAttr defines volume attributes that can be used for sorting and filtering.

const (
	VolumeAttrNone VolumeAttr = iota
	VolumeAttrCreated
	VolumeAttrUpdated
	VolumeAttrDeleted
)

VolumeAttr enumeration.

func ParseVolumeAttr

func ParseVolumeAttr(s string) VolumeAttr

ParseVolumeAttr parses the volume attribute string and returns the equivalent enumeration.

func (VolumeAttr) String

func (a VolumeAttr) String() string

String returns the string representation of the attribute.

type VolumeFormAction

type VolumeFormAction string
const (
	VolumeFormActionCreate VolumeFormAction = "create"
	VolumeFormActionUpdate VolumeFormAction = "update"
	VolumeFormActionDelete VolumeFormAction = "delete"
	VolumeFormActionAttach VolumeFormAction = "attach"
)

Jump to

Keyboard shortcuts

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