Documentation ¶
Overview ¶
Package model contains definitions of model objects that are stored in the datastore.
Index ¶
- Constants
- func ApplicationKindStrings() []string
- func CanUpdateDeploymentStatus(cur, next DeploymentStatus) bool
- func CanUpdateStageStatus(cur, next StageStatus) bool
- func DeploymentStatusStrings() []string
- func ExtractAPIKeyID(key string) (string, error)
- func GenerateAPIKey(id string) (key, hash string, err error)
- func GeneratePipedKey() (key, hash string, err error)
- func GenerateRandomString(n int) string
- func IsApplicationConfigFile(filename string) bool
- func (c *Command) IsChainSyncApplicationCmd() bool
- func IsCompletedDeployment(status DeploymentStatus) bool
- func IsCompletedStage(status StageStatus) bool
- func (c *Command) IsHandled() bool
- func IsSuccessfullyCompletedDeployment(status DeploymentStatus) bool
- func (c *Command) IsSyncApplicationCmd() bool
- func MakeApplicationURL(baseURL, applicationID string) string
- func MakeEnvironmentURL(baseURL, environmentID string) string
- func MakeEventKey(name string, labels map[string]string) string
- func MakePipedURL(baseURL, pipedID string) string
- func UnmarshalPipedStat(data interface{}, ps *PipedStat) error
- type AnalysisProviderType
- type CloudProviderType
- type DataStoreType
- type FileStoreType
- type NotificationEvent
- type ReportableCommand
- type SecretManagementType
- type Stage
Constants ¶
const (
DefaultApplicationConfigFilename = "app.pipecd.yaml"
)
const (
MetadataKeyDeploymentNotification = "DeploymentNotification"
)
const (
MetadataKeyTriggeredDeploymentID = "TriggeredDeploymentID"
)
const (
PipedStatsRetention = 2 * time.Minute
)
Variables ¶
This section is empty.
Functions ¶
func ApplicationKindStrings ¶
func ApplicationKindStrings() []string
ApplicationKindStrings returns a list of available deployment kinds in string.
func CanUpdateDeploymentStatus ¶
func CanUpdateDeploymentStatus(cur, next DeploymentStatus) bool
CanUpdateDeploymentStatus checks whether the deployment can transit to the given status.
func CanUpdateStageStatus ¶
func CanUpdateStageStatus(cur, next StageStatus) bool
CanUpdateStageStatus checks whether the stage can transit to the given status.
func DeploymentStatusStrings ¶
func DeploymentStatusStrings() []string
DeploymentStatusStrings returns a list of available deployment statuses in string.
func ExtractAPIKeyID ¶
func GenerateAPIKey ¶
func GeneratePipedKey ¶
GeneratePipedKey generates a new key for piped. This returns raw key value for used by piped and a hash value of the key for storing in datastore.
func GenerateRandomString ¶
GenerateRandomString makes a random string with the given length. This implementation was referenced from the link below. https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go
func IsApplicationConfigFile ¶
func (*Command) IsChainSyncApplicationCmd ¶
func (c *Command) IsChainSyncApplicationCmd() bool
func IsCompletedDeployment ¶
func IsCompletedDeployment(status DeploymentStatus) bool
IsCompletedDeployment checks whether the deployment is at a completion state.
func IsCompletedStage ¶
func IsCompletedStage(status StageStatus) bool
IsCompletedStage checks whether the stage is at a completion state.
func IsSuccessfullyCompletedDeployment ¶
func IsSuccessfullyCompletedDeployment(status DeploymentStatus) bool
IsSuccessfullyCompletedDeployment checks whether the deployment is at a successfully addressed.
func (*Command) IsSyncApplicationCmd ¶
func (c *Command) IsSyncApplicationCmd() bool
func MakeApplicationURL ¶
func MakeEnvironmentURL ¶
func MakeEventKey ¶
MakeEventKey builds a fixed-length identifier based on the given name and labels. It returns the exact same string as long as both are the same.
func MakePipedURL ¶
func UnmarshalPipedStat ¶
func UnmarshalPipedStat(data interface{}, ps *PipedStat) error
Types ¶
type AnalysisProviderType ¶
type AnalysisProviderType string
const ( AnalysisProviderPrometheus AnalysisProviderType = "PROMETHEUS" AnalysisProviderDatadog AnalysisProviderType = "DATADOG" AnalysisProviderStackdriver AnalysisProviderType = "STACKDRIVER" )
func (AnalysisProviderType) String ¶
func (t AnalysisProviderType) String() string
type CloudProviderType ¶
type CloudProviderType string
const ( CloudProviderKubernetes CloudProviderType = "KUBERNETES" CloudProviderTerraform CloudProviderType = "TERRAFORM" CloudProviderCloudRun CloudProviderType = "CLOUDRUN" CloudProviderLambda CloudProviderType = "LAMBDA" CloudProviderECS CloudProviderType = "ECS" )
func (CloudProviderType) String ¶
func (t CloudProviderType) String() string
type DataStoreType ¶
type DataStoreType string
const ( DataStoreFirestore DataStoreType = "FIRESTORE" DataStoreMySQL DataStoreType = "MYSQL" )
func (DataStoreType) String ¶
func (t DataStoreType) String() string
type FileStoreType ¶
type FileStoreType string
const ( FileStoreGCS FileStoreType = "GCS" FileStoreS3 FileStoreType = "S3" FileStoreMINIO FileStoreType = "MINIO" )
func (FileStoreType) String ¶
func (t FileStoreType) String() string
type NotificationEvent ¶
type NotificationEvent struct { Type NotificationEventType Metadata interface{} }
func (NotificationEvent) Group ¶
func (e NotificationEvent) Group() NotificationEventGroup
type ReportableCommand ¶
type SecretManagementType ¶
type SecretManagementType string
const ( SecretManagementTypeNone SecretManagementType = "NONE" // SecretManagementTypeKeyPair is equal to SecretManagementTypeSealingKey. // We added this new type because of removing "sealed" prefix. SecretManagementTypeKeyPair SecretManagementType = "KEY_PAIR" // SecretManagementTypeSealingKey is deprecated for a while before being removed completely. // Deprecated SecretManagementTypeSealingKey SecretManagementType = "SEALING_KEY" SecretManagementTypeGCPKMS SecretManagementType = "GCP_KMS" SecretManagementTypeAWSKMS SecretManagementType = "AWS_KMS" )
func (SecretManagementType) String ¶
func (t SecretManagementType) String() string
type Stage ¶
type Stage string
Stage represents the middle and temporary state of application before reaching its final desired state.
const ( // StageWait represents the waiting state for a specified period of time. StageWait Stage = "WAIT" // StageWaitApproval represents the waiting state until getting an approval // from one of the specified approvers. StageWaitApproval Stage = "WAIT_APPROVAL" // StageAnalysis represents the waiting state for analysing // the application status based on metrics, log, http request... StageAnalysis Stage = "ANALYSIS" // StageK8sSync represents the state where // all resources should be synced with the Git state. StageK8sSync Stage = "K8S_SYNC" // StageK8sPrimaryRollout represents the state where // the PRIMARY variant resources has been updated to the new version/configuration. StageK8sPrimaryRollout Stage = "K8S_PRIMARY_ROLLOUT" // StageK8sCanaryRollout represents the state where // the CANARY variant resources has been rolled out with the new version/configuration. StageK8sCanaryRollout Stage = "K8S_CANARY_ROLLOUT" // StageK8sCanaryClean represents the state where // the CANARY variant resources has been cleaned. StageK8sCanaryClean Stage = "K8S_CANARY_CLEAN" // StageK8sBaselineRollout represents the state where // the BASELINE variant resources has been rolled out. StageK8sBaselineRollout Stage = "K8S_BASELINE_ROLLOUT" // StageK8sBaselineClean represents the state where // the BASELINE variant resources has been cleaned. StageK8sBaselineClean Stage = "K8S_BASELINE_CLEAN" // StageK8sTrafficRouting represents the state where the traffic to application // should be splitted as the specified percentage to PRIMARY, CANARY, BASELINE variants. StageK8sTrafficRouting Stage = "K8S_TRAFFIC_ROUTING" // StageTerraformSync synced infrastructure with all the tf defined in Git. // Firstly, it does plan and if there are any changes detected it applies those changes automatically. StageTerraformSync Stage = "TERRAFORM_SYNC" // StageTerraformPlan shows terraform plan result. StageTerraformPlan Stage = "TERRAFORM_PLAN" // StageTerraformApply represents the state where // the new configuration has been applied. StageTerraformApply Stage = "TERRAFORM_APPLY" // StageCloudRunSync does quick sync by rolling out the new version // and switching all traffic to it. StageCloudRunSync Stage = "CLOUDRUN_SYNC" // StageCloudRunPromote promotes the new version to receive amount of traffic. StageCloudRunPromote Stage = "CLOUDRUN_PROMOTE" // StageLambdaSync does quick sync by rolling out the new version // and switching all traffic to it. StageLambdaSync Stage = "LAMBDA_SYNC" // StageLambdaCanaryRollout represents the state where // the CANARY variant resources has been rolled out with the new version/configuration. StageLambdaCanaryRollout Stage = "LAMBDA_CANARY_ROLLOUT" // StageLambdaPromote prmotes the new version to receive amount of traffic. StageLambdaPromote Stage = "LAMBDA_PROMOTE" // StageECSSync does quick sync by rolling out the new version // and switching all traffic to it. StageECSSync Stage = "ECS_SYNC" // StageECSCanaryRollout represents the stage where // the CANARY variant resource have been rolled out with the new version/configuration. // The CANARY variant will serve amount of traffic set in this stage option. StageECSCanaryRollout Stage = "ECS_CANARY_ROLLOUT" // StageECSPrimaryRollout represents the stage where // the PRIMARY variant resource have been rolled out with the new version/configuration. // The PRIMARY variant will serve 100% traffic after it's rolled out. StageECSPrimaryRollout Stage = "ECS_PRIMARY_ROLLOUT" // StageECSTrafficRouting represents the state where the traffic to application // should be splitted as the specified percentage to PRIMARY/CANARY variants. StageECSTrafficRouting Stage = "ECS_TRAFFIC_ROUTING" // StageECSCanaryClean represents the stage where // the CANARY variant resources has been cleaned. StageECSCanaryClean Stage = "ECS_CANARY_CLEAN" // StageRollback represents a state where // the all temporarily created stages will be reverted to // bring back the pre-deploy stage. // This stage is AUTOMATICALLY GENERATED and can not be used // to specify in configuration file. StageRollback Stage = "ROLLBACK" )