enum

package
v1.0.4-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Status types for CI.

Index

Constants

View Source
const (
	PullReqSortNumber  = "number"
	PullReqSortCreated = "created"
	PullReqSortEdited  = "edited"
	PullReqSortMerged  = "merged"
	PullReqSortUpdated = "updated"
)

PullReqSort enumeration.

View Source
const (
	MergeMethodMerge  = MergeMethod(gitenum.MergeMethodMerge)
	MergeMethodSquash = MergeMethod(gitenum.MergeMethodSquash)
	MergeMethodRebase = MergeMethod(gitenum.MergeMethodRebase)
)

MergeMethod enumeration.

View Source
const (
	TriggerHook = "@hook"
	TriggerCron = "@cron"
)

Trigger types.

View Source
const (
	TriggerEventCron        = "cron"
	TriggerEventManual      = "manual"
	TriggerEventPush        = "push"
	TriggerEventPullRequest = "pull_request"
	TriggerEventTag         = "tag"
)

Hook event constants.

Variables

View Source
var LabelTypes = sortEnum([]LabelType{
	LabelTypeStatic,
	LabelTypeDynamic,
})

Functions

func GetAllCheckPayloadTypes

func GetAllCheckPayloadTypes() ([]CheckPayloadKind, CheckPayloadKind)

func GetAllCheckStatuses

func GetAllCheckStatuses() ([]CheckStatus, CheckStatus)

func GetAllJobStates

func GetAllJobStates() ([]JobState, JobState)

func GetAllLabelColors

func GetAllLabelColors() ([]LabelColor, LabelColor)

func GetAllLabelTypes

func GetAllLabelTypes() ([]LabelType, LabelType)

func GetAllMembershipRoles

func GetAllMembershipRoles() ([]MembershipRole, MembershipRole)

func GetAllMembershipSpaceSorts

func GetAllMembershipSpaceSorts() ([]MembershipSpaceSort, MembershipSpaceSort)

func GetAllMembershipUserSorts

func GetAllMembershipUserSorts() ([]MembershipUserSort, MembershipUserSort)

func GetAllPrincipalTypes

func GetAllPrincipalTypes() ([]PrincipalType, PrincipalType)

func GetAllPublicKeySorts

func GetAllPublicKeySorts() ([]PublicKeySort, PublicKeySort)

func GetAllPublicKeyUsages

func GetAllPublicKeyUsages() ([]PublicKeyUsage, PublicKeyUsage)

func GetAllPullReqActivityKinds

func GetAllPullReqActivityKinds() ([]PullReqActivityKind, PullReqActivityKind)

func GetAllPullReqActivityTypes

func GetAllPullReqActivityTypes() ([]PullReqActivityType, PullReqActivityType)

func GetAllPullReqCommentStatuses

func GetAllPullReqCommentStatuses() ([]PullReqCommentStatus, PullReqCommentStatus)

func GetAllPullReqReviewDecisions

func GetAllPullReqReviewDecisions() ([]PullReqReviewDecision, PullReqReviewDecision)

func GetAllPullReqReviewerTypes

func GetAllPullReqReviewerTypes() ([]PullReqReviewerType, PullReqReviewerType)

func GetAllPullReqSorts

func GetAllPullReqSorts() ([]PullReqSort, PullReqSort)

func GetAllPullReqStates

func GetAllPullReqStates() ([]PullReqState, PullReqState)

func GetAllRuleSorts

func GetAllRuleSorts() ([]RuleSort, RuleSort)

func GetAllRuleStates

func GetAllRuleStates() ([]RuleState, RuleState)

func GetAllTriggerActions

func GetAllTriggerActions() ([]TriggerAction, TriggerAction)

func GetAllWebhookTriggers

func GetAllWebhookTriggers() ([]WebhookTrigger, WebhookTrigger)

func Sanitize

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

Types

type BranchSortOption

type BranchSortOption int

BranchSortOption specifies the available sort options for branches.

const (
	BranchSortOptionDefault BranchSortOption = iota
	BranchSortOptionName
	BranchSortOptionDate
)

func ParseBranchSortOption

func ParseBranchSortOption(s string) BranchSortOption

ParseBranchSortOption parses the branch sort option string and returns the equivalent enumeration.

func (BranchSortOption) String

func (o BranchSortOption) String() string

String returns a string representation of the branch sort option.

type CIStatus

type CIStatus string

CIStatus defines the different kinds of CI statuses for stages, steps and executions.

const (
	CIStatusSkipped       CIStatus = "skipped"
	CIStatusBlocked       CIStatus = "blocked"
	CIStatusDeclined      CIStatus = "declined"
	CIStatusWaitingOnDeps CIStatus = "waiting_on_dependencies"
	CIStatusPending       CIStatus = "pending"
	CIStatusRunning       CIStatus = "running"
	CIStatusSuccess       CIStatus = "success"
	CIStatusFailure       CIStatus = "failure"
	CIStatusKilled        CIStatus = "killed"
	CIStatusError         CIStatus = "error"
)

func ParseCIStatus

func ParseCIStatus(status string) CIStatus

ParseCIStatus converts the status from a string to typed enum. If the match is not exact, will just return default error status instead of explicitly returning not found error.

func (CIStatus) ConvertToCheckStatus

func (status CIStatus) ConvertToCheckStatus() CheckStatus

func (CIStatus) IsDone

func (status CIStatus) IsDone() bool

IsDone returns true if in a completed state.

func (CIStatus) IsFailed

func (status CIStatus) IsFailed() bool

IsFailed returns true if in a failed state.

type CheckPayloadKind

type CheckPayloadKind string

CheckPayloadKind defines status payload type.

const (
	CheckPayloadKindEmpty    CheckPayloadKind = ""
	CheckPayloadKindRaw      CheckPayloadKind = "raw"
	CheckPayloadKindMarkdown CheckPayloadKind = "markdown"
	CheckPayloadKindPipeline CheckPayloadKind = "pipeline"
)

CheckPayloadKind enumeration.

func (CheckPayloadKind) Enum

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

func (CheckPayloadKind) Sanitize

func (s CheckPayloadKind) Sanitize() (CheckPayloadKind, bool)

type CheckStatus

type CheckStatus string

CheckStatus defines status check status.

const (
	CheckStatusPending CheckStatus = "pending"
	CheckStatusRunning CheckStatus = "running"
	CheckStatusSuccess CheckStatus = "success"
	CheckStatusFailure CheckStatus = "failure"
	CheckStatusError   CheckStatus = "error"
)

CheckStatus enumeration.

func (CheckStatus) Enum

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

func (CheckStatus) IsCompleted

func (s CheckStatus) IsCompleted() bool

func (CheckStatus) Sanitize

func (s CheckStatus) Sanitize() (CheckStatus, bool)

type CodeOwnerViolationCode

type CodeOwnerViolationCode string
const (
	// CodeOwnerViolationCodeUserNotFound occurs when user in codeowners file is not present.
	CodeOwnerViolationCodeUserNotFound CodeOwnerViolationCode = "user_not_found"
	// CodeOwnerViolationCodePatternInvalid occurs when a pattern in codeowners file is incorrect.
	CodeOwnerViolationCodePatternInvalid CodeOwnerViolationCode = "pattern_invalid"
	// CodeOwnerViolationCodePatternEmpty occurs when a pattern in codeowners file is empty.
	CodeOwnerViolationCodePatternEmpty CodeOwnerViolationCode = "pattern_empty"
)

func (CodeOwnerViolationCode) Enum

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

type ContentEncodingType

type ContentEncodingType string

ContentEncodingType describes the encoding of content.

const (
	// ContentEncodingTypeUTF8 describes utf-8 encoded content.
	ContentEncodingTypeUTF8 ContentEncodingType = "utf8"

	// ContentEncodingTypeBase64 describes base64 encoded content.
	ContentEncodingTypeBase64 ContentEncodingType = "base64"
)

func (ContentEncodingType) Enum

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

type GitServiceType

type GitServiceType string

GitServiceType represents the different types of service values send by git's smart http protocol. See https://git-scm.com/docs/http-protocol#_smart_clients for more details.

const (
	// GitServiceTypeReceivePack is sent by git push operations (server "receives" data from client).
	GitServiceTypeReceivePack GitServiceType = "receive-pack"
	// GitServiceTypeUploadPack is sent by git pull operations (server "uploads" data to client).
	GitServiceTypeUploadPack GitServiceType = "upload-pack"
)

func ParseGitServiceType

func ParseGitServiceType(s string) (GitServiceType, error)

ParseGitServiceType parses the git service type string and returns the equivalent enumeration. If the value is unknown and doesn't represent a git service type, an error is returned.

type GitspaceAccessType

type GitspaceAccessType string
const (
	GitspaceAccessTypeJWTToken        GitspaceAccessType = "jwt_token"
	GitspaceAccessTypeUserCredentials GitspaceAccessType = "user_credentials"
	GitspaceAccessTypeSSHKey          GitspaceAccessType = "ssh_key"
)

func (GitspaceAccessType) Enum

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

type GitspaceActionType

type GitspaceActionType string
const (
	GitspaceActionTypeStart GitspaceActionType = "start"
	GitspaceActionTypeStop  GitspaceActionType = "stop"
)

func (GitspaceActionType) Enum

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

type GitspaceCodeRepoType

type GitspaceCodeRepoType string
const (
	CodeRepoTypeGithub      GitspaceCodeRepoType = "github"
	CodeRepoTypeGitlab      GitspaceCodeRepoType = "gitlab"
	CodeRepoTypeGitness     GitspaceCodeRepoType = "gitness"
	CodeRepoTypeHarnessCode GitspaceCodeRepoType = "harness_code"
	CodeRepoTypeBitbucket   GitspaceCodeRepoType = "bitbucket"
	CodeRepoTypeUnknown     GitspaceCodeRepoType = "unknown"
)

func (GitspaceCodeRepoType) Enum

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

type GitspaceEntityType

type GitspaceEntityType string
const (
	GitspaceEntityTypeGitspaceConfig   GitspaceEntityType = "gitspace_config"
	GitspaceEntityTypeGitspaceInstance GitspaceEntityType = "gitspace_instance"
)

func (GitspaceEntityType) Enum

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

type GitspaceEventType

type GitspaceEventType string
const (
	// Start action events.
	GitspaceEventTypeGitspaceActionStart          GitspaceEventType = "gitspace_action_start"
	GitspaceEventTypeGitspaceActionStartCompleted GitspaceEventType = "gitspace_action_start_completed"
	GitspaceEventTypeGitspaceActionStartFailed    GitspaceEventType = "gitspace_action_start_failed"

	// Stop action events.
	GitspaceEventTypeGitspaceActionStop          GitspaceEventType = "gitspace_action_stop"
	GitspaceEventTypeGitspaceActionStopCompleted GitspaceEventType = "gitspace_action_stop_completed"
	GitspaceEventTypeGitspaceActionStopFailed    GitspaceEventType = "gitspace_action_stop_failed"

	// Fetch devcontainer config events.
	GitspaceEventTypeFetchDevcontainerStart     GitspaceEventType = "fetch_devcontainer_start"
	GitspaceEventTypeFetchDevcontainerCompleted GitspaceEventType = "fetch_devcontainer_completed"
	GitspaceEventTypeFetchDevcontainerFailed    GitspaceEventType = "fetch_devcontainer_failed"

	// Infra provisioning events.
	GitspaceEventTypeInfraProvisioningStart     GitspaceEventType = "infra_provisioning_start"
	GitspaceEventTypeInfraProvisioningCompleted GitspaceEventType = "infra_provisioning_completed"
	GitspaceEventTypeInfraProvisioningFailed    GitspaceEventType = "infra_provisioning_failed"

	// Infra stop events.
	GitspaceEventTypeInfraStopStart     GitspaceEventType = "infra_stop_start"
	GitspaceEventTypeInfraStopCompleted GitspaceEventType = "infra_stop_completed"
	GitspaceEventTypeInfraStopFailed    GitspaceEventType = "infra_stop_failed"

	// Infra deprovisioning events.
	GitspaceEventTypeInfraDeprovisioningStart     GitspaceEventType = "infra_deprovisioning_start"
	GitspaceEventTypeInfraDeprovisioningCompleted GitspaceEventType = "infra_deprovisioning_completed"
	GitspaceEventTypeInfraDeprovisioningFailed    GitspaceEventType = "infra_deprovisioning_failed"

	// Agent connection events.
	GitspaceEventTypeAgentConnectStart     GitspaceEventType = "agent_connect_start"
	GitspaceEventTypeAgentConnectCompleted GitspaceEventType = "agent_connect_completed"
	GitspaceEventTypeAgentConnectFailed    GitspaceEventType = "agent_connect_failed"

	// Gitspace creation events.
	GitspaceEventTypeAgentGitspaceCreationStart     GitspaceEventType = "agent_gitspace_creation_start"
	GitspaceEventTypeAgentGitspaceCreationCompleted GitspaceEventType = "agent_gitspace_creation_completed"
	GitspaceEventTypeAgentGitspaceCreationFailed    GitspaceEventType = "agent_gitspace_creation_failed"

	// Gitspace stop events.
	GitspaceEventTypeAgentGitspaceStopStart     GitspaceEventType = "agent_gitspace_stop_start"
	GitspaceEventTypeAgentGitspaceStopCompleted GitspaceEventType = "agent_gitspace_stop_completed"
	GitspaceEventTypeAgentGitspaceStopFailed    GitspaceEventType = "agent_gitspace_stop_failed"

	// Gitspace deletion events.
	GitspaceEventTypeAgentGitspaceDeletionStart     GitspaceEventType = "agent_gitspace_deletion_start"
	GitspaceEventTypeAgentGitspaceDeletionCompleted GitspaceEventType = "agent_gitspace_deletion_completed"
	GitspaceEventTypeAgentGitspaceDeletionFailed    GitspaceEventType = "agent_gitspace_deletion_failed"

	// Gitspace state events.
	GitspaceEventTypeAgentGitspaceStateReportRunning GitspaceEventType = "agent_gitspace_state_report_running"
	GitspaceEventTypeAgentGitspaceStateReportError   GitspaceEventType = "agent_gitspace_state_report_error"
	GitspaceEventTypeAgentGitspaceStateReportStopped GitspaceEventType = "agent_gitspace_state_report_stopped"
	GitspaceEventTypeAgentGitspaceStateReportUnknown GitspaceEventType = "agent_gitspace_state_report_unknown"
)

func (GitspaceEventType) Enum

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

type GitspaceInstanceStateType

type GitspaceInstanceStateType string
const (
	GitspaceInstanceStateRunning       GitspaceInstanceStateType = "running"
	GitspaceInstanceStateUninitialized GitspaceInstanceStateType = "uninitialized"
	GitspaceInstanceStateUnknown       GitspaceInstanceStateType = "unknown"
	GitspaceInstanceStateError         GitspaceInstanceStateType = "error"
	GitspaceInstanceStateDeleted       GitspaceInstanceStateType = "deleted"

	GitspaceInstanceStateStarting GitspaceInstanceStateType = "starting"
	GitspaceInstanceStateStopping GitspaceInstanceStateType = "stopping"
)

func (GitspaceInstanceStateType) Enum

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

func (GitspaceInstanceStateType) IsBusyStatus

func (g GitspaceInstanceStateType) IsBusyStatus() bool

func (GitspaceInstanceStateType) IsFinalStatus

func (g GitspaceInstanceStateType) IsFinalStatus() bool

type GitspaceStateType

type GitspaceStateType string
const (
	GitspaceStateRunning       GitspaceStateType = "running"
	GitspaceStateStopped       GitspaceStateType = "stopped"
	GitspaceStateStarting      GitspaceStateType = "starting"
	GitspaceStateStopping      GitspaceStateType = "stopping"
	GitspaceStateError         GitspaceStateType = "error"
	GitspaceStateUninitialized GitspaceStateType = "uninitialized"
)

func GetGitspaceStateFromInstance

func GetGitspaceStateFromInstance(
	instanceState GitspaceInstanceStateType,
) (GitspaceStateType, error)

func (GitspaceStateType) Enum

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

type IDEType

type IDEType string
const (
	IDETypeVSCode    IDEType = "vs_code"
	IDETypeVSCodeWeb IDEType = "vs_code_web"
)

func (IDEType) Enum

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

type InfraEvent

type InfraEvent string
const (
	InfraEventProvision   InfraEvent = "provision"
	InfraEventStop        InfraEvent = "stop"
	InfraEventDeprovision InfraEvent = "deprovision"
)

func (InfraEvent) Enum

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

type InfraProviderType

type InfraProviderType string
const (
	InfraProviderTypeDocker     InfraProviderType = "docker"
	InfraProviderTypeHarnessGCP InfraProviderType = "harness_gcp"
)

func (InfraProviderType) Enum

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

type InfraProvisioningType

type InfraProvisioningType string
const (
	InfraProvisioningTypeExisting InfraProvisioningType = "existing"
	InfraProvisioningTypeNew      InfraProvisioningType = "new"
)

func (InfraProvisioningType) Enum

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

type InfraStatus

type InfraStatus string
const (
	InfraStatusPending          InfraStatus = "pending"
	InfraStatusProvisioned      InfraStatus = "provisioned"
	InfraStatusDestroyed        InfraStatus = "destroyed"
	InfraStatusMarkedForDestroy InfraStatus = "marked_for_destroy"
	InfraStatusUnknown          InfraStatus = "unknown"
	InfraStatusSuspended        InfraStatus = "suspended"
)

func (InfraStatus) Enum

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

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 LabelColor

type LabelColor string
const (
	LabelColorBackground LabelColor = "background"
	LabelColorStroke     LabelColor = "stroke"
	LabelColorText       LabelColor = "text"
	LabelColorAccent     LabelColor = "accent"
	LabelColorRed        LabelColor = "red"
	LabelColorGreen      LabelColor = "green"
	LabelColorYellow     LabelColor = "yellow"
	LabelColorBlue       LabelColor = "blue"
	LabelColorPink       LabelColor = "pink"
	LabelColorPurple     LabelColor = "purple"
	LabelColorViolet     LabelColor = "violet"
	LabelColorIndigo     LabelColor = "indigo"
	LabelColorCyan       LabelColor = "cyan"
	LabelColorOrange     LabelColor = "orange"
	LabelColorBrown      LabelColor = "brown"
	LabelColorMint       LabelColor = "mint"
	LabelColorLime       LabelColor = "lime"
)

func (LabelColor) Enum

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

func (LabelColor) Sanitize

func (t LabelColor) Sanitize() (LabelColor, bool)

type LabelType

type LabelType string
const (
	LabelTypeStatic  LabelType = "static"
	LabelTypeDynamic LabelType = "dynamic"
)

func (LabelType) Enum

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

func (LabelType) Sanitize

func (t LabelType) Sanitize() (LabelType, bool)

type MembershipRole

type MembershipRole string

MembershipRole represents the different level of space memberships (permission set).

const (
	MembershipRoleReader      MembershipRole = "reader"
	MembershipRoleExecutor    MembershipRole = "executor"
	MembershipRoleContributor MembershipRole = "contributor"
	MembershipRoleSpaceOwner  MembershipRole = "space_owner"
)

func (MembershipRole) Enum

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

func (MembershipRole) Permissions

func (m MembershipRole) Permissions() []Permission

Permissions returns the list of permissions for the role.

func (MembershipRole) Sanitize

func (m MembershipRole) Sanitize() (MembershipRole, bool)

type MembershipSpaceSort

type MembershipSpaceSort string

MembershipSpaceSort represents membership space sort order.

const (
	// TODO [CODE-1363]: remove after identifier migration.
	MembershipSpaceSortUID        MembershipSpaceSort = uid
	MembershipSpaceSortIdentifier MembershipSpaceSort = identifier
	MembershipSpaceSortCreated    MembershipSpaceSort = created
)

MembershipSpaceSort enumeration.

func ParseMembershipSpaceSort

func ParseMembershipSpaceSort(s string) MembershipSpaceSort

ParseMembershipSpaceSort parses the membership space sort attribute string and returns the equivalent enumeration.

func (MembershipSpaceSort) Enum

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

func (MembershipSpaceSort) Sanitize

func (MembershipSpaceSort) String

func (s MembershipSpaceSort) String() string

String returns the string representation of the attribute.

type MembershipUserSort

type MembershipUserSort string

MembershipUserSort represents membership user sort order.

const (
	MembershipUserSortName    MembershipUserSort = name
	MembershipUserSortCreated MembershipUserSort = created
)

MembershipUserSort enumeration.

func ParseMembershipUserSort

func ParseMembershipUserSort(s string) MembershipUserSort

ParseMembershipUserSort parses the membership user sort attribute string and returns the equivalent enumeration.

func (MembershipUserSort) Enum

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

func (MembershipUserSort) Sanitize

func (s MembershipUserSort) Sanitize() (MembershipUserSort, bool)

func (MembershipUserSort) String

func (s MembershipUserSort) String() string

String returns the string representation of the attribute.

type MergeCheckStatus

type MergeCheckStatus string
const (
	// MergeCheckStatusUnchecked merge status has not been checked.
	MergeCheckStatusUnchecked MergeCheckStatus = "unchecked"
	// MergeCheckStatusConflict can’t merge into the target branch due to a potential conflict.
	MergeCheckStatusConflict MergeCheckStatus = "conflict"
	// MergeCheckStatusMergeable branch can merged cleanly into the target branch.
	MergeCheckStatusMergeable MergeCheckStatus = "mergeable"
)

type MergeMethod

type MergeMethod gitenum.MergeMethod

func (MergeMethod) Enum

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

func (MergeMethod) Sanitize

func (m MergeMethod) Sanitize() (MergeMethod, 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 ParentResourceType

type ParentResourceType string

ParentResourceType defines the different types of parent resources.

var (
	ParentResourceTypeSpace ParentResourceType = "space"
	ParentResourceTypeRepo  ParentResourceType = "repo"
)

func GetAllParentResourceTypes

func GetAllParentResourceTypes() []ParentResourceType

func (ParentResourceType) Enum

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

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"
)
const (
	/*
		----- GITSPACE -----
	*/
	PermissionGitspaceView   Permission = "gitspace_view"
	PermissionGitspaceEdit   Permission = "gitspace_edit"
	PermissionGitspaceDelete Permission = "gitspace_delete"
	PermissionGitspaceAccess Permission = "gitspace_access"
)
const (
	/*
		----- INFRAPROVIDER -----
	*/
	PermissionInfraProviderView   Permission = "infraprovider_view"
	PermissionInfraProviderEdit   Permission = "infraprovider_edit"
	PermissionInfraProviderDelete Permission = "infraprovider_delete"
	PermissionInfraProviderAccess Permission = "infraprovider_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 PublicKeySort

type PublicKeySort string

PublicKeySort is used to specify sorting of public keys.

const (
	PublicKeySortCreated    PublicKeySort = "created"
	PublicKeySortIdentifier PublicKeySort = "identifier"
)

PublicKeySort enumeration.

func (PublicKeySort) Enum

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

func (PublicKeySort) Sanitize

func (s PublicKeySort) Sanitize() (PublicKeySort, bool)

type PublicKeyUsage

type PublicKeyUsage string

PublicKeyUsage represents usage type of public key.

const (
	PublicKeyUsageAuth PublicKeyUsage = "auth"
	PublicKeyUsageSign PublicKeyUsage = "sign"
)

PublicKeyUsage enumeration.

func (PublicKeyUsage) Enum

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

func (PublicKeyUsage) Sanitize

func (s PublicKeyUsage) Sanitize() (PublicKeyUsage, bool)

type PublicResourceType

type PublicResourceType string

PublicResourceType defines the type of the public resource.

const (
	PublicResourceTypeRepo  PublicResourceType = "repository"
	PublicResourceTypeSpace PublicResourceType = "space"
)

func GetAllPublicResourceTypes

func GetAllPublicResourceTypes() []PublicResourceType

func (PublicResourceType) Enum

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

type PullReqActivityKind

type PullReqActivityKind string

PullReqActivityKind defines kind of pull request activity system message. Kind defines the source of the pull request activity entry: Whether it's generated by the system, it's a user comment or a part of code review.

const (
	PullReqActivityKindSystem        PullReqActivityKind = "system"
	PullReqActivityKindComment       PullReqActivityKind = "comment"
	PullReqActivityKindChangeComment PullReqActivityKind = "change-comment"
)

PullReqActivityKind enumeration.

func (PullReqActivityKind) Enum

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

func (PullReqActivityKind) Sanitize

type PullReqActivityType

type PullReqActivityType string

PullReqActivityType defines pull request activity message type. Essentially, the Type determines the structure of the pull request activity's Payload structure.

const (
	PullReqActivityTypeComment        PullReqActivityType = "comment"
	PullReqActivityTypeCodeComment    PullReqActivityType = "code-comment"
	PullReqActivityTypeTitleChange    PullReqActivityType = "title-change"
	PullReqActivityTypeStateChange    PullReqActivityType = "state-change"
	PullReqActivityTypeReviewSubmit   PullReqActivityType = "review-submit"
	PullReqActivityTypeReviewerDelete PullReqActivityType = "reviewer-delete"
	PullReqActivityTypeBranchUpdate   PullReqActivityType = "branch-update"
	PullReqActivityTypeBranchDelete   PullReqActivityType = "branch-delete"
	PullReqActivityTypeMerge          PullReqActivityType = "merge"
	PullReqActivityTypeLabelModify    PullReqActivityType = "label-modify"
)

PullReqActivityType enumeration.

func (PullReqActivityType) Enum

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

func (PullReqActivityType) Sanitize

type PullReqCommentStatus

type PullReqCommentStatus string

PullReqCommentStatus defines status of a pull request comment.

const (
	PullReqCommentStatusActive   PullReqCommentStatus = "active"
	PullReqCommentStatusResolved PullReqCommentStatus = "resolved"
)

PullReqCommentStatus enumeration.

func (PullReqCommentStatus) Enum

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

func (PullReqCommentStatus) Sanitize

type PullReqLabelActivityType

type PullReqLabelActivityType string
const (
	LabelActivityAssign   PullReqLabelActivityType = "assign"
	LabelActivityUnassign PullReqLabelActivityType = "unassign"
	LabelActivityReassign PullReqLabelActivityType = "reassign"
	LabelActivityNoop     PullReqLabelActivityType = "noop"
)

func (PullReqLabelActivityType) Enum

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

func (PullReqLabelActivityType) Sanitize

type PullReqReviewDecision

type PullReqReviewDecision string

PullReqReviewDecision defines state of a pull request review.

const (
	PullReqReviewDecisionPending   PullReqReviewDecision = "pending"
	PullReqReviewDecisionReviewed  PullReqReviewDecision = "reviewed"
	PullReqReviewDecisionApproved  PullReqReviewDecision = "approved"
	PullReqReviewDecisionChangeReq PullReqReviewDecision = "changereq"
)

PullReqReviewDecision enumeration.

func (PullReqReviewDecision) Enum

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

func (PullReqReviewDecision) Sanitize

func (decision PullReqReviewDecision) Sanitize() (PullReqReviewDecision, bool)

type PullReqReviewerType

type PullReqReviewerType string

PullReqReviewerType defines type of a pull request reviewer.

const (
	PullReqReviewerTypeRequested    PullReqReviewerType = "requested"
	PullReqReviewerTypeAssigned     PullReqReviewerType = "assigned"
	PullReqReviewerTypeSelfAssigned PullReqReviewerType = "self_assigned"
)

PullReqReviewerType enumeration.

func (PullReqReviewerType) Enum

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

func (PullReqReviewerType) Sanitize

func (reviewerType PullReqReviewerType) Sanitize() (PullReqReviewerType, bool)

type PullReqSort

type PullReqSort string

PullReqSort defines pull request attribute that can be used for sorting.

func (PullReqSort) Enum

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

func (PullReqSort) Sanitize

func (s PullReqSort) Sanitize() (PullReqSort, bool)

type PullReqState

type PullReqState string

PullReqState defines pull request state.

const (
	PullReqStateOpen   PullReqState = "open"
	PullReqStateMerged PullReqState = "merged"
	PullReqStateClosed PullReqState = "closed"
)

PullReqState enumeration.

func (PullReqState) Enum

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

func (PullReqState) Sanitize

func (s PullReqState) Sanitize() (PullReqState, bool)

type RepoAttr

type RepoAttr int

RepoAttr defines repo attributes that can be used for sorting and filtering.

const (
	RepoAttrNone RepoAttr = iota
	// TODO [CODE-1363]: remove after identifier migration.
	RepoAttrUID
	RepoAttrIdentifier
	RepoAttrCreated
	RepoAttrUpdated
	RepoAttrDeleted
)

RepoAttr enumeration.

func ParseRepoAttr

func ParseRepoAttr(s string) RepoAttr

ParseRepoAttr parses the repo attribute string and returns the equivalent enumeration.

func (RepoAttr) String

func (a RepoAttr) String() string

String returns the string representation of the attribute.

type RepoState

type RepoState int

RepoState defines repo state.

const (
	RepoStateActive RepoState = iota
	RepoStateGitImport
	RepoStateMigrateGitPush
	RepoStateMigrateDataImport
)

RepoState enumeration.

func (RepoState) String

func (state RepoState) String() string

String returns the string representation of the RepoState.

type ResolverKind

type ResolverKind string

ResolverKind represents the kind of resolver.

const (
	// ResolverKindPlugin is a plugin resolver.
	ResolverKindPlugin ResolverKind = "plugin"

	// ResolverKindTemplate is a template resolver.
	ResolverKindTemplate ResolverKind = "template"
)

func ParseResolverKind

func ParseResolverKind(r string) (ResolverKind, error)

func (ResolverKind) String

func (r ResolverKind) String() string

type ResolverType

type ResolverType string

ResolverType represents the type of resolver.

const (
	// ResolverTypeStep is a step level resolver.
	ResolverTypeStep ResolverType = "step"

	// ResolverTypeStage is a stage level resolver.
	ResolverTypeStage ResolverType = "stage"
)

func ParseResolverType

func ParseResolverType(s string) (ResolverType, error)

func (ResolverType) String

func (t ResolverType) String() string

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"
	ResourceTypeGitspace       ResourceType = "GITSPACE"
	ResourceTypeInfraProvider  ResourceType = "INFRAPROVIDER"
)

type RuleSort

type RuleSort string

RuleSort contains protection rule sorting options.

const (
	// TODO [CODE-1363]: remove after identifier migration.
	RuleSortUID        RuleSort = uid
	RuleSortIdentifier RuleSort = identifier
	RuleSortCreated    RuleSort = createdAt
	RuleSortUpdated    RuleSort = updatedAt
)

func ParseRuleSortAttr

func ParseRuleSortAttr(s string) RuleSort

ParseRuleSortAttr parses the protection rule sorting option.

func (RuleSort) Enum

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

func (RuleSort) Sanitize

func (s RuleSort) Sanitize() (RuleSort, bool)

type RuleState

type RuleState string

RuleState represents rule state.

const (
	RuleStateActive   RuleState = "active"
	RuleStateMonitor  RuleState = "monitor"
	RuleStateDisabled RuleState = "disabled"
)

RuleState enumeration.

func (RuleState) Enum

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

func (RuleState) Sanitize

func (s RuleState) Sanitize() (RuleState, bool)

type SSEType

type SSEType string

SSEType defines the kind of server sent event.

const (
	SSETypeExecutionUpdated   SSEType = "execution_updated"
	SSETypeExecutionRunning   SSEType = "execution_running"
	SSETypeExecutionCompleted SSEType = "execution_completed"
	SSETypeExecutionCanceled  SSEType = "execution_canceled"

	SSETypeRepositoryImportCompleted SSEType = "repository_import_completed"
	SSETypeRepositoryExportCompleted SSEType = "repository_export_completed"

	SSETypePullRequestUpdated SSEType = "pullreq_updated"

	SSETypeLogLineAppended SSEType = "log_line_appended"
)

Enums for event types delivered to the event stream for the UI.

type ScmType

type ScmType string

ScmType defines the different SCM types supported for CI.

const (
	ScmTypeUnknown ScmType = "UNKNOWN"
	ScmTypeGitness ScmType = "GITNESS"
	ScmTypeGithub  ScmType = "GITHUB"
	ScmTypeGitlab  ScmType = "GITLAB"
)

func (ScmType) Enum

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

type SettingsScope

type SettingsScope string

SettingsScope defines the different scopes of a setting.

var (
	// SettingsScopeSpace defines settings stored on a space level.
	SettingsScopeSpace SettingsScope = "space"

	// SettingsScopeRepo defines settings stored on a repo level.
	SettingsScopeRepo SettingsScope = "repo"
)

func GetAllSettingsScopes

func GetAllSettingsScopes() []SettingsScope

func (SettingsScope) Enum

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

type SpaceAttr

type SpaceAttr int

SpaceAttr defines space attributes that can be used for sorting and filtering.

const (
	SpaceAttrNone SpaceAttr = iota
	// TODO [CODE-1363]: remove after identifier migration.
	SpaceAttrUID
	SpaceAttrIdentifier
	SpaceAttrCreated
	SpaceAttrUpdated
	SpaceAttrDeleted
)

Order enumeration.

func ParseSpaceAttr

func ParseSpaceAttr(s string) SpaceAttr

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

func (SpaceAttr) String

func (a SpaceAttr) String() string

String returns the string representation of the attribute.

type TagSortOption

type TagSortOption int

TagSortOption specifies the available sort options for tags.

const (
	TagSortOptionDefault TagSortOption = iota
	TagSortOptionName
	TagSortOptionDate
)

func ParseTagSortOption

func ParseTagSortOption(s string) TagSortOption

ParseTagSortOption parses the tag sort option string and returns the equivalent enumeration.

func (TagSortOption) String

func (o TagSortOption) String() string

String returns a string representation of the tag sort option.

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

TriggerAction defines the different actions on triggers will fire.

const (
	// TriggerActionBranchCreated gets triggered when a branch gets created.
	TriggerActionBranchCreated TriggerAction = "branch_created"
	// TriggerActionBranchUpdated gets triggered when a branch gets updated.
	TriggerActionBranchUpdated TriggerAction = "branch_updated"

	// TriggerActionTagCreated gets triggered when a tag gets created.
	TriggerActionTagCreated TriggerAction = "tag_created"
	// TriggerActionTagUpdated gets triggered when a tag gets updated.
	TriggerActionTagUpdated TriggerAction = "tag_updated"

	// TriggerActionPullReqCreated gets triggered when a pull request gets created.
	TriggerActionPullReqCreated TriggerAction = "pullreq_created"
	// TriggerActionPullReqReopened gets triggered when a pull request gets reopened.
	TriggerActionPullReqReopened TriggerAction = "pullreq_reopened"
	// TriggerActionPullReqBranchUpdated gets triggered when a pull request source branch gets updated.
	TriggerActionPullReqBranchUpdated TriggerAction = "pullreq_branch_updated"
	// TriggerActionPullReqClosed gets triggered when a pull request is closed.
	TriggerActionPullReqClosed = "pullreq_closed"
	// TriggerActionPullReqMerged gets triggered when a pull request is merged.
	TriggerActionPullReqMerged = "pullreq_merged"
)

These are similar to enums defined in webhook enum but can diverge as these are different entities.

func (TriggerAction) Enum

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

func (TriggerAction) GetTriggerEvent

func (t TriggerAction) GetTriggerEvent() TriggerEvent

func (TriggerAction) Sanitize

func (t TriggerAction) Sanitize() (TriggerAction, bool)

type TriggerEvent

type TriggerEvent string

TriggerEvent defines the different kinds of events in triggers.

type UserAttr

type UserAttr int

UserAttr defines user attributes that can be used for sorting and filtering.

const (
	UserAttrNone UserAttr = iota
	UserAttrUID
	UserAttrName
	UserAttrEmail
	UserAttrAdmin
	UserAttrCreated
	UserAttrUpdated
)

Order enumeration.

func ParseUserAttr

func ParseUserAttr(s string) UserAttr

ParseUserAttr parses the user attribute string and returns the equivalent enumeration.

type WebhookAttr

type WebhookAttr int

WebhookAttr defines webhook attributes that can be used for sorting and filtering.

const (
	WebhookAttrNone WebhookAttr = iota
	// TODO [CODE-1364]: Remove once UID/Identifier migration is completed.
	WebhookAttrID
	// TODO [CODE-1363]: remove after identifier migration.
	WebhookAttrUID
	WebhookAttrIdentifier
	// TODO [CODE-1364]: Remove once UID/Identifier migration is completed.
	WebhookAttrDisplayName
	WebhookAttrCreated
	WebhookAttrUpdated
)

func ParseWebhookAttr

func ParseWebhookAttr(s string) WebhookAttr

ParseWebhookAttr parses the webhook attribute string and returns the equivalent enumeration.

func (WebhookAttr) String

func (a WebhookAttr) String() string

String returns the string representation of the attribute.

type WebhookExecutionResult

type WebhookExecutionResult string

WebhookExecutionResult defines the different results of a webhook execution.

const (
	// WebhookExecutionResultSuccess describes a webhook execution result that succeeded.
	WebhookExecutionResultSuccess WebhookExecutionResult = "success"

	// WebhookExecutionResultRetriableError describes a webhook execution result that failed with a retriable error.
	WebhookExecutionResultRetriableError WebhookExecutionResult = "retriable_error"

	// WebhookExecutionResultFatalError describes a webhook execution result that failed with an unrecoverable error.
	WebhookExecutionResultFatalError WebhookExecutionResult = "fatal_error"
)

func (WebhookExecutionResult) Enum

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

type WebhookParent

type WebhookParent string

WebhookParent defines different types of parents of a webhook.

const (
	// WebhookParentRepo describes a repo as webhook owner.
	WebhookParentRepo WebhookParent = "repo"

	// WebhookParentSpace describes a space as webhook owner.
	WebhookParentSpace WebhookParent = "space"
)

func (WebhookParent) Enum

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

type WebhookTrigger

type WebhookTrigger string

WebhookTrigger defines the different types of webhook triggers available.

const (
	// WebhookTriggerBranchCreated gets triggered when a branch gets created.
	WebhookTriggerBranchCreated WebhookTrigger = "branch_created"
	// WebhookTriggerBranchUpdated gets triggered when a branch gets updated.
	WebhookTriggerBranchUpdated WebhookTrigger = "branch_updated"
	// WebhookTriggerBranchDeleted gets triggered when a branch gets deleted.
	WebhookTriggerBranchDeleted WebhookTrigger = "branch_deleted"

	// WebhookTriggerTagCreated gets triggered when a tag gets created.
	WebhookTriggerTagCreated WebhookTrigger = "tag_created"
	// WebhookTriggerTagUpdated gets triggered when a tag gets updated.
	WebhookTriggerTagUpdated WebhookTrigger = "tag_updated"
	// WebhookTriggerTagDeleted gets triggered when a tag gets deleted.
	WebhookTriggerTagDeleted WebhookTrigger = "tag_deleted"

	// WebhookTriggerPullReqCreated gets triggered when a pull request gets created.
	WebhookTriggerPullReqCreated WebhookTrigger = "pullreq_created"
	// WebhookTriggerPullReqReopened gets triggered when a pull request gets reopened.
	WebhookTriggerPullReqReopened WebhookTrigger = "pullreq_reopened"
	// WebhookTriggerPullReqBranchUpdated gets triggered when a pull request source branch gets updated.
	WebhookTriggerPullReqBranchUpdated WebhookTrigger = "pullreq_branch_updated"
	// WebhookTriggerPullReqClosed gets triggered when a pull request is closed.
	WebhookTriggerPullReqClosed WebhookTrigger = "pullreq_closed"
	// WebhookTriggerPullReqCommentCreated gets triggered when a pull request comment gets created.
	WebhookTriggerPullReqCommentCreated WebhookTrigger = "pullreq_comment_created"
	// WebhookTriggerPullReqMerged gets triggered when a pull request is merged.
	WebhookTriggerPullReqMerged WebhookTrigger = "pullreq_merged"
	// WebhookTriggerPullReqUpdated gets triggered when a pull request gets updated.
	WebhookTriggerPullReqUpdated WebhookTrigger = "pullreq_updated"
)

func (WebhookTrigger) Enum

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

func (WebhookTrigger) Sanitize

func (s WebhookTrigger) Sanitize() (WebhookTrigger, bool)

Jump to

Keyboard shortcuts

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