sdk

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: BSD-3-Clause Imports: 56 Imported by: 411

Documentation

Index

Constants

View Source
const (
	DefaultAction = "Default"
	BuiltinAction = "Builtin"
	PluginAction  = "Plugin"
	JoinedAction  = "Joined"
)

Action type

View Source
const (
	ScriptAction              = "Script"
	JUnitAction               = "JUnit"
	CoverageAction            = "Coverage"
	GitCloneAction            = "GitClone"
	GitTagAction              = "GitTag"
	ReleaseVCSAction          = "ReleaseVCS"
	CheckoutApplicationAction = "CheckoutApplication"
	DeployApplicationAction   = "DeployApplication"
	PushBuildInfo             = "PushBuildInfo"
	InstallKeyAction          = "InstallKey"
	ReleaseAction             = "Release"
	PromoteAction             = "Promote"

	DefaultGitCloneParameterTagValue = "{{.git.tag}}"
)

Builtin Action

View Source
const (
	SeverityUnknown    string = "unknown"
	SeverityNegligible string = "negligible"
	SeverityLow        string = "low"
	SeverityMedium     string = "medium"
	SeverityHigh       string = "high"
	SeverityCritical   string = "critical"
	SeverityDefcon1    string = "defcon1"
)
View Source
const (
	ArtifactUpload   = "Artifact Upload"
	ArtifactDownload = "Artifact Download"
	ServeStaticFiles = "Serve Static Files"

	ArtifactUploadPluginInputPath = "cds.integration.artifact_manager.upload.path"

	ArtifactUploadPluginOutputPathFileName = "name"
	ArtifactUploadPluginOutputPathFilePath = "path"
	ArtifactUploadPluginOutputPathRepoType = "repository_type"
	ArtifactUploadPluginOutputPathRepoName = "repository_name"
	ArtifactUploadPluginOutputPathMD5      = "md5"
	ArtifactUploadPluginOutputPerm         = "perm"
	ArtifactUploadPluginOutputSize         = "size"

	ArtifactDownloadPluginInputDestinationPath = "cds.integration.artifact_manager.download.destination.path"
	ArtifactDownloadPluginInputFilePath        = "cds.integration.artifact_manager.download.file.path"
	ArtifactDownloadPluginInputMd5             = "cds.integration.artifact_manager.download.file.md5"
	ArtifactDownloadPluginInputPerm            = "cds.integration.artifact_manager.download.file.perm"
)

Builtin artifact manipulation actions

View Source
const (
	AuditAdd    = "add"
	AuditUpdate = "update"
	AuditDelete = "delete"
)

Different type of Audit event

View Source
const (
	StatusPending           = "Pending"
	StatusWaiting           = "Waiting"
	StatusChecking          = "Checking" // DEPRECATED, to remove when removing pipelineBuild
	StatusBuilding          = "Building"
	StatusSuccess           = "Success"
	StatusFail              = "Fail"
	StatusDisabled          = "Disabled"
	StatusNeverBuilt        = "Never Built"
	StatusUnknown           = "Unknown"
	StatusSkipped           = "Skipped"
	StatusStopped           = "Stopped"
	StatusWorkerPending     = "Pending"
	StatusWorkerRegistering = "Registering"
)

Action status in queue

View Source
const (
	// PermissionRead  read permission on the resource
	PermissionRead = 4
	// PermissionReadExecute  read & execute permission on the resource
	PermissionReadExecute = 5
	// PermissionReadWriteExecute read/execute/write permission on the resource
	PermissionReadWriteExecute = 7
)
View Source
const (
	WebHookModelName              = "WebHook"
	RepositoryWebHookModelName    = "RepositoryWebHook"
	GerritHookModelName           = "GerritHook"
	SchedulerModelName            = "Scheduler"
	GitPollerModelName            = "Git Repository Poller"
	KafkaHookModelName            = "Kafka hook"
	RabbitMQHookModelName         = "RabbitMQ hook"
	WorkflowModelName             = "Workflow"
	HookConfigProject             = "project"
	HookConfigWorkflow            = "workflow"
	HookConfigTargetProject       = "target_project"
	HookConfigTargetWorkflow      = "target_workflow"
	HookConfigTargetHook          = "target_hook"
	HookConfigWorkflowID          = "workflow_id"
	HookConfigWebHookID           = "webHookID"
	HookConfigVCSServer           = "vcsServer"
	HookConfigEventFilter         = "eventFilter"
	HookConfigRepoFullName        = "repoFullName"
	HookConfigModelType           = "model_type"
	HookConfigModelName           = "model_name"
	HookConfigIcon                = "hookIcon"
	WebHookModelConfigMethod      = "method"
	RepositoryWebHookModelMethod  = "method"
	SchedulerModelCron            = "cron"
	SchedulerModelTimezone        = "timezone"
	Payload                       = "payload"
	HookModelIntegration          = "integration"
	KafkaHookModelConsumerGroup   = "consumer group"
	KafkaHookModelTopic           = "topic"
	RabbitMQHookModelQueue        = "queue"
	RabbitMQHookModelBindingKey   = "binding_key"
	RabbitMQHookModelExchangeType = "exchange_type"
	RabbitMQHookModelExchangeName = "exchange_name"
	RabbitMQHookModelConsumerTag  = "consumer_tag"
	SchedulerUsername             = "cds.scheduler"
	SchedulerFullname             = "CDS Scheduler"
)

These are constants about hooks

View Source
const (
	KafkaIntegrationModel           = "Kafka"
	RabbitMQIntegrationModel        = "RabbitMQ"
	OpenstackIntegrationModel       = "Openstack"
	AWSIntegrationModel             = "AWS"
	DefaultStorageIntegrationName   = "shared.infra"
	ArtifactoryIntegrationModelName = "Artifactory"

	ArtifactoryConfigPlatform              = "platform"
	ArtifactoryConfigURL                   = "url"
	ArtifactoryConfigTokenName             = "token.name"
	ArtifactoryConfigToken                 = "token"
	ArtifactoryConfigReleaseToken          = "release.token"
	ArtifactoryConfigCdsRepository         = "cds.repository"
	ArtifactoryConfigProjectKey            = "project.key"
	ArtifactoryConfigPromotionLowMaturity  = "promotion.maturity.low"
	ArtifactoryConfigPromotionHighMaturity = "promotion.maturity.high"
	ArtifactoryConfigBuildInfoPrefix       = "build.info.prefix"
)

This is the buitin integration model

View Source
const (
	IntegrationTypeEvent      = IntegrationType("event")
	IntegrationTypeCompute    = IntegrationType("compute")
	IntegrationTypeHook       = IntegrationType("hook")
	IntegrationTypeStorage    = IntegrationType("storage")
	IntegrationTypeDeployment = IntegrationType("deployment")
)
View Source
const (
	// IntegrationConfigTypeString represents a string configuration value
	IntegrationConfigTypeString = "string"
	// IntegrationConfigTypeText represents a text configuration value
	IntegrationConfigTypeText = "text"
	// IntegrationConfigTypePassword represents a password configuration value
	IntegrationConfigTypePassword = "password"
	// IntegrationConfigTypeBoolean represents a password configuration value
	IntegrationConfigTypeBoolean = "boolean"
	// IntegrationConfigTypeRegion represents a region requirement
	IntegrationConfigTypeRegion = "region"

	IntegrationVariablePrefixDeployment      = "deployment"
	IntegrationVariablePrefixArtifactManager = "artifact_manager"
)
View Source
const (
	MaintenanceAPIKey    string = "cds_maintenance_api"
	MaintenanceQueueName string = "cds_maintenance"
)
View Source
const (
	MetricKeyVulnerability = "Vulnerability"
	MetricKeyUnitTest      = "UnitTest"
	MetricKeyCoverage      = "Coverage"
)
View Source
const (
	// MigrationStatusTodo is the constant to indicate that the migration is "to do"
	MigrationStatusTodo string = "TODO"
	// MigrationStatusInProgress is the constant to indicate that the migration is "in progress"
	MigrationStatusInProgress string = "IN PROGRESS"
	// MigrationStatusDone is the constant to indicate that the migration is "done"
	MigrationStatusDone string = "DONE"
	// MigrationStatusCanceled is the constant to indicate that the migration is "canceled"
	MigrationStatusCanceled string = "CANCELED"
	// MigrationStatusNotExecuted is the constant to indicate that the migration is "not executed"
	MigrationStatusNotExecuted string = "NOT EXECUTED"
)
View Source
const (
	EmailUserNotification  = "email"
	JabberUserNotification = "jabber"
	VCSUserNotification    = "vcs"
	EventsNotification     = "event"
)

const

View Source
const (
	UserNotificationAlways = "always"
	UserNotificationNever  = "never"
	UserNotificationChange = "change"
)

const

View Source
const (
	EnvironmentParameter = "env"
	PipelineParameter    = "pipeline"
	ListParameter        = "list"
	NumberParameter      = "number"
	StringParameter      = "string"
	TextParameter        = "text"
	BooleanParameter     = "boolean"
	KeySSHParameter      = "ssh-key"
	KeyPGPParameter      = "pgp-key"
	KeyParameter         = "key"
)

Different type of Parameter

View Source
const (
	GRPCPluginDeploymentIntegration = "integration-deploy_application"
	GRPCPluginUploadArtifact        = "integration-upload_artifact"
	GRPCPluginDownloadArtifact      = "integration-download_artifact"
	GRPCPluginBuildInfo             = "integration-build_info"
	GRPCPluginRelease               = "integration-release"
	GRPCPluginPromote               = "integration-promote"
	GRPCPluginAction                = "action"
)

These are type of plugins

View Source
const (
	// ApplicationLastModificationType represent key for last update event about application
	ApplicationLastModificationType = "application"
	// PipelineLastModificationType represent key for last update event about pipeline
	PipelineLastModificationType = "pipeline"
	// WorkflowLastModificationType represent key for last update event about workflow
	WorkflowLastModificationType = "workflow"
	// ProjectLastModificationType represent key for last update event about project
	ProjectLastModificationType = "project"
	// ProjectPipelineLastModificationType represent key for last update event about project.pipeline (rename, delete or add a pipeline)
	ProjectPipelineLastModificationType = "project.pipeline"
	// ProjectApplicationLastModificationType represent key for last update event about project.application (rename, delete or add an application)
	ProjectApplicationLastModificationType = "project.application"
	// ProjectEnvironmentLastModificationType represent key for last update event about project.environment (rename, delete or add an environment)
	ProjectEnvironmentLastModificationType = "project.environment"
	// ProjectWorkflowLastModificationType represent key for last update event about project.workflow (rename, delete or add a workflow)
	ProjectWorkflowLastModificationType = "project.workflow"
	// ProjectVariableLastModificationType represent key for last update event about project.variable (rename, delete or add a variable)
	ProjectVariableLastModificationType = "project.variable"
	// ProjectKeysLastModificationType represent key for last update event about project.keys (add, delete a key)
	ProjectKeysLastModificationType = "project.keys"
	// ProjectIntegrationsLastModificationType represent key for last update event about project.integrations (add, update, delete a integration)
	ProjectIntegrationsLastModificationType = "project.integrations"
)
View Source
const (
	// ResponseWorkflowNameHeader is used as HTTP header
	ResponseWorkflowNameHeader = "X-Api-Workflow-Name"
	// ResponseWorkflowIDHeader is used as HTTP header
	ResponseWorkflowIDHeader = "X-Api-Workflow-Id"
	// WorkflowAsCodeHeader is used as HTTP header
	WorkflowAsCodeHeader = "X-Api-Workflow-As-Code"

	// ResponseTemplateGroupNameHeader is used as HTTP header
	ResponseTemplateGroupNameHeader = "X-Api-Template-Group-Name"
	// ResponseTemplateSlugHeader is used as HTTP header
	ResponseTemplateSlugHeader = "X-Api-Template-Slug"
)
View Source
const (
	//BinaryRequirement refers to the need to a specific binary on host running the action
	BinaryRequirement = "binary"
	// ModelRequirement refers to the need fo a specific model
	ModelRequirement = "model"
	// HostnameRequirement checks the hostname of the worker
	HostnameRequirement = "hostname"
	//PluginRequirement installs & checks plugins of the worker
	PluginRequirement = "plugin"
	//ServiceRequirement links a service to a worker
	ServiceRequirement = "service"
	//MemoryRequirement set memory limit on a container
	MemoryRequirement = "memory"
	// OSArchRequirement checks the 'dist' of a worker eg {GOOS}/{GOARCH}
	OSArchRequirement = "os-architecture"
	// RegionRequirement lets a use to force a job running in a hatchery's region
	RegionRequirement = "region"
)
View Source
const (
	TypeHooks         = "hooks"
	TypeRepositories  = "repositories"
	TypeElasticsearch = "elasticsearch"
	TypeVCS           = "vcs"
	TypeAPI           = "api"
	TypeUI            = "ui"
	TypeCDN           = "cdn"
	TypeHatchery      = "hatchery"
	TypeDBMigrate     = "dbmigrate"
)

Those are constant for services types

View Source
const (
	MonitoringStatusAlert = "AL"
	MonitoringStatusWarn  = "WARN"
	MonitoringStatusOK    = "OK"
)

This constants deals with Monitoring statuses

View Source
const (
	UserRingAdmin      = "ADMIN"
	UserRingMaintainer = "MAINTAINER"
	UserRingUser       = "USER"
)

User rings.

View Source
const (
	SecretVariable     = "password"
	TextVariable       = "text"
	StringVariable     = "string"
	KeyVariable        = "key"
	BooleanVariable    = "boolean"
	NumberVariable     = "number"
	RepositoryVariable = "repository"
)

Different type of Variable

View Source
const (
	HeaderXAccessToken        = "X-CDS-ACCESS-TOKEN"
	HeaderXAccessTokenCreated = "X-CDS-ACCESS-TOKEN-CREATED"
	HeaderXAccessTokenSecret  = "X-CDS-ACCESS-TOKEN-SECRET"
)

HTTP Headers

View Source
const (
	WarningMissingProjectVariableEnv               = "MISSING_PROJECT_VARIABLE_ENVIRONMENT"
	WarningMissingProjectVariableApplication       = "MISSING_PROJECT_VARIABLE_APPLICATION"
	WarningMissingProjectVariablePipelineParameter = "MISSING_PROJECT_VARIABLE_PIPELINE_PARAMETER"
	WarningMissingProjectVariablePipelineJob       = "MISSING_PROJECT_VARIABLE_PIPELINE_JOB"
	WarningMissingProjectVariableWorkflow          = "MISSING_PROJECT_VARIABLE_WORKFLOW"
	WarningUnusedProjectVariable                   = "UNUSED_PROJECT_VARIABLE"
	WarningMissingProjectPermissionEnv             = "MISSING_PROJECT_PERMISSION_ENV"
	WarningMissingProjectPermissionWorkflow        = "MISSING_PROJECT_PERMISSION_WORKFLOW"
	WarningMissingProjectKeyApplication            = "MISSING_PROJECT_KEY_APPLICATION"
	WarningMissingProjectKeyPipelineParameter      = "MISSING_PROJECT_KEY_PIPELINE_PARAMETER"
	WarningMissingProjectKeyPipelineJob            = "MISSING_PROJECT_KEY_PIPELINE_JOB"
	WarningUnusedProjectKey                        = "UNUSED_PROJECT_KEY"
	WarningMissingProjectVCSServer                 = "MISSING_PROJECT_VCS"
	WarningUnusedProjectVCSServer                  = "UNUSED_PROJECT_VCS"
	WarningMissingVCSConfiguration                 = "MISSING_VCS_CONFIGURATION"
	WarningMissingApplicationVariable              = "MISSING_APPLICATION_VARIABLE"
	WarningUnusedApplicationVariable               = "UNUSED_APPLICATION_VARIABLE"
	WarningMissingApplicationKey                   = "MISSING_APPLICATION_KEY"
	WarningUnusedApplicationKey                    = "UNUSED_APPLICATION_KEY"
	WarningMissingEnvironmentVariable              = "MISSING_ENVIRONMENT_VARIABLE"
	WarningUnusedEnvironmentVariable               = "UNUSED_ENVIRONMENT_VARIABLE"
	WarningMissingEnvironmentKey                   = "MISSING_ENVIRONMENT_KEY"
	WarningUnusedEnvironmentKey                    = "UNUSED_ENVIRONMENT_KEY"
	WarningMissingPipelineParameter                = "MISSING_PIPELINE_PARAMETER"
	WarningUnusedPipelineParameter                 = "UNUSED_PIPELINE_PARAMETER"
)
View Source
const (
	Docker      = "docker"
	HostProcess = "host"
	Openstack   = "openstack"
	VSphere     = "vsphere"
)

Existing worker model type

View Source
const (
	WorkflowConditionsOperatorEquals             = "eq"
	WorkflowConditionsOperatorNotEquals          = "ne"
	WorkflowConditionsOperatorLessThan           = "lt"
	WorkflowConditionsOperatorLessOrEqualThan    = "le"
	WorkflowConditionsOperatorGreaterThan        = "gt"
	WorkflowConditionsOperatorGreaterOrEqualThan = "ge"
	WorkflowConditionsOperatorRegex              = "regex"
)

WorkflowData conditions operator

View Source
const (
	GitlabIcon    = "Gitlab"
	GitHubIcon    = "Github"
	BitbucketIcon = "Bitbucket"
	GerritIcon    = "git"
)

Those are icon for hooks

View Source
const (
	// HookConfigTypeString type string
	HookConfigTypeString = "string"
	// HookConfigTypeIntegration type integration
	HookConfigTypeIntegration = "integration"
	// HookConfigTypeProject type project
	HookConfigTypeProject = "project"
	// HookConfigTypeWorkflow type workflow
	HookConfigTypeWorkflow = "workflow"
	// HookConfigTypeHook type hook
	HookConfigTypeHook = "hook"
	// HookConfigTypeMultiChoice type multiple
	HookConfigTypeMultiChoice = "multiple"
)
View Source
const (
	NodeTypePipeline     = "pipeline"
	NodeTypeJoin         = "join"
	NodeTypeOutGoingHook = "outgoinghook"
	NodeTypeFork         = "fork"
)
View Source
const (
	RunInfoTypInfo     = "Info"
	RunInfoTypeWarning = "Warning"
	RunInfoTypeError   = "Error"
)
View Source
const AuthSigninConsumerTokenDuration time.Duration = time.Minute * 5
View Source
const (
	CDSSessionID = "X-CDS-Session-ID"
)
View Source
const (
	DefaultHistoryLength int64 = 20
)

DefaultHistoryLength is the default history length

View Source
const DefaultWorkflowNodeRunReport = `` /* 833-byte string literal not displayed */
View Source
const IconFormat = "data:image/"

IconFormat is the format prefix accepted for icon

View Source
const MaxIconSize = 120000

MaxIconSize is the maximum size of the icon in octet

View Source
const NamePattern = "^[a-zA-Z0-9._-]{1,}$"

NamePattern Pattern for project/application/pipeline/group name

View Source
const NamePatternSpace = `^[\sa-zA-Z0-9._-]{1,}$`

NamePatternSpace Pattern for stage name

View Source
const (
	// Different types of warning for PipelineBuild
	OptionalStepFailed = "optional_step_failed"
)

This constant deals with pipelines

View Source
const (
	PasswordPlaceholder string = "**********"
)

Value of passwords when leaving the API

View Source
const ProjectKeyPattern = "^[A-Z0-9]{1,}$"

ProjectKeyPattern pattern for project key

View Source
const (
	// SecretMinLength is the minimal size of a secret
	// variable to be considered as a secret
	// a secret variable displayed, with less then 6, will
	// displayed, instead of appears as **cds.app.my-password**
	SecretMinLength = 6
)
View Source
const SharedInfraGroupName = "shared.infra"

SharedInfraGroupName is the name of the builtin group used to share infrastructure between projects

View Source
const URLGithubIssues = "https://github.com/ovh/cds/issues"

URLGithubIssues contains a link to CDS Issues

View Source
const URLGithubReleases = "https://github.com/ovh/cds/releases"

URLGithubReleases contains a link to CDS Official Releases

View Source
const UserContactTypeEmail = "email"
View Source
const WorkflowHookModelBuiltin = "builtin"

WorkflowHookModelBuiltin is a constant for the builtin hook models

Variables

View Source
var (
	StatusTerminated    = True
	StatusNotTerminated = False
)
View Source
var (
	True        = true
	False       = false
	TrueString  = "true"
	FalseString = "false"
)

True of false

View Source
var (
	ErrUnknownError                                  = Error{ID: 1, Status: http.StatusInternalServerError}
	ErrActionAlreadyUpdated                          = Error{ID: 2, Status: http.StatusBadRequest}
	ErrNoAction                                      = Error{ID: 3, Status: http.StatusNotFound}
	ErrActionLoop                                    = Error{ID: 4, Status: http.StatusBadRequest}
	ErrInvalidID                                     = Error{ID: 5, Status: http.StatusBadRequest}
	ErrInvalidProject                                = Error{ID: 6, Status: http.StatusBadRequest}
	ErrInvalidProjectKey                             = Error{ID: 7, Status: http.StatusBadRequest}
	ErrProjectHasPipeline                            = Error{ID: 8, Status: http.StatusForbidden}
	ErrProjectHasApplication                         = Error{ID: 9, Status: http.StatusForbidden}
	ErrUnauthorized                                  = Error{ID: 10, Status: http.StatusUnauthorized}
	ErrForbidden                                     = Error{ID: 11, Status: http.StatusForbidden}
	ErrPipelineNotFound                              = Error{ID: 12, Status: http.StatusBadRequest}
	ErrPipelineNotAttached                           = Error{ID: 13, Status: http.StatusBadRequest}
	ErrNoEnvironmentProvided                         = Error{ID: 14, Status: http.StatusBadRequest}
	ErrEnvironmentProvided                           = Error{ID: 15, Status: http.StatusBadRequest}
	ErrUnknownEnv                                    = Error{ID: 16, Status: http.StatusBadRequest}
	ErrEnvironmentExist                              = Error{ID: 17, Status: http.StatusForbidden}
	ErrNoPipelineBuild                               = Error{ID: 18, Status: http.StatusNotFound}
	ErrInvalidUsername                               = Error{ID: 21, Status: http.StatusBadRequest}
	ErrInvalidEmail                                  = Error{ID: 22, Status: http.StatusBadRequest}
	ErrGroupPresent                                  = Error{ID: 23, Status: http.StatusBadRequest}
	ErrInvalidName                                   = Error{ID: 24, Status: http.StatusBadRequest}
	ErrInvalidUser                                   = Error{ID: 25, Status: http.StatusBadRequest}
	ErrBuildArchived                                 = Error{ID: 26, Status: http.StatusBadRequest}
	ErrNoEnvironment                                 = Error{ID: 27, Status: http.StatusNotFound}
	ErrModelNameExist                                = Error{ID: 28, Status: http.StatusForbidden}
	ErrNoProject                                     = Error{ID: 30, Status: http.StatusNotFound}
	ErrVariableExists                                = Error{ID: 31, Status: http.StatusForbidden}
	ErrInvalidGroupPattern                           = Error{ID: 32, Status: http.StatusBadRequest}
	ErrGroupExists                                   = Error{ID: 33, Status: http.StatusForbidden}
	ErrNotEnoughAdmin                                = Error{ID: 34, Status: http.StatusBadRequest}
	ErrInvalidProjectName                            = Error{ID: 35, Status: http.StatusBadRequest}
	ErrInvalidApplicationPattern                     = Error{ID: 36, Status: http.StatusBadRequest}
	ErrInvalidPipelinePattern                        = Error{ID: 37, Status: http.StatusBadRequest}
	ErrNotFound                                      = Error{ID: 38, Status: http.StatusNotFound}
	ErrNoHook                                        = Error{ID: 40, Status: http.StatusNotFound}
	ErrNoAttachedPipeline                            = Error{ID: 41, Status: http.StatusNotFound}
	ErrNoReposManager                                = Error{ID: 42, Status: http.StatusNotFound}
	ErrNoReposManagerAuth                            = Error{ID: 43, Status: http.StatusUnauthorized}
	ErrNoReposManagerClientAuth                      = Error{ID: 44, Status: http.StatusForbidden}
	ErrRepoNotFound                                  = Error{ID: 45, Status: http.StatusNotFound}
	ErrSecretStoreUnreachable                        = Error{ID: 46, Status: http.StatusMethodNotAllowed}
	ErrSecretKeyFetchFailed                          = Error{ID: 47, Status: http.StatusMethodNotAllowed}
	ErrInvalidGoPath                                 = Error{ID: 48, Status: http.StatusBadRequest}
	ErrCommitsFetchFailed                            = Error{ID: 49, Status: http.StatusNotFound}
	ErrInvalidSecretFormat                           = Error{ID: 50, Status: http.StatusInternalServerError}
	ErrNoPreviousSuccess                             = Error{ID: 52, Status: http.StatusNotFound}
	ErrNoPermExecution                               = Error{ID: 53, Status: http.StatusForbidden}
	ErrInvalidSecretValue                            = Error{ID: 55, Status: http.StatusBadRequest}
	ErrPipelineHasApplication                        = Error{ID: 56, Status: http.StatusBadRequest}
	ErrNoDirectSecretUse                             = Error{ID: 57, Status: http.StatusForbidden}
	ErrNoBranch                                      = Error{ID: 58, Status: http.StatusNotFound}
	ErrLDAPConn                                      = Error{ID: 59, Status: http.StatusInternalServerError}
	ErrServiceUnavailable                            = Error{ID: 60, Status: http.StatusServiceUnavailable}
	ErrParseUserNotification                         = Error{ID: 61, Status: http.StatusBadRequest}
	ErrNotSupportedUserNotification                  = Error{ID: 62, Status: http.StatusBadRequest}
	ErrGroupNeedAdmin                                = Error{ID: 63, Status: http.StatusBadRequest}
	ErrGroupNeedWrite                                = Error{ID: 64, Status: http.StatusBadRequest}
	ErrNoVariable                                    = Error{ID: 65, Status: http.StatusNotFound}
	ErrPluginInvalid                                 = Error{ID: 66, Status: http.StatusBadRequest}
	ErrApplicationExist                              = Error{ID: 69, Status: http.StatusForbidden}
	ErrBranchNameNotProvided                         = Error{ID: 70, Status: http.StatusBadRequest}
	ErrInfiniteTriggerLoop                           = Error{ID: 71, Status: http.StatusBadRequest}
	ErrInvalidResetUser                              = Error{ID: 72, Status: http.StatusBadRequest}
	ErrUserConflict                                  = Error{ID: 73, Status: http.StatusBadRequest}
	ErrWrongRequest                                  = Error{ID: 74, Status: http.StatusBadRequest}
	ErrAlreadyExist                                  = Error{ID: 75, Status: http.StatusForbidden}
	ErrInvalidType                                   = Error{ID: 76, Status: http.StatusBadRequest}
	ErrParentApplicationAndPipelineMandatory         = Error{ID: 77, Status: http.StatusBadRequest}
	ErrNoParentBuildFound                            = Error{ID: 78, Status: http.StatusNotFound}
	ErrParameterExists                               = Error{ID: 79, Status: http.StatusForbidden}
	ErrNoHatchery                                    = Error{ID: 80, Status: http.StatusNotFound}
	ErrInvalidWorkerStatus                           = Error{ID: 81, Status: http.StatusNotFound}
	ErrInvalidToken                                  = Error{ID: 82, Status: http.StatusUnauthorized}
	ErrAppBuildingPipelines                          = Error{ID: 83, Status: http.StatusForbidden}
	ErrInvalidTimezone                               = Error{ID: 84, Status: http.StatusBadRequest}
	ErrEnvironmentCannotBeDeleted                    = Error{ID: 85, Status: http.StatusForbidden}
	ErrInvalidPipeline                               = Error{ID: 86, Status: http.StatusBadRequest}
	ErrKeyNotFound                                   = Error{ID: 87, Status: http.StatusNotFound}
	ErrPipelineAlreadyExists                         = Error{ID: 88, Status: http.StatusForbidden}
	ErrJobAlreadyBooked                              = Error{ID: 89, Status: http.StatusForbidden}
	ErrPipelineBuildNotFound                         = Error{ID: 90, Status: http.StatusNotFound}
	ErrAlreadyTaken                                  = Error{ID: 91, Status: http.StatusGone}
	ErrWorkflowNodeNotFound                          = Error{ID: 93, Status: http.StatusNotFound}
	ErrWorkflowInvalidRoot                           = Error{ID: 94, Status: http.StatusBadRequest}
	ErrWorkflowNodeRef                               = Error{ID: 95, Status: http.StatusBadRequest}
	ErrWorkflowInvalid                               = Error{ID: 96, Status: http.StatusBadRequest}
	ErrWorkflowNodeJoinNotFound                      = Error{ID: 97, Status: http.StatusNotFound}
	ErrInvalidJobRequirement                         = Error{ID: 98, Status: http.StatusBadRequest}
	ErrNotImplemented                                = Error{ID: 99, Status: http.StatusNotImplemented}
	ErrParameterNotExists                            = Error{ID: 100, Status: http.StatusNotFound}
	ErrUnknownKeyType                                = Error{ID: 101, Status: http.StatusBadRequest}
	ErrInvalidKeyPattern                             = Error{ID: 102, Status: http.StatusBadRequest}
	ErrWebhookConfigDoesNotMatch                     = Error{ID: 103, Status: http.StatusBadRequest}
	ErrPipelineUsedByWorkflow                        = Error{ID: 104, Status: http.StatusBadRequest}
	ErrMethodNotAllowed                              = Error{ID: 105, Status: http.StatusMethodNotAllowed}
	ErrInvalidNodeNamePattern                        = Error{ID: 106, Status: http.StatusBadRequest}
	ErrWorkflowNodeParentNotRun                      = Error{ID: 107, Status: http.StatusForbidden}
	ErrHookNotFound                                  = Error{ID: 108, Status: http.StatusNotFound}
	ErrDefaultGroupPermission                        = Error{ID: 109, Status: http.StatusBadRequest}
	ErrLastGroupWithWriteRole                        = Error{ID: 110, Status: http.StatusForbidden}
	ErrInvalidEmailDomain                            = Error{ID: 111, Status: http.StatusForbidden}
	ErrWorkflowNodeRunJobNotFound                    = Error{ID: 112, Status: http.StatusNotFound}
	ErrBuiltinKeyNotFound                            = Error{ID: 113, Status: http.StatusInternalServerError}
	ErrStepNotFound                                  = Error{ID: 114, Status: http.StatusNotFound}
	ErrWorkerModelAlreadyBooked                      = Error{ID: 115, Status: http.StatusForbidden}
	ErrConditionsNotOk                               = Error{ID: 116, Status: http.StatusBadRequest}
	ErrDownloadInvalidOS                             = Error{ID: 117, Status: http.StatusNotFound}
	ErrDownloadInvalidArch                           = Error{ID: 118, Status: http.StatusNotFound}
	ErrDownloadInvalidName                           = Error{ID: 119, Status: http.StatusNotFound}
	ErrDownloadDoesNotExist                          = Error{ID: 120, Status: http.StatusNotFound}
	ErrTokenNotFound                                 = Error{ID: 121, Status: http.StatusNotFound}
	ErrWorkflowNotificationNodeRef                   = Error{ID: 122, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementDuplicateModel           = Error{ID: 123, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementDuplicateHostname        = Error{ID: 124, Status: http.StatusBadRequest}
	ErrInvalidKeyName                                = Error{ID: 125, Status: http.StatusBadRequest}
	ErrRepoOperationTimeout                          = Error{ID: 126, Status: http.StatusRequestTimeout}
	ErrInvalidGitBranch                              = Error{ID: 127, Status: http.StatusBadRequest}
	ErrInvalidFavoriteType                           = Error{ID: 128, Status: http.StatusBadRequest}
	ErrUnsupportedOSArchPlugin                       = Error{ID: 129, Status: http.StatusNotFound}
	ErrNoBroadcast                                   = Error{ID: 130, Status: http.StatusNotFound}
	ErrBroadcastNotFound                             = Error{ID: 131, Status: http.StatusNotFound}
	ErrInvalidPatternModel                           = Error{ID: 132, Status: http.StatusBadRequest}
	ErrWorkerModelNoAdmin                            = Error{ID: 133, Status: http.StatusForbidden}
	ErrWorkerModelNoPattern                          = Error{ID: 134, Status: http.StatusForbidden}
	ErrJobNotBooked                                  = Error{ID: 135, Status: http.StatusBadRequest}
	ErrUserNotFound                                  = Error{ID: 136, Status: http.StatusNotFound}
	ErrInvalidNumber                                 = Error{ID: 137, Status: http.StatusBadRequest}
	ErrKeyAlreadyExist                               = Error{ID: 138, Status: http.StatusForbidden}
	ErrPipelineNameImport                            = Error{ID: 139, Status: http.StatusBadRequest}
	ErrWorkflowNameImport                            = Error{ID: 140, Status: http.StatusBadRequest}
	ErrIconBadFormat                                 = Error{ID: 141, Status: http.StatusBadRequest}
	ErrIconBadSize                                   = Error{ID: 142, Status: http.StatusBadRequest}
	ErrWorkflowConditionBadOperator                  = Error{ID: 143, Status: http.StatusBadRequest}
	ErrColorBadFormat                                = Error{ID: 144, Status: http.StatusBadRequest}
	ErrInvalidHookConfiguration                      = Error{ID: 145, Status: http.StatusBadRequest}
	ErrWorkerModelDeploymentFailed                   = Error{ID: 146, Status: http.StatusBadRequest}
	ErrJobLocked                                     = Error{ID: 147, Status: http.StatusConflict}
	ErrWorkflowNodeRunLocked                         = Error{ID: 148, Status: http.StatusConflict}
	ErrInvalidData                                   = Error{ID: 149, Status: http.StatusBadRequest}
	ErrInvalidGroupAdmin                             = Error{ID: 150, Status: http.StatusForbidden}
	ErrInvalidGroupMember                            = Error{ID: 151, Status: http.StatusForbidden}
	ErrWorkflowNotGenerated                          = Error{ID: 152, Status: http.StatusForbidden}
	ErrAlreadyLatestTemplate                         = Error{ID: 153, Status: http.StatusForbidden}
	ErrInvalidNodeDefaultPayload                     = Error{ID: 154, Status: http.StatusBadRequest}
	ErrInvalidApplicationRepoStrategy                = Error{ID: 155, Status: http.StatusBadRequest}
	ErrWorkflowNodeRootUpdate                        = Error{ID: 156, Status: http.StatusBadRequest}
	ErrWorkflowAlreadyAsCode                         = Error{ID: 157, Status: http.StatusBadRequest}
	ErrNoDBMigrationID                               = Error{ID: 158, Status: http.StatusNotFound}
	ErrCannotParseTemplate                           = Error{ID: 159, Status: http.StatusBadRequest}
	ErrGroupNotFoundInProject                        = Error{ID: 160, Status: http.StatusBadRequest}
	ErrGroupNotFoundInWorkflow                       = Error{ID: 161, Status: http.StatusBadRequest}
	ErrWorkflowPermInsufficient                      = Error{ID: 162, Status: http.StatusBadRequest}
	ErrApplicationUsedByWorkflow                     = Error{ID: 163, Status: http.StatusBadRequest}
	ErrLocked                                        = Error{ID: 164, Status: http.StatusConflict}
	ErrInvalidJobRequirementWorkerModelPermission    = Error{ID: 165, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementWorkerModelCapabilitites = Error{ID: 166, Status: http.StatusBadRequest}
	ErrMalformattedStep                              = Error{ID: 167, Status: http.StatusBadRequest}
	ErrVCSUsedByApplication                          = Error{ID: 168, Status: http.StatusBadRequest}
	ErrApplicationAsCodeOverride                     = Error{ID: 169, Status: http.StatusForbidden}
	ErrPipelineAsCodeOverride                        = Error{ID: 170, Status: http.StatusForbidden}
	ErrEnvironmentAsCodeOverride                     = Error{ID: 171, Status: http.StatusForbidden}
	ErrWorkflowAsCodeOverride                        = Error{ID: 172, Status: http.StatusForbidden}
	ErrProjectSecretDataUnknown                      = Error{ID: 173, Status: http.StatusBadRequest}
	ErrApplicationMandatoryOnWorkflowAsCode          = Error{ID: 174, Status: http.StatusBadRequest}
	ErrInvalidPassword                               = Error{ID: 175, Status: http.StatusBadRequest}
	ErrInvalidPayloadVariable                        = Error{ID: 176, Status: http.StatusBadRequest}
	ErrRepositoryUsedByHook                          = Error{ID: 177, Status: http.StatusForbidden}
	ErrResourceNotInProject                          = Error{ID: 178, Status: http.StatusForbidden}
	ErrEnvironmentNotFound                           = Error{ID: 179, Status: http.StatusBadRequest}
	ErrIntegrationtNotFound                          = Error{ID: 180, Status: http.StatusBadRequest}
	ErrBadBrokerConfiguration                        = Error{ID: 181, Status: http.StatusBadRequest}
	ErrSignupDisabled                                = Error{ID: 182, Status: http.StatusForbidden}
	ErrUsernamePresent                               = Error{ID: 183, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementNetworkAccess            = Error{ID: 184, Status: http.StatusBadRequest}
	ErrInvalidWorkerModelNamePattern                 = Error{ID: 185, Status: http.StatusBadRequest}
	ErrWorkflowAsCodeResync                          = Error{ID: 186, Status: http.StatusForbidden}
	ErrWorkflowNodeNameDuplicate                     = Error{ID: 187, Status: http.StatusBadRequest}
	ErrUnsupportedMediaType                          = Error{ID: 188, Status: http.StatusUnsupportedMediaType}
	ErrNothingToPush                                 = Error{ID: 189, Status: http.StatusBadRequest}
	ErrWorkerErrorCommand                            = Error{ID: 190, Status: http.StatusBadRequest}
	ErrRepoAnalyzeFailed                             = Error{ID: 191, Status: http.StatusInternalServerError}
	ErrConflictData                                  = Error{ID: 192, Status: http.StatusConflict}
	ErrWebsocketUpgrade                              = Error{ID: 193, Status: http.StatusUpgradeRequired}
	ErrMFARequired                                   = Error{ID: 194, Status: http.StatusForbidden}
	ErrHatcheryNoResourceAvailable                   = Error{ID: 195, Status: http.StatusInternalServerError}
	ErrRegionNotAllowed                              = Error{ID: 196, Status: http.StatusInternalServerError}
)

Existing CDS errors Note: the error id is useless except to ensure objects are different in map

View Source
var (
	BuiltinHookModels = []*WorkflowHookModel{
		&WebHookModel,
		&RepositoryWebHookModel,
		&GitPollerModel,
		&SchedulerModel,
		&KafkaHookModel,
		&RabbitMQHookModel,
		&WorkflowModel,
		&GerritHookModel,
	}

	BuiltinOutgoingHookModels = []*WorkflowHookModel{
		&OutgoingWebHookModel,
		&OutgoingWorkflowModel,
	}

	KafkaHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/kafka",
		Name:       KafkaHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			HookModelIntegration: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeIntegration,
			},
			KafkaHookModelTopic: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	RabbitMQHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/rabbitmq",
		Name:       RabbitMQHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			HookModelIntegration: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeIntegration,
			},
			RabbitMQHookModelQueue: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelExchangeType: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelExchangeName: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelBindingKey: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelConsumerTag: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	WebHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/webhook",
		Name:       WebHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			WebHookModelConfigMethod: {
				Value:        "POST",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	RepositoryWebHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/repositorywebhook",
		Name:       RepositoryWebHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			RepositoryWebHookModelMethod: {
				Value:        "POST",
				Configurable: false,
				Type:         HookConfigTypeString,
			},
			HookConfigEventFilter: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeMultiChoice,
			},
		},
	}

	GitPollerModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/poller",
		Name:       GitPollerModelName,
		Icon:       "git square",
		DefaultConfig: WorkflowNodeHookConfig{
			"payload": {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	SchedulerModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/scheduler",
		Name:       SchedulerModelName,
		Icon:       "fa-clock-o",
		DefaultConfig: WorkflowNodeHookConfig{
			SchedulerModelCron: {
				Value:        "0 * * * *",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			SchedulerModelTimezone: {
				Value:        "UTC",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			Payload: {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	GerritHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/gerrit",
		Name:       GerritHookModelName,
		Icon:       "git",
		DefaultConfig: WorkflowNodeHookConfig{
			HookConfigEventFilter: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeMultiChoice,
			},
		},
	}

	WorkflowModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/workflowhook",
		Name:       WorkflowModelName,
		Icon:       "sitemap",
	}

	OutgoingWebHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/webhook",
		Name:       WebHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			WebHookModelConfigMethod: {
				Value:        "POST",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			"URL": {
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			Payload: {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	OutgoingWorkflowModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/workflowhook",
		Name:       WorkflowModelName,
		Icon:       "sitemap",
		DefaultConfig: WorkflowNodeHookConfig{
			HookConfigTargetProject: {
				Configurable: true,
				Type:         HookConfigTypeProject,
			},
			HookConfigTargetWorkflow: {
				Configurable: true,
				Type:         HookConfigTypeWorkflow,
			},
			HookConfigTargetHook: {
				Configurable: true,
				Type:         HookConfigTypeHook,
			},
			Payload: {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}
)

Here are the default hooks

View Source
var (
	BuiltinIntegrationModels = []*IntegrationModel{
		&KafkaIntegration,
		&RabbitMQIntegration,
		&OpenstackIntegration,
		&AWSIntegration,
		&ArtifactoryIntegration,
	}
	// KafkaIntegration represents a kafka integration
	KafkaIntegration = IntegrationModel{
		Name:       KafkaIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/kafka",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"broker url": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"username": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"password": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			"topic": IntegrationConfigValue{
				Type:        IntegrationConfigTypeString,
				Description: "This is mandatory only if you want to use Event Integration",
			},
		},
		Disabled: false,
		Hook:     true,
		Event:    true,
	}
	// RabbitMQIntegration represents a kafka integration
	RabbitMQIntegration = IntegrationModel{
		Name:       RabbitMQIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/rabbitmq",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"uri": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"username": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"password": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
		},
		Disabled: false,
		Hook:     true,
	}
	// OpenstackIntegration represents an openstack integration
	OpenstackIntegration = IntegrationModel{
		Name:       OpenstackIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/openstack",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"address": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"region": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"domain": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"tenant_name": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"username": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"password": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			"storage_container_prefix": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"storage_temporary_url_supported": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
		},
		Storage:  true,
		Disabled: false,
		Hook:     false,
	}
	// ArtifactoryIntegration represent integration with artifactory
	ArtifactoryIntegration = IntegrationModel{
		Name:       ArtifactoryIntegrationModelName,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/artifactory",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			ArtifactoryConfigPlatform: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigURL: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigTokenName: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigToken: IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			ArtifactoryConfigReleaseToken: IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			ArtifactoryConfigProjectKey: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigCdsRepository: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigPromotionLowMaturity: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigPromotionHighMaturity: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigBuildInfoPrefix: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
		},
		ArtifactManager: true,
	}
	// AWSIntegration represents an aws integration
	AWSIntegration = IntegrationModel{
		Name:       AWSIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/aws",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"region": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"bucket_name": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"prefix": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"access_key_id": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"secret_access_key": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			"endpoint": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"disable_ssl": IntegrationConfigValue{
				Type: IntegrationConfigTypeBoolean,
			},
			"force_path_style": IntegrationConfigValue{
				Type: IntegrationConfigTypeBoolean,
			},
		},
		Storage:  true,
		Disabled: false,
		Hook:     false,
	}
)

Here are the default plateform models

View Source
var (
	FR = lang(language.French)
	EN = lang(language.AmericanEnglish)
)

Supported API language

View Source
var (
	MsgAppCreated                           = &Message{"MsgAppCreated", trad{FR: "L'application %s a été créée avec succès", EN: "Application %s successfully created"}, nil, RunInfoTypInfo}
	MsgAppUpdated                           = &Message{"MsgAppUpdated", trad{FR: "L'application %s a été mise à jour avec succès", EN: "Application %s successfully updated"}, nil, RunInfoTypInfo}
	MsgPipelineCreated                      = &Message{"MsgPipelineCreated", trad{FR: "Le pipeline %s a été créé avec succès", EN: "Pipeline %s successfully created"}, nil, RunInfoTypInfo}
	MsgPipelineCreationAborted              = &Message{"MsgPipelineCreationAborted", trad{FR: "La création du pipeline %s a été abandonnée", EN: "Pipeline %s creation aborted"}, nil, RunInfoTypeError}
	MsgPipelineExists                       = &Message{"MsgPipelineExists", trad{FR: "Le pipeline %s existe déjà", EN: "Pipeline %s already exists"}, nil, RunInfoTypInfo}
	MsgAppVariablesCreated                  = &Message{"MsgAppVariablesCreated", trad{FR: "Les variables ont été ajoutées avec succès sur l'application %s", EN: "Application variables for %s are successfully created"}, nil, RunInfoTypInfo}
	MsgAppKeyCreated                        = &Message{"MsgAppKeyCreated", trad{FR: "La clé %s %s a été créée sur l'application %s", EN: "%s key %s created on application %s"}, nil, RunInfoTypInfo}
	MsgEnvironmentExists                    = &Message{"MsgEnvironmentExists", trad{FR: "L'environnement %s existe déjà", EN: "Environment %s already exists"}, nil, RunInfoTypInfo}
	MsgEnvironmentCreated                   = &Message{"MsgEnvironmentCreated", trad{FR: "L'environnement %s a été créé avec succès", EN: "Environment %s successfully created"}, nil, RunInfoTypInfo}
	MsgEnvironmentVariableUpdated           = &Message{"MsgEnvironmentVariableUpdated", trad{FR: "La variable %s de l'environnement %s a été mise à jour", EN: "Variable %s on environment %s has been updated"}, nil, RunInfoTypInfo}
	MsgEnvironmentVariableCannotBeUpdated   = &Message{"MsgEnvironmentVariableCannotBeUpdated", trad{FR: "La variable %s de l'environnement %s n'a pu être mise à jour : %s", EN: "Variable %s on environment %s cannot be updated: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentVariableCreated           = &Message{"MsgEnvironmentVariableCreated", trad{FR: "La variable %s de l'environnement %s a été ajoutée", EN: "Variable %s on environment %s has been added"}, nil, RunInfoTypInfo}
	MsgEnvironmentVariableCannotBeCreated   = &Message{"MsgEnvironmentVariableCannotBeCreated", trad{FR: "La variable %s de l'environnement %s n'a pu être ajoutée : %s", EN: "Variable %s on environment %s cannot be added: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentGroupUpdated              = &Message{"MsgEnvironmentGroupUpdated", trad{FR: "Le groupe %s de l'environnement %s a été mis à jour", EN: "Group %s on environment %s has been updated"}, nil, RunInfoTypInfo}
	MsgEnvironmentGroupCannotBeUpdated      = &Message{"MsgEnvironmentGroupCannotBeUpdated", trad{FR: "Le groupe %s de l'environnement %s n'a pu être mis à jour : %s", EN: "Group %s on environment %s cannot be updated: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentGroupCreated              = &Message{"MsgEnvironmentGroupCreated", trad{FR: "Le groupe %s de l'environnement %s a été ajouté", EN: "Group %s on environment %s has been added"}, nil, RunInfoTypInfo}
	MsgEnvironmentGroupCannotBeCreated      = &Message{"MsgEnvironmentGroupCannotBeCreated", trad{FR: "Le groupe %s de l'environnement %s n'a pu être ajouté : %s", EN: "Group %s on environment %s cannot be added: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentGroupDeleted              = &Message{"MsgEnvironmentGroupDeleted", trad{FR: "Le groupe %s de l'environnement %s a été supprimé", EN: "Group %s on environment %s has been deleted"}, nil, RunInfoTypInfo}
	MsgEnvironmentGroupCannotBeDeleted      = &Message{"MsgEnvironmentGMsgEnvironmentGroupCannotBeDeletedroupCannotBeCreated", trad{FR: "Le groupe %s de l'environnement %s n'a pu être supprimé : %s", EN: "Group %s on environment %s cannot be deleted: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentKeyCreated                = &Message{"MsgEnvironmentKeyCreated", trad{FR: "La clé %s %s a été créée sur l'environnement %s", EN: "%s key %s created on environment %s"}, nil, RunInfoTypInfo}
	MsgJobNotValidActionNotFound            = &Message{"MsgJobNotValidActionNotFound", trad{FR: "Erreur de validation du Job %s : L'action %s à l'étape %d n'a pas été trouvée", EN: "Job %s validation Failure: Unknown action %s on step #%d"}, nil, RunInfoTypeError}
	MsgJobNotValidInvalidActionParameter    = &Message{"MsgJobNotValidInvalidActionParameter", trad{FR: "Erreur de validation du Job %s : Le paramètre %s de l'étape %d - %s est invalide", EN: "Job %s validation Failure: Invalid parameter %s on step #%d %s"}, nil, RunInfoTypeError}
	MsgPipelineGroupUpdated                 = &Message{"MsgPipelineGroupUpdated", trad{FR: "Les permissions du groupe %s sur le pipeline %s on été mises à jour", EN: "Permission for group %s on pipeline %s has been updated"}, nil, RunInfoTypInfo}
	MsgPipelineGroupAdded                   = &Message{"MsgPipelineGroupAdded", trad{FR: "Les permissions du groupe %s sur le pipeline %s on été ajoutées", EN: "Permission for group %s on pipeline %s has been added"}, nil, RunInfoTypInfo}
	MsgPipelineGroupDeleted                 = &Message{"MsgPipelineGroupDeleted", trad{FR: "Les permissions du groupe %s sur le pipeline %s on été supprimées", EN: "Permission for group %s on pipeline %s has been deleted"}, nil, RunInfoTypInfo}
	MsgPipelineStageUpdated                 = &Message{"MsgPipelineStageUpdated", trad{FR: "Le stage %s a été mis à jour", EN: "Stage %s updated"}, nil, RunInfoTypInfo}
	MsgPipelineStageUpdating                = &Message{"MsgPipelineStageUpdating", trad{FR: "Mise à jour du stage %s en cours...", EN: "Updating stage %s ..."}, nil, RunInfoTypInfo}
	MsgPipelineStageDeletingOldJobs         = &Message{"MsgPipelineStageDeletingOldJobs", trad{FR: "Suppression des anciens jobs du stage %s en cours...", EN: "Deleting old jobs in stage %s ..."}, nil, RunInfoTypInfo}
	MsgPipelineStageInsertingNewJobs        = &Message{"MsgPipelineStageInsertingNewJobs", trad{FR: "Insertion des nouveaux jobs dans le stage %s en cours...", EN: "Inserting new jobs in stage %s ..."}, nil, RunInfoTypInfo}
	MsgPipelineStageAdded                   = &Message{"MsgPipelineStageAdded", trad{FR: "Le stage %s a été ajouté", EN: "Stage %s added"}, nil, RunInfoTypInfo}
	MsgPipelineStageDeleted                 = &Message{"MsgPipelineStageDeleted", trad{FR: "Le stage %s a été supprimé", EN: "Stage %s deleted"}, nil, RunInfoTypInfo}
	MsgPipelineJobUpdated                   = &Message{"MsgPipelineJobUpdated", trad{FR: "Le job %s du stage %s a été mis à jour", EN: "Job %s in stage %s updated"}, nil, RunInfoTypInfo}
	MsgPipelineJobAdded                     = &Message{"MsgPipelineJobAdded", trad{FR: "Le job %s du stage %s a été ajouté", EN: "Job %s in stage %s added"}, nil, RunInfoTypInfo}
	MsgPipelineJobDeleted                   = &Message{"MsgPipelineJobDeleted", trad{FR: "Le job %s du stage %s a été supprimé", EN: "Job %s in stage %s deleted"}, nil, RunInfoTypInfo}
	MsgPipelineDetached                     = &Message{"MsgPipelineDetached", trad{FR: "Le pipeline %s est détaché du repository %s", EN: "The pipeline %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgApplicationDetached                  = &Message{"MsgApplicationDetached", trad{FR: "L'application %s est détachée du repository %s", EN: "The application %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgEnvironmentDetached                  = &Message{"MsgEnvironmentDetached", trad{FR: "L'environnement %s est détaché du repository %s", EN: "The environment %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgWorkflowDetached                     = &Message{"MsgWorkflowDetached", trad{FR: "Le workflow %s est détaché du repository %s", EN: "The workflow %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryStarts              = &Message{"MsgSpawnInfoHatcheryStarts", trad{FR: "La Hatchery %s a démarré le lancement du worker avec le modèle %s", EN: "Hatchery %s starts spawn worker with model %s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryErrorSpawn          = &Message{"MsgSpawnInfoHatcheryErrorSpawn", trad{FR: "Une erreur est survenue lorsque la Hatchery %s a démarré un worker avec le modèle %s après %s, err: %s", EN: "Error while Hatchery %s spawns worker with model %s after %s, err: %s"}, nil, RunInfoTypeError}
	MsgSpawnInfoHatcheryStartDockerPull     = &Message{"MsgSpawnInfoHatcheryStartDockerPull", trad{FR: "La Hatchery %s a démarré le docker pull de l'image %s...", EN: "Hatchery %s starts docker pull %s..."}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryEndDockerPull       = &Message{"MsgSpawnInfoHatcheryEndDockerPull", trad{FR: "La Hatchery %s a terminé le docker pull de l'image %s", EN: "Hatchery %s docker pull %s done"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryEndDockerPullErr    = &Message{"MsgSpawnInfoHatcheryEndDockerPullErr", trad{FR: "⚠ La Hatchery %s a terminé le docker pull de l'image %s en erreur: %s", EN: "⚠ Hatchery %s - docker pull %s done with error: %v"}, nil, RunInfoTypeError}
	MsgSpawnInfoDeprecatedModel             = &Message{"MsgSpawnInfoDeprecatedModel", trad{FR: "⚠ Attention vous utilisez un worker model (%s) déprécié", EN: "⚠ Pay attention you are using a deprecated worker model (%s)"}, nil, RunInfoTypeWarning}
	MsgSpawnInfoWorkerEnd                   = &Message{"MsgSpawnInfoWorkerEnd", trad{FR: "✓ Le worker %s a terminé et a passé %s à travailler sur les étapes", EN: "✓ Worker %s finished working on this job"}, nil, RunInfoTypInfo}
	MsgSpawnInfoJobInQueue                  = &Message{"MsgSpawnInfoJobInQueue", trad{FR: "✓ Le job a été mis en file d'attente", EN: "✓ Job has been queued"}, nil, RunInfoTypInfo}
	MsgSpawnInfoJobTaken                    = &Message{"MsgSpawnInfoJobTaken", trad{FR: "Le job %s a été pris par le worker %s", EN: "Job %s has been taken by worker %s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoJobTakenWorkerVersion       = &Message{"MsgSpawnInfoJobTakenWorkerVersion", trad{FR: "Worker %s version:%s os:%s arch:%s", EN: "Worker %s version:%s os:%s arch:%s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerForJob                = &Message{"MsgSpawnInfoWorkerForJob", trad{FR: "Ce worker %s a été créé pour lancer ce job", EN: "This worker %s was created to take this action"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerForJobError           = &Message{"MsgSpawnInfoWorkerForJobError", trad{FR: "⚠ Ce worker %s a été créé pour lancer ce job, mais ne possède pas tous les pré-requis. Vérifiez que les prérequis suivants:%s", EN: "⚠ This worker %s was created to take this action, but does not have all prerequisites. Please verify the following prerequisites:%s"}, nil, RunInfoTypeError}
	MsgSpawnInfoJobError                    = &Message{"MsgSpawnInfoJobError", trad{FR: "⚠ Impossible de lancer ce job : %s", EN: "⚠ Unable to run this job: %s"}, nil, RunInfoTypInfo}
	MsgWorkflowStarting                     = &Message{"MsgWorkflowStarting", trad{FR: "Le workflow %s#%s a été démarré", EN: "Workflow %s#%s has been started"}, nil, RunInfoTypInfo}
	MsgWorkflowError                        = &Message{"MsgWorkflowError", trad{FR: "⚠ Une erreur est survenue: %v", EN: "⚠ An error has occurred: %v"}, nil, RunInfoTypeError}
	MsgWorkflowConditionError               = &Message{"MsgWorkflowConditionError", trad{FR: "Les conditions de lancement ne sont pas respectées.", EN: "Run conditions aren't ok."}, nil, RunInfoTypInfo}
	MsgWorkflowNodeStop                     = &Message{"MsgWorkflowNodeStop", trad{FR: "Le pipeline a été arrété par %s", EN: "The pipeline has been stopped by %s"}, nil, RunInfoTypInfo}
	MsgWorkflowNodeMutex                    = &Message{"MsgWorkflowNodeMutex", trad{FR: "Le pipeline %s est mis en attente tant qu'il est en cours sur un autre run", EN: "The pipeline %s is waiting while it's running on another run"}, nil, RunInfoTypInfo}
	MsgWorkflowNodeMutexRelease             = &Message{"MsgWorkflowNodeMutexRelease", trad{FR: "Lancement du pipeline %s", EN: "Triggering pipeline %s"}, nil, RunInfoTypInfo}
	MsgWorkflowImportedUpdated              = &Message{"MsgWorkflowImportedUpdated", trad{FR: "Le workflow %s a été mis à jour", EN: "Workflow %s has been updated"}, nil, RunInfoTypInfo}
	MsgWorkflowImportedInserted             = &Message{"MsgWorkflowImportedInserted", trad{FR: "Le workflow %s a été créé", EN: "Workflow %s has been created"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryCannotStartJob      = &Message{"MsgSpawnInfoHatcheryCannotStart", trad{FR: "Aucune hatchery n'a pu démarrer de worker respectant vos pré-requis de job, merci de les vérifier.", EN: "No hatchery can spawn a worker corresponding your job's requirements. Please check your job's requirements."}, nil, RunInfoTypeWarning}
	MsgWorkflowRunBranchDeleted             = &Message{"MsgWorkflowRunBranchDeleted", trad{FR: "La branche %s  a été supprimée", EN: "Branch %s has been deleted"}, nil, RunInfoTypInfo}
	MsgWorkflowTemplateImportedInserted     = &Message{"MsgWorkflowTemplateImportedInserted", trad{FR: "Le template de workflow %s/%s a été créé", EN: "Workflow template %s/%s has been created"}, nil, RunInfoTypInfo}
	MsgWorkflowTemplateImportedUpdated      = &Message{"MsgWorkflowTemplateImportedUpdated", trad{FR: "Le template de workflow %s/%s a été mis à jour", EN: "Workflow template %s/%s has been updated"}, nil, RunInfoTypInfo}
	MsgWorkflowErrorBadPipelineName         = &Message{"MsgWorkflowErrorBadPipelineName", trad{FR: "Le pipeline %s indiqué dans votre fichier yaml de workflow n'existe pas", EN: "The pipeline %s mentioned in your workflow's yaml file doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadApplicationName      = &Message{"MsgWorkflowErrorBadApplicationName", trad{FR: "L'application %s indiquée dans votre fichier yaml de workflow n'existe pas ou ne correspond pas aux normes ^[a-zA-Z0-9._-]{1,}$", EN: "The application %s mentioned in your workflow's yaml file doesn't exist or is incorrect with ^[a-zA-Z0-9._-]{1,}$"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadEnvironmentName      = &Message{"MsgWorkflowErrorBadEnvironmentName", trad{FR: "L'environnement %s indiqué dans votre fichier yaml de workflow n'existe pas", EN: "The environment %s mentioned in your workflow's yaml file doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadIntegrationName      = &Message{"MsgWorkflowErrorBadIntegrationName", trad{FR: "L'intégration %s indiquée dans votre fichier yaml n'existe pas", EN: "The integration %s mentioned in your yaml file doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadCdsDir               = &Message{"MsgWorkflowErrorBadCdsDir", trad{FR: "Un problème est survenu avec votre répertoire .cds", EN: "A problem occurred about your .cds directory"}, nil, RunInfoTypeError}
	MsgWorkflowErrorUnknownKey              = &Message{"MsgWorkflowErrorUnknownKey", trad{FR: "La clé '%s' est incorrecte ou n'existe pas", EN: "The key '%s' is incorrect or doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadVCSStrategy          = &Message{"MsgWorkflowErrorBadVCSStrategy", trad{FR: "Vos informations vcs_* sont incorrectes", EN: "Your vcs_* fields are incorrects"}, nil, RunInfoTypeError}
	MsgWorkflowDeprecatedVersion            = &Message{"MsgWorkflowDeprecatedVersion", trad{FR: "La configuration yaml de votre workflow est dans un format déprécié. Exportez le avec la CLI `cdsctl workflow export %s %s`", EN: "The yaml workflow configuration format is deprecated. Export your workflow with CLI `cdsctl workflow export %s %s`"}, nil, RunInfoTypeWarning}
	MsgWorkflowGeneratedFromTemplateVersion = &Message{"MsgWorkflowGeneratedFromTemplateVersion", trad{FR: "Le workflow a été généré à partir du modèle de workflow: %s", EN: "The workflow was generated from the template: %s"}, nil, RunInfoTypInfo}
	MsgTooMuchWorkflowRun                   = &Message{"MsgTooMuchWorkflowRun", trad{FR: "L'exécution de ce workflow est suspendu. Vous dépassez le nombre maximum d'éxécution autorisé (%.f). Merci de revoir la politique de retention de ce workflow", EN: "Workflow run is delayed. The maximum number of runs for this workflow has been reached ( %.f ). Please update your workflow retention policy"}, nil, RunInfoTypeWarning}
	MsgSpawnErrorHatcheryRetryAttempt       = &Message{"MsgSpawnErrorHatcheryRetryAttempt", trad{EN: "Job execution failed by hatchery %s. Reason: %s"}, nil, RunInfoTypeError}
	MsgWorkflowV3Preview                    = &Message{"MsgWorkflowV3Preview", trad{FR: "Le workflow a été généré en version 3 à partir d'une ancienne version", EN: "The workflow was generated in version 3 from an old version"}, nil, RunInfoTypeWarning}
)

Message list

View Source
var (
	UserNotificationTemplateEmail = UserNotificationTemplate{
		Subject: "{{.cds.project}}/{{.cds.workflow}}#{{.cds.version}} {{.cds.status}}",
		Body: `Project : {{.cds.project}}
Workflow : {{.cds.workflow}}#{{.cds.version}}
Pipeline : {{.cds.node}}
Status : {{.cds.status}}
Details : {{.cds.buildURL}}
Triggered by : {{.cds.triggered_by.username}}
Branch : {{.git.branch | default "n/a"}}`,
	}

	UserNotificationTemplateJabber = UserNotificationTemplate{
		Subject: "{{.cds.project}}/{{.cds.workflow}}#{{.cds.version}} {{.cds.status}}",
		Body:    `{{.cds.buildURL}}`,
	}

	UserNotificationTemplateMap = map[string]UserNotificationTemplate{
		EmailUserNotification:  UserNotificationTemplateEmail,
		JabberUserNotification: UserNotificationTemplateJabber,
		VCSUserNotification: {
			Body: DefaultWorkflowNodeRunReport,
		},
	}
)

Default template values

View Source
var (
	// AvailableRequirementsType List of all requirements
	AvailableRequirementsType = []string{
		BinaryRequirement,
		HostnameRequirement,
		MemoryRequirement,
		ModelRequirement,
		OSArchRequirement,
		PluginRequirement,
		RegionRequirement,
		ServiceRequirement,
	}

	// OSArchRequirementValues comes from go tool dist list
	OSArchRequirementValues = RequirementList{
		{Name: "linux/amd64", Type: OSArchRequirement, Value: "linux/amd64"},
		{Name: "linux/386", Type: OSArchRequirement, Value: "linux/386"},

		{Name: "darwin/amd64", Type: OSArchRequirement, Value: "darwin/amd64"},

		{Name: "freebsd/386", Type: OSArchRequirement, Value: "freebsd/386"},
		{Name: "freebsd/amd64", Type: OSArchRequirement, Value: "freebsd/amd64"},

		{Name: "linux/arm64", Type: OSArchRequirement, Value: "linux/arm64"},

		{Name: "netbsd/386", Type: OSArchRequirement, Value: "netbsd/386"},
		{Name: "netbsd/amd64", Type: OSArchRequirement, Value: "netbsd/amd64"},

		{Name: "openbsd/386", Type: OSArchRequirement, Value: "openbsd/386"},
		{Name: "openbsd/amd64", Type: OSArchRequirement, Value: "openbsd/amd64"},

		{Name: "windows/386", Type: OSArchRequirement, Value: "windows/386"},
		{Name: "windows/amd64", Type: OSArchRequirement, Value: "windows/amd64"},
	}
)
View Source
var (
	// AvailableVariableType list all existing variable type in CDS
	AvailableVariableType = []string{
		SecretVariable,
		TextVariable,
		StringVariable,
		BooleanVariable,
		NumberVariable,
	}

	BasicVariableNames = []string{
		"cds.version",
		"cds.application",
		"cds.environment",
		"cds.job",
		"cds.manual",
		"cds.pipeline",
		"cds.project",
		"cds.run",
		"cds.run.number",
		"cds.run.subnumber",
		"cds.stage",
		"cds.triggered_by.email",
		"cds.triggered_by.fullname",
		"cds.triggered_by.username",
		"cds.ui.pipeline.run",
		"cds.worker",
		"cds.workflow",
		"cds.workspace",
		"payload",
	}

	BasicGitVariableNames = []string{
		"git.repository",
		"git.branch",
		"git.message",
		"git.author",
		"git.hash",
		"git.hash.short",
		"git.url",
		"git.http_url",
		"git.server",
	}
)
View Source
var (
	BitbucketEvents = []string{
		"repo:refs_changed",
		"repo:modified",
		"repo:forked",
		"repo:comment:added",
		"repo:comment:edited",
		"repo:comment:deleted",
		"pr:from_ref_updated",
		"pr:opened",
		"pr:modified",
		"pr:reviewer:updated",
		"pr:reviewer:approved",
		"pr:reviewer:unapproved",
		"pr:reviewer:needs_work",
		"pr:merged",
		"pr:declined",
		"pr:deleted",
		"pr:comment:added",
		"pr:comment:edited",
		"pr:comment:deleted",
	}

	BitbucketEventsDefault = []string{
		"repo:refs_changed",
	}

	BitbucketCloudEvents = []string{
		"repo:push",
		"pullrequest:unapproved",
		"issue:comment_created",
		"pullrequest:approved",
		"repo:created",
		"repo:deleted",
		"repo:imported",
		"pullrequest:comment_updated",
		"issue:updated",
		"project:updated",
		"pullrequest:comment_created",
		"repo:commit_status_updated",
		"pullrequest:updated",
		"issue:created",
		"repo:fork",
		"pullrequest:comment_deleted",
		"repo:commit_status_created",
		"repo:updated",
		"pullrequest:rejected",
		"pullrequest:fulfilled",
		"pullrequest:created",
		"repo:transfer",
		"repo:commit_comment_created",
	}

	BitbucketCloudEventsDefault = []string{
		"repo:push",
	}

	GitHubEvents = []string{
		"push",
		"check_run",
		"check_suite",
		"commit_comment",
		"create",
		"delete",
		"deployment",
		"deployment_status",
		"fork",
		"github_app_authorization",
		"gollum",
		"installation",
		"installation_repositories",
		"issue_comment",
		"issues",
		"label",
		"marketplace_purchase",
		"member",
		"membership",
		"milestone",
		"organization",
		"org_block",
		"page_build",
		"project_card",
		"project_column",
		"project",
		"public",
		"pull_request_review_comment",
		"pull_request_review",
		"pull_request",
		"repository",
		"repository_import",
		"repository_vulnerability_alert",
		"release",
		"security_advisory",
		"status",
		"team",
		"team_add",
		"watch",
	}

	GitHubEventsDefault = []string{
		"push",
	}

	GitlabEventsDefault = []string{
		"Push Hook",
		"Tag Push Hook",
	}

	GerritEvents = []string{
		GerritEventTypePatchsetCreated,
		GerritEventTypeAssignedChanged,
		GerritEventTypeChangeAbandoned,
		GerritEventTypeChangeDeleted,
		GerritEventTypeChangeMerged,
		GerritEventTypeChangeRestored,
		GerritEventTypeCommentAdded,
		GerritEventTypeDrafPublished,
		GerritEventTypeDroppedOutput,
		GerritEventTypeHashTagsChanged,
		GerritEventTypeProjectCreated,
		GerritEventTypeRefUpdated,
		GerritEventTypeReviewerAdded,
		GerritEventTypeReviewerDelete,
		GerritEventTypeTopicChanged,
		GerritEventTypeWIPStateChanged,
		GerritEventTypePrivateStateChanged,
		GerritEventTypeVoteDeleted,
	}

	GerritEventTypeAssignedChanged     = "assignee-changed"
	GerritEventTypeChangeAbandoned     = "change-abandoned"
	GerritEventTypeChangeDeleted       = "change-deleted"
	GerritEventTypeChangeMerged        = "change-merged"
	GerritEventTypeChangeRestored      = "change-restored"
	GerritEventTypeCommentAdded        = "comment-added"
	GerritEventTypeDrafPublished       = "draft-published"
	GerritEventTypeDroppedOutput       = "dropped-output"
	GerritEventTypeHashTagsChanged     = "hashtags-changed"
	GerritEventTypeProjectCreated      = "project-created"
	GerritEventTypePatchsetCreated     = "patchset-created"
	GerritEventTypeRefUpdated          = "ref-updated"
	GerritEventTypeReviewerAdded       = "reviewer-added"
	GerritEventTypeReviewerDelete      = "reviewer-deleted"
	GerritEventTypeTopicChanged        = "topic-changed"
	GerritEventTypeWIPStateChanged     = "wip-state-changed"
	GerritEventTypePrivateStateChanged = "private-state-changed"
	GerritEventTypeVoteDeleted         = "vote-deleted"

	GerritEventsDefault = []string{
		GerritEventTypePatchsetCreated,
	}
)
View Source
var (
	//VERSION is set with -ldflags "-X github.com/ovh/cds/sdk.VERSION=$(VERSION)"
	VERSION = "snapshot"

	//GOOS is set with -ldflags "-X github.com/ovh/cds/sdk.GOOS=$(GOOS)"
	GOOS = ""

	//GOARCH is set with -ldflags "-X github.com/ovh/cds/sdk.GOARCH=$(GOARCH)"
	GOARCH = ""

	//GITHASH is set with -ldflags "-X github.com/ovh/cds/sdk.GITHASH=$(GITHASH)"
	GITHASH = ""

	//BUILDTIME is set with -ldflags "-X github.com/ovh/cds/sdk.BUILDTIME=$(BUILDTIME)"
	BUILDTIME = ""

	//BINARY is set with -ldflags "-X github.com/ovh/cds/sdk.BINARY=$(BINARY)"
	BINARY = ""

	//DBMIGRATE is set with -ldflags "-X github.com/ovh/cds/sdk.DBMIGRATE=$(DBMIGRATE)"
	// this flag contains the number of sql files to migrate for this version
	DBMIGRATE = ""
)
View Source
var (
	WorkflowRunHeader = "X-Workflow-Run"
	WorkflowHeader    = "X-Workflow"
	ProjectKeyHeader  = "X-Project-Key"
)

AuthConsumerScopes list.

View Source
var (
	// AvailableParameterType list all existing parameters type in CDS
	AvailableParameterType = []string{
		StringParameter,
		NumberParameter,
		TextParameter,
		EnvironmentParameter,
		BooleanParameter,
		ListParameter,
		PipelineParameter,
		KeySSHParameter,
		KeyPGPParameter,
		KeyParameter,
	}
)
View Source
var (
	// AvailableWorkerModelType List of all worker model type
	AvailableWorkerModelType = []string{
		string(Docker),
		string(HostProcess),
		string(Openstack),
		string(VSphere),
	}
)
View Source
var ColorRegexp = regexp.MustCompile(`^#\w{3,8}$`)

ColorRegexp represent the regexp for a format to hexadecimal color

View Source
var ErrExecutableNotFound = errors.New("executable file not found in $PATH")

ErrExecutableNotFound is the error resulting if a path search failed to find an executable file.

View Source
var MapMergeOptions = struct {
	// Function to exclude git parameters
	ExcludeGitParams CheckFunc
}{
	ExcludeGitParams: excludeGitParams,
}

MapMergeOptions options for mapMerge functions

View Source
var MessageAmericanEnglish = map[string]string{
	WarningMissingProjectVariableEnv:               `Variable {{index . "VarName"}} is used by environment {{index . "EnvironmentName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableApplication:       `Variable {{index . "VarName"}} is used by application {{index . "ApplicationName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineParameter: `Variable {{index . "VarName"}} is used by parameter in pipeline {{index . "PipelineName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineJob:       `Variable {{index . "VarName"}} is used in pipeline {{index . "PipelineName"}}, in stage {{index . "StageName"}} by job {{index . "JobName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableWorkflow:          `Variable {{index . "VarName"}} is used by the workflow {{index . "WorkflowName"}} in Pipeline {{index . "NodeName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectVariable:                   `Unused variable {{index . "VarName"}} on project {{index . "ProjectKey"}}.`,
	WarningMissingProjectPermissionEnv:             `Group {{index . "GroupName"}} is not on project {{index . "ProjectKey"}} but is used on Environment {{index . "EnvironmentName"}}.`,
	WarningMissingProjectPermissionWorkflow:        `Group {{index . "GroupName"}} is not on project {{index . "ProjectKey"}} but is used on Workflow {{index . "WorkflowName"}}.`,
	WarningMissingProjectKeyApplication:            `Key {{index . "KeyName"}} is used by application {{index . "ApplicationName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineParameter:      `Key {{index . "KeyName"}} is used by a parameter in pipeline {{index . "PipelineName"}}  but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineJob:            `Key {{index . "KeyName"}} is used by pipeline {{index . "PipelineName"}} in stage {{index . "StageName"}} in job {{index . "JobName"}}  but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectKey:                        `Unused key {{index . "KeyName"}} on project {{index . "ProjectKey"}}.`,
	WarningMissingProjectVCSServer:                 `Repository manager {{index . "VCSName"}} is used by Application: "{{index . "ApplicationName"}}" but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectVCSServer:                  `Unused repository manager {{index . "VCSName"}} on project {{index . "ProjectKey"}}.`,
	WarningMissingVCSConfiguration:                 `CDS variables .git.* are used but there is no repository manager on project {{index . "ProjectKey"}}`,
	WarningMissingApplicationVariable:              `Variable {{index . "VarName"}} is used but does not exist on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationVariable:               `Unused variable {{index . "VarName"}} on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingApplicationKey:                   `Key {{index . "KeyName"}} is used but does not exist on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationKey:                    `Unused key {{index . "KeyName"}} on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingEnvironmentVariable:              `Variable {{index . "VarName"}} is used but does not exist on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentVariable:               `Unused variable {{index . "VarName"}} on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingEnvironmentKey:                   `Key {{index . "KeyName"}} is used but does not exist on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentKey:                    `Unused key {{index . "KeyName"}} on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingPipelineParameter:                `Parameter {{index . "ParamName"}} is used but does not exist on project/pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}`,
	WarningUnusedPipelineParameter:                 `Unused parameter {{index . "ParamName"}} on project/pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}.`,
}
View Source
var MessageFrench = map[string]string{
	WarningMissingProjectVariableEnv:               `La variable {{index . "VarName"}} est utilisée par l'environment {{index . "EnvironmentName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableApplication:       `La variable {{index . "VarName"}} est utilisée par l'application {{index . "ApplicationName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineParameter: `La variable {{index . "VarName"}} est utilisée par les paramètre du pipeline {{index . "PipelineName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineJob:       `La variable {{index . "VarName"}} est utilisée par le pipeline {{index . "PipelineName"}}, dans le stage {{index . "StageName"}} dans le job {{index . "JobName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableWorkflow:          `La variable {{index . "VarName"}} est utilisée par le workflow {{index . "WorkflowName"}} par le pipeline {{index . "NodeName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningUnusedProjectVariable:                   `La variable {{index . "VarName"}} est inutilisée dans le projet {{index . "ProjectKey"}}.`,
	WarningMissingProjectPermissionEnv:             `Le groupe {{index . "GroupName"}} n'a pas accès au projet {{index . "ProjectKey"}} mais est positionné sur l'environment {{index . "EnvironmentName"}}.`,
	WarningMissingProjectPermissionWorkflow:        `Le groupe {{index . "GroupName"}} n'a pas accès au projet {{index . "ProjectKey"}} mais est positionné sur le workflow {{index . "WorkflowName"}}.`,
	WarningMissingProjectKeyApplication:            `La clé {{index . "KeyName"}} est utilisée dans l'application {{index . "ApplicationName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineParameter:      `La clé {{index . "KeyName"}} est utilisée dans le pipeline {{index . "PipelineName"}}  mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineJob:            `La clé {{index . "KeyName"}} est utilisée dans le pipeline {{index . "PipelineName"}} dans le stage {{index . "StageName"}} dans le job {{index . "JobName"}}  but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectKey:                        `La clé {{index . "KeyName"}} est inutilisé dans le projet {{index . "ProjectKey"}}.`,
	WarningMissingProjectVCSServer:                 `Le gestionnaire de dépôt {{index . "VCSName"}} est utilisés par l'application' : "{{index . "ApplicationName"}}" mais n'existe pas sur le projet {{index . "ProjectKey"}}`,
	WarningUnusedProjectVCSServer:                  `Le gestionnaire de dépôt {{index . "VCSName"}} est inutilisé dans le project {{index . "ProjectKey"}}`,
	WarningMissingVCSConfiguration:                 `Les variables CDS git.* sont utilisées mais aucun repository manager n'est lié au projet {{index . "ProjectKey"}}`,
	WarningMissingApplicationVariable:              `La variable {{index . "VarName"}} est utilisée mais n'existe pas dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationVariable:               `La variable {{index . "VarName"}} est inutilisée dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingApplicationKey:                   `La clé {{index . "KeyName"}} est utilisée mais n'existe pas dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationKey:                    `La clé {{index . "KeyName"}} est inutilisée dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingEnvironmentVariable:              `La variable {{index . "VarName"}} est utilisée mais n'existe pas dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentVariable:               `La variable {{index . "VarName"}} est inutilisée dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingEnvironmentKey:                   `La clé {{index . "KeyName"}} est utilisée mais n'existe pas dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentKey:                    `La clé {{index . "KeyName"}} est inutilisée dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingPipelineParameter:                `Le paramètre {{index . "ParamName"}} est utilisé mais n'existe pas dans le pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}`,
	WarningUnusedPipelineParameter:                 `Le paramètre {{index . "ParamName"}} est inutilisé dans le pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}.`,
}
View Source
var Messages = map[string]*Message{
	MsgAppCreated.ID:                           MsgAppCreated,
	MsgAppUpdated.ID:                           MsgAppUpdated,
	MsgPipelineCreated.ID:                      MsgPipelineCreated,
	MsgPipelineCreationAborted.ID:              MsgPipelineCreationAborted,
	MsgPipelineExists.ID:                       MsgPipelineExists,
	MsgAppVariablesCreated.ID:                  MsgAppVariablesCreated,
	MsgAppKeyCreated.ID:                        MsgAppKeyCreated,
	MsgEnvironmentExists.ID:                    MsgEnvironmentExists,
	MsgEnvironmentCreated.ID:                   MsgEnvironmentCreated,
	MsgEnvironmentVariableUpdated.ID:           MsgEnvironmentVariableUpdated,
	MsgEnvironmentVariableCannotBeUpdated.ID:   MsgEnvironmentVariableCannotBeUpdated,
	MsgEnvironmentVariableCreated.ID:           MsgEnvironmentVariableCreated,
	MsgEnvironmentVariableCannotBeCreated.ID:   MsgEnvironmentVariableCannotBeCreated,
	MsgEnvironmentGroupUpdated.ID:              MsgEnvironmentGroupUpdated,
	MsgEnvironmentGroupCannotBeUpdated.ID:      MsgEnvironmentGroupCannotBeUpdated,
	MsgEnvironmentGroupCreated.ID:              MsgEnvironmentGroupCreated,
	MsgEnvironmentGroupCannotBeCreated.ID:      MsgEnvironmentGroupCannotBeCreated,
	MsgEnvironmentGroupDeleted.ID:              MsgEnvironmentGroupDeleted,
	MsgEnvironmentGroupCannotBeDeleted.ID:      MsgEnvironmentGroupCannotBeDeleted,
	MsgEnvironmentKeyCreated.ID:                MsgEnvironmentKeyCreated,
	MsgJobNotValidActionNotFound.ID:            MsgJobNotValidActionNotFound,
	MsgJobNotValidInvalidActionParameter.ID:    MsgJobNotValidInvalidActionParameter,
	MsgPipelineGroupUpdated.ID:                 MsgPipelineGroupUpdated,
	MsgPipelineGroupAdded.ID:                   MsgPipelineGroupAdded,
	MsgPipelineGroupDeleted.ID:                 MsgPipelineGroupDeleted,
	MsgPipelineStageUpdated.ID:                 MsgPipelineStageUpdated,
	MsgPipelineStageUpdating.ID:                MsgPipelineStageUpdating,
	MsgPipelineStageDeletingOldJobs.ID:         MsgPipelineStageDeletingOldJobs,
	MsgPipelineStageInsertingNewJobs.ID:        MsgPipelineStageInsertingNewJobs,
	MsgPipelineStageAdded.ID:                   MsgPipelineStageAdded,
	MsgPipelineStageDeleted.ID:                 MsgPipelineStageDeleted,
	MsgPipelineJobUpdated.ID:                   MsgPipelineJobUpdated,
	MsgPipelineJobAdded.ID:                     MsgPipelineJobAdded,
	MsgPipelineJobDeleted.ID:                   MsgPipelineJobDeleted,
	MsgPipelineDetached.ID:                     MsgPipelineDetached,
	MsgApplicationDetached.ID:                  MsgApplicationDetached,
	MsgEnvironmentDetached.ID:                  MsgEnvironmentDetached,
	MsgWorkflowDetached.ID:                     MsgWorkflowDetached,
	MsgSpawnInfoHatcheryStarts.ID:              MsgSpawnInfoHatcheryStarts,
	MsgSpawnInfoHatcheryErrorSpawn.ID:          MsgSpawnInfoHatcheryErrorSpawn,
	MsgSpawnInfoHatcheryStartDockerPull.ID:     MsgSpawnInfoHatcheryStartDockerPull,
	MsgSpawnInfoHatcheryEndDockerPull.ID:       MsgSpawnInfoHatcheryEndDockerPull,
	MsgSpawnInfoHatcheryEndDockerPullErr.ID:    MsgSpawnInfoHatcheryEndDockerPullErr,
	MsgSpawnInfoDeprecatedModel.ID:             MsgSpawnInfoDeprecatedModel,
	MsgSpawnInfoWorkerEnd.ID:                   MsgSpawnInfoWorkerEnd,
	MsgSpawnInfoJobInQueue.ID:                  MsgSpawnInfoJobInQueue,
	MsgSpawnInfoJobTaken.ID:                    MsgSpawnInfoJobTaken,
	MsgSpawnInfoJobTakenWorkerVersion.ID:       MsgSpawnInfoJobTakenWorkerVersion,
	MsgSpawnInfoWorkerForJob.ID:                MsgSpawnInfoWorkerForJob,
	MsgSpawnInfoWorkerForJobError.ID:           MsgSpawnInfoWorkerForJobError,
	MsgSpawnInfoJobError.ID:                    MsgSpawnInfoJobError,
	MsgWorkflowStarting.ID:                     MsgWorkflowStarting,
	MsgWorkflowError.ID:                        MsgWorkflowError,
	MsgWorkflowConditionError.ID:               MsgWorkflowConditionError,
	MsgWorkflowNodeStop.ID:                     MsgWorkflowNodeStop,
	MsgWorkflowNodeMutex.ID:                    MsgWorkflowNodeMutex,
	MsgWorkflowNodeMutexRelease.ID:             MsgWorkflowNodeMutexRelease,
	MsgWorkflowImportedUpdated.ID:              MsgWorkflowImportedUpdated,
	MsgWorkflowImportedInserted.ID:             MsgWorkflowImportedInserted,
	MsgSpawnInfoHatcheryCannotStartJob.ID:      MsgSpawnInfoHatcheryCannotStartJob,
	MsgWorkflowRunBranchDeleted.ID:             MsgWorkflowRunBranchDeleted,
	MsgWorkflowTemplateImportedInserted.ID:     MsgWorkflowTemplateImportedInserted,
	MsgWorkflowTemplateImportedUpdated.ID:      MsgWorkflowTemplateImportedUpdated,
	MsgWorkflowErrorBadPipelineName.ID:         MsgWorkflowErrorBadPipelineName,
	MsgWorkflowErrorBadApplicationName.ID:      MsgWorkflowErrorBadApplicationName,
	MsgWorkflowErrorBadEnvironmentName.ID:      MsgWorkflowErrorBadEnvironmentName,
	MsgWorkflowErrorBadIntegrationName.ID:      MsgWorkflowErrorBadIntegrationName,
	MsgWorkflowErrorBadCdsDir.ID:               MsgWorkflowErrorBadCdsDir,
	MsgWorkflowErrorUnknownKey.ID:              MsgWorkflowErrorUnknownKey,
	MsgWorkflowErrorBadVCSStrategy.ID:          MsgWorkflowErrorBadVCSStrategy,
	MsgWorkflowDeprecatedVersion.ID:            MsgWorkflowDeprecatedVersion,
	MsgWorkflowGeneratedFromTemplateVersion.ID: MsgWorkflowGeneratedFromTemplateVersion,
	MsgTooMuchWorkflowRun.ID:                   MsgTooMuchWorkflowRun,
	MsgSpawnErrorHatcheryRetryAttempt.ID:       MsgSpawnErrorHatcheryRetryAttempt,
	MsgWorkflowV3Preview.ID:                    MsgWorkflowV3Preview,
}

Messages contains all sdk Messages

View Source
var NamePatternRegex = regexp.MustCompile(NamePattern)

NamePatternRegex Pattern regexp

View Source
var NamePatternSpaceRegex = regexp.MustCompile(NamePatternSpace)

NamePatternSpaceRegex Pattern regexp

View Source
var SIGINFO = unix.SIGUSR1
View Source
var (
	SupportedLanguages = []language.Tag{
		language.AmericanEnglish,
		language.French,
	}
)

SupportedLanguages on API errors

WorkflowData conditions operator

Functions

func ActionInfoMarkdown

func ActionInfoMarkdown(a Action, filename string) string

ActionInfoMarkdown returns string formatted with markdown.

func ActionsToGroupIDs

func ActionsToGroupIDs(as []*Action) []int64

ActionsToGroupIDs returns group ids for given actions list.

func ActionsToIDs

func ActionsToIDs(as []*Action) []int64

ActionsToIDs returns ids for given actions list.

func AddParameter

func AddParameter(array *[]Parameter, name string, parameterType string, value string)

AddParameter append a parameter in a parameter array

func AddRequirement

func AddRequirement(array *RequirementList, id int64, name string, requirementType string, value string)

AddRequirement append a requirement in a requirement array

func AllowIntegrationInVariable

func AllowIntegrationInVariable(model IntegrationModel) bool

func AuthConsumersToAuthentifiedUserIDs

func AuthConsumersToAuthentifiedUserIDs(cs []*AuthConsumer) []string

AuthConsumersToAuthentifiedUserIDs returns ids of given auth consumers.

func AuthConsumersToIDs

func AuthConsumersToIDs(cs []AuthConsumer) []string

AuthConsumersToIDs returns ids of given auth consumers.

func AuthentifiedUsersToIDs

func AuthentifiedUsersToIDs(users []*AuthentifiedUser) []string

AuthentifiedUsersToIDs returns ids for given authentified user list.

func BinaryFilename

func BinaryFilename(name, os, arch, variant string) string

BinaryFilename returns artifact name cds-name-os-arch-variant this name is used on Github Releases

func Cause

func Cause(err error) error

Cause returns recursively the root error from given error.

func CheckContentTypeBinary

func CheckContentTypeBinary(resp *http.Response) error

CheckContentTypeBinary returns an error if Content-Type is not application/octet-stream

func ComputeWorkerModelPath

func ComputeWorkerModelPath(groupName, modelName string) string

ComputeWorkerModelPath returns path for a worker model with given group name and model name.

func ContextWithStacktrace

func ContextWithStacktrace(ctx context.Context, err error) context.Context

func CreateTarFromPaths

func CreateTarFromPaths(fs afero.Fs, cwd string, paths []string, w io.Writer, opts *TarOptions) error

CreateTarFromPaths returns a tar formatted reader of a tar made of several path

func DecodeError

func DecodeError(data []byte) error

DecodeError return an Error struct from json

func DefaultIfEmptyStorage

func DefaultIfEmptyStorage(integrationName string) string

DefaultIfEmptyStorage return sdk.DefaultStorageIntegrationName if integrationName is empty

func DeleteEmptyValueFromArray

func DeleteEmptyValueFromArray(array []string) []string

DeleteEmptyValueFromArray deletes empty value from an array of string

func DeleteFromArray

func DeleteFromArray(array []string, el string) []string

DeleteFromArray deletes value from an array of string

func DeleteFromInt64Array

func DeleteFromInt64Array(array []int64, el int64) []int64

DeleteFromArray deletes value from an array of int64

func DirectoryExists

func DirectoryExists(path string) (bool, error)

DirectoryExists checks if the directory exists

func DownloadFromGitHub

func DownloadFromGitHub(ctx context.Context, directory, filename string, version string) error

func DownloadURLFromGithub

func DownloadURLFromGithub(filename string, version string) (string, error)

func EnvVartoENV

func EnvVartoENV(p Parameter) []string

func ErrorIs

func ErrorIs(err error, target Error) bool

ErrorIs returns true if error match the target error.

func ErrorIsUnknown

func ErrorIsUnknown(err error) bool

ErrorIsUnknown returns true the error is unknown (sdk.ErrUnknownError or lib error).

func ErrorWithFallback

func ErrorWithFallback(err error, httpError Error, from string, args ...interface{}) error

ErrorWithFallback returns the current error if it's not a ErrUnknownError else it returns a new ErrorWithStack

func Exit

func Exit(format string, args ...interface{})

Exit func display an error message on stderr and exit 1

func FileMd5sum

func FileMd5sum(filePath string) (string, error)

FileMd5sum returns the md5sum of a file

func FileSHA512sum

func FileSHA512sum(filePath string) (string, error)

FileSHA512sum returns the sha512sum of a file

func FormatDateRFC5322

func FormatDateRFC5322(date time.Time) string

FormatDateRFC5322 format an RFC 5322 date string.

func GenerateHash

func GenerateHash() (string, error)

func GenerateProjectDefaultKeyName

func GenerateProjectDefaultKeyName(projectKey string, t KeyType) string

func GetContentType

func GetContentType(resp *http.Response) string

GetContentType returns the content-type header from a http.Response

func GetIntegrationVariablePrefix

func GetIntegrationVariablePrefix(model IntegrationModel) string

func GoroutineID

func GoroutineID() uint64

func GroupPointersToIDs

func GroupPointersToIDs(gs []*Group) []int64

GroupPointersToIDs returns ids of given groups.

func IPinRange

func IPinRange(ctx context.Context, IPrange string) ([]string, error)

IPinRange returns a slice of all IP in given IP range i.e 10.35.11.240/28

func IPinRanges

func IPinRanges(ctx context.Context, IPranges string) ([]string, error)

IPinRanges returns a slice of all IP in all given IP ranges i.e 72.44.1.240/28,72.42.1.23/27

func InitSupportedOSArch

func InitSupportedOSArch(supportedOSArchConf []string) error

func IntMapToSlice

func IntMapToSlice(m map[int64]struct{}) []int64

IntMapToSlice converts a map struct to a slice for int64 keys

func InterfaceSlice

func InterfaceSlice(slice interface{}) []interface{}

InterfaceSlice cast a untyped slice into a slice of untypes things. It will panic if the parameter is not a slice

func IsDownloadedBinary

func IsDownloadedBinary(directoriesDownload, filename string) bool

IsDownloadedBinary returns true if the binary is already downloaded, false otherwise

func IsErrorWithStack

func IsErrorWithStack(err error) bool

IsErrorWithStack returns true if given error is an errorWithStack.

func IsGz

func IsGz(buf []byte) bool

IsGz returns true if the content is gzipped

func IsInArray

func IsInArray(elt string, array []string) bool

IsInArray checks if the element is in the array

func IsInInt64Array

func IsInInt64Array(elt int64, array []int64) bool

IsInInt64Array checks if the element is in the array (int64)

func IsTar

func IsTar(buf []byte) bool

IsTar returns true if the content is a tar

func IsURL

func IsURL(path string) bool

IsURL returns if given path is a url according to the URL regex.

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail Check if user email address is ok

func IsValidPermissionValue

func IsValidPermissionValue(v int) bool

IsValidPermissionValue checks that given permission int value match an exiting level.

func IsValidUUID

func IsValidUUID(uu string) bool

func IsValidUsername

func IsValidUsername(username string) error

func JSONUnmarshal

func JSONUnmarshal(btes []byte, i interface{}) error

func JSONWithoutHTMLEncode

func JSONWithoutHTMLEncode(t interface{}) ([]byte, error)

JSONWithoutHTMLEncode return byte array of a struct into json without HTML encode

func ListGoroutines

func ListGoroutines() ([]*stack.Goroutine, error)

func LookPath

func LookPath(fs afero.Fs, file string) (string, error)

LookPath searches for an executable named file in the directories named by the PATH environment variable. If file contains a slash, it is tried directly and the PATH is not consulted. The result may be an absolute path or a path relative to the current directory.

func MessagesToError

func MessagesToError(messages []Message) error

MessagesToError returns a translated slices of messages as an error

func ModelsToGroupIDs

func ModelsToGroupIDs(ms []*Model) []int64

ModelsToGroupIDs returns group ids of given worker models.

func NeedPlaceholder

func NeedPlaceholder(t string) bool

NeedPlaceholder returns true if variable type is either secret or key

func NewArtifactoryClient

func NewArtifactoryClient(url string, token string) (artifactory.ArtifactoryServicesManager, error)

func NewError

func NewError(httpError Error, err error) error

NewError returns a merge of given err with new http error.

func NewErrorFrom

func NewErrorFrom(err error, from string, args ...interface{}) error

NewErrorFrom returns the given error with given from details.

func NewErrorWithStack

func NewErrorWithStack(root error, err error) error

NewErrorWithStack wraps given root error and override its http error with given error.

func ParameterAddOrSetValue

func ParameterAddOrSetValue(vars *[]Parameter, name string, parameterType string, value string)

ParameterAddOrSetValue add a new parameter or update a value

func ParameterValue

func ParameterValue(vars []Parameter, s string) string

ParameterValue return a parameter value given its name if it exists in array, else it returns empty string

func ParametersFromApplicationKeys

func ParametersFromApplicationKeys(app Application) map[string]string

ParametersFromApplicationVariables returns a map from application key

func ParametersFromApplicationVariables

func ParametersFromApplicationVariables(app Application) map[string]string

ParametersFromApplicationVariables returns a map from a slice of parameters

func ParametersFromEnvironmentKeys

func ParametersFromEnvironmentKeys(env Environment) map[string]string

ParametersFromEnvironmentKeys returns a map from environment key

func ParametersFromEnvironmentVariables

func ParametersFromEnvironmentVariables(env Environment) map[string]string

ParametersFromEnvironmentVariables returns a map from a slice of parameters

func ParametersFromIntegration

func ParametersFromIntegration(prefix string, ppf IntegrationConfig) map[string]string

ParametersFromIntegration returns a map of variables from a ProjectIntegration

func ParametersFromPipelineParameters

func ParametersFromPipelineParameters(pipParams []Parameter) map[string]string

ParametersFromPipelineParameters returns a map from a slice of parameters

func ParametersFromProjectKeys

func ParametersFromProjectKeys(proj Project) map[string]string

func ParametersFromProjectVariables

func ParametersFromProjectVariables(proj Project) map[string]string

ParametersFromProjectVariables returns a map from a slice of parameters

func ParametersMapMerge

func ParametersMapMerge(params map[string]string, otherParams map[string]string, checkFuncs ...func(string) bool) map[string]string

ParametersMapMerge merges two maps of parameters

func ParametersToMap

func ParametersToMap(params []Parameter) map[string]string

ParametersToMap returns a map from a slice of parameters

func ParseDateRFC5322

func ParseDateRFC5322(date string) (time.Time, error)

ParseDateRFC5322 parses an RFC 5322 date string.

func PathIsAbs

func PathIsAbs(s string) bool

func ProjectsToIDs

func ProjectsToIDs(ps []Project) []int64

ProjectsToIDs returns ids of given projects.

func RandomString

func RandomString(strlen int) string

RandomString generate random string containing a-zA-Z0-9

func ReflectFieldByTag

func ReflectFieldByTag(i interface{}, tagKey, tagValues string) interface{}

ReflectFieldByTag returns a pointer to a value corresponding to a tag For instance:

		sdk.ReflectFieldByTag(&Configuration{}, "toml", "api.database.name")

		Search for a field tagged 'toml:api' that is a struct.
		is this value, there is a field tagged 'toml:database' that is a struct.
     finally in this value, there a field tagged 'toml:name'. We return a pointer to this field.

func RemoveNotPrintableChar

func RemoveNotPrintableChar(in string) string

func Round

func Round(d, r time.Duration) time.Duration

Round rounds a duration, see original source here: https://play.golang.org/p/WjfKwhhjL5 round("1h23m45.6789s", time.Second} will returns want: "1h23m46s"

func SHA512sum

func SHA512sum(s string) (string, error)

func StatusIsTerminated

func StatusIsTerminated(status string) bool

StatusIsTerminated returns if status is terminated (nothing related to building or waiting, ...)

func StatusValidate

func StatusValidate(status ...string) bool

StatusValidate returns if given strings are valid status.

func StringFirstN

func StringFirstN(s string, i int) string

func StringIsAscii

func StringIsAscii(s string) bool

func ToVulnerabilitySeverity

func ToVulnerabilitySeverity(s string) string

ToVulnerabilitySeverity converts string to good severity name

func UUID

func UUID() string

UUID returns a UUID v4

func Untar

func Untar(fs afero.Fs, dst string, r io.Reader) error

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func UntarGz

func UntarGz(fs afero.Fs, dst string, r io.Reader) error

UntarGz takes a destination path and a reader; a tar.gz reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func VCSCommitStatusDescription

func VCSCommitStatusDescription(projKey, workflowName string, evt EventRunWorkflowNode) string

VCSCommitStatusDescription return a node formated status description

func ValidAndNotEmpty

func ValidAndNotEmpty(v reflect.Value) bool

func ValueFromInterface

func ValueFromInterface(i interface{}) reflect.Value

func VersionString

func VersionString() string

VersionString returns a string contains all about current version

func WithData

func WithData(err error, data interface{}) error

WithData returns an error with data from given error.

func WithStack

func WithStack(err error) error

WithStack returns an error with stack from given error.

func WorkerModelValidate

func WorkerModelValidate(modelType string) bool

WorkerModelValidate returns if given strings are valid worker model type.

func WorkflowCheckConditions

func WorkflowCheckConditions(conditions []WorkflowNodeCondition, params []Parameter) (bool, error)

WorkflowCheckConditions checks conditions given a list of parameters

func WorkflowTemplateInstancesToIDs

func WorkflowTemplateInstancesToIDs(wtis []*WorkflowTemplateInstance) []int64

WorkflowTemplateInstancesToIDs returns ids of given workflow template instances.

func WorkflowTemplateInstancesToWorkflowIDs

func WorkflowTemplateInstancesToWorkflowIDs(wtis []*WorkflowTemplateInstance) []int64

WorkflowTemplateInstancesToWorkflowIDs returns workflow ids of given workflow template instances.

func WorkflowTemplateInstancesToWorkflowTemplateIDs

func WorkflowTemplateInstancesToWorkflowTemplateIDs(wtis []*WorkflowTemplateInstance) []int64

WorkflowTemplateInstancesToWorkflowTemplateIDs returns workflow template ids of given workflow template instances.

func WorkflowTemplatesToGroupIDs

func WorkflowTemplatesToGroupIDs(wts []*WorkflowTemplate) []int64

WorkflowTemplatesToGroupIDs returns group ids of given workflow templates.

func WorkflowTemplatesToIDs

func WorkflowTemplatesToIDs(wts []*WorkflowTemplate) []int64

WorkflowTemplatesToIDs returns ids of given workflow templates.

func WorkflowToIDs

func WorkflowToIDs(ws []*Workflow) []int64

WorkflowToIDs returns ids of given workflows.

func WrapError

func WrapError(err error, format string, args ...interface{}) error

WrapError returns an error with stack and message.

Types

type APIConfig

type APIConfig struct {
	DefaultRunRetentionPolicy string `json:"default_run_retention_policy"`
}

type Action

type Action struct {
	ID          int64  `json:"id" yaml:"-" db:"id"`
	GroupID     *int64 `json:"group_id,omitempty" yaml:"-" db:"group_id"`
	Name        string `json:"name" db:"name"`
	Type        string `json:"type" yaml:"-" db:"type"`
	Description string `json:"description" yaml:"desc,omitempty" db:"description"`
	Enabled     bool   `json:"enabled" yaml:"-" db:"enabled"`
	Deprecated  bool   `json:"deprecated" yaml:"-" db:"deprecated"`
	// aggregates from action_edge
	StepName       string `json:"step_name,omitempty" yaml:"step_name,omitempty" db:"-"`
	Optional       bool   `json:"optional" yaml:"-" db:"-"`
	AlwaysExecuted bool   `json:"always_executed" yaml:"-" db:"-"`
	// aggregates
	Requirements RequirementList `json:"requirements" db:"-"`
	Parameters   []Parameter     `json:"parameters" db:"-"`
	Actions      []Action        `json:"actions,omitempty" yaml:"actions,omitempty" db:"-"`
	Group        *Group          `json:"group,omitempty" db:"-"`
	FirstAudit   *AuditAction    `json:"first_audit,omitempty" db:"-"`
	LastAudit    *AuditAction    `json:"last_audit,omitempty" db:"-"`
	Editable     bool            `json:"editable,omitempty" db:"-"`
}

Action is the base element of CDS pipeline

func ActionsFilterNotTypes

func ActionsFilterNotTypes(as []*Action, ts ...string) []*Action

ActionsFilterNotTypes returns a list of actions filtered by types.

func NewAction

func NewAction(name string) *Action

NewAction instantiate a new Action

func (*Action) Add

func (a *Action) Add(child Action) *Action

Add takes an action that will be executed when current action is executed

func (*Action) FlattenRequirements

func (a *Action) FlattenRequirements() RequirementList

FlattenRequirements returns all requirements for an action and its children.

func (Action) IsValid

func (a Action) IsValid() error

IsValid returns error if the action is not valid.

func (Action) IsValidDefault

func (a Action) IsValidDefault() error

IsValidDefault returns default action validity.

func (*Action) Parameter

func (a *Action) Parameter(p Parameter) *Action

Parameter add given parameter to Action

func (*Action) Requirement

func (a *Action) Requirement(name string, t string, value string) *Action

Requirement add given requirement to Action

func (*Action) Scan

func (a *Action) Scan(src interface{}) error

Scan action.

func (Action) ToSummary

func (a Action) ToSummary() ActionSummary

ToSummary returns an ActionSummary from an Action

func (Action) ToUniqueChildrenIDs

func (a Action) ToUniqueChildrenIDs() []int64

ToUniqueChildrenIDs returns distinct children ids for given action.

func (Action) Value

func (a Action) Value() (driver.Value, error)

Value returns driver.Value from action.

type ActionSummary

type ActionSummary struct {
	Name     string `json:"name"`
	StepName string `json:"step_name"`
}

ActionSummary is the light representation of an action for CDS event

type ActionUsages

type ActionUsages struct {
	Pipelines []UsagePipeline `json:"pipelines"`
	Actions   []UsageAction   `json:"actions"`
}

ActionUsages for action.

type Application

type Application struct {
	ID                   int64                        `json:"id" db:"id"`
	Name                 string                       `json:"name" db:"name" cli:"name,key"`
	Description          string                       `json:"description" db:"description"`
	Icon                 string                       `json:"icon" db:"icon"`
	ProjectID            int64                        `json:"-" db:"project_id"`
	ProjectKey           string                       `json:"project_key" db:"-" cli:"project_key"`
	Variables            []ApplicationVariable        `json:"variables,omitempty" db:"-"`
	Notifications        []UserNotification           `json:"notifications,omitempty" db:"-"`
	LastModified         time.Time                    `json:"last_modified" db:"last_modified" mapstructure:"-"`
	VCSServer            string                       `json:"vcs_server,omitempty" db:"vcs_server"`
	RepositoryFullname   string                       `json:"repository_fullname,omitempty" db:"repo_fullname" cli:"repository_fullname"`
	RepositoryStrategy   RepositoryStrategy           `json:"vcs_strategy,omitempty" db:"cipher_vcs_strategy" gorpmapping:"encrypted,ProjectID,Name"`
	Metadata             Metadata                     `json:"metadata" yaml:"metadata" db:"metadata"`
	Keys                 []ApplicationKey             `json:"keys" yaml:"keys" db:"-"`
	Usage                *Usage                       `json:"usage,omitempty" db:"-" cli:"-"`
	DeploymentStrategies map[string]IntegrationConfig `json:"deployment_strategies,omitempty" db:"-" cli:"-"`
	Vulnerabilities      []Vulnerability              `json:"vulnerabilities,omitempty" db:"-" cli:"-"`
	FromRepository       string                       `json:"from_repository,omitempty" db:"from_repository" cli:"-"`
	// aggregate
	WorkflowAscodeHolder *Workflow `json:"workflow_ascode_holder,omitempty" cli:"-" db:"-"`
}

Application represent an application in a project

func (Application) GetKey

func (app Application) GetKey(kname string) *ApplicationKey

GetKey return a key by name

func (Application) GetSSHKey

func (app Application) GetSSHKey(kname string) *ApplicationKey

GetSSHKey return a key by name

func (Application) IsValid

func (app Application) IsValid() error

IsValid returns error if the application is not valid.

func (Application) PGPKeys

func (app Application) PGPKeys() []ApplicationKey

PGPKeys returns the slice of pgp key for an application

func (Application) SSHKeys

func (app Application) SSHKeys() []ApplicationKey

SSHKeys returns the slice of ssh key for an application

type ApplicationKey

type ApplicationKey struct {
	ID            int64   `json:"id" db:"id" cli:"-"`
	Name          string  `json:"name" db:"name" cli:"name"`
	Public        string  `json:"public" db:"public" cli:"publickey"`
	Private       string  `json:"private" db:"private" cli:"-" gorpmapping:"encrypted,ID,Name"`
	KeyID         string  `json:"key_id" db:"key_id" cli:"-"`
	Type          KeyType `json:"type" db:"type" cli:"type"`
	ApplicationID int64   `json:"application_id" db:"application_id"`
}

ApplicationKey represent a key attach to an application

type ApplicationOverview

type ApplicationOverview struct {
	Graphs  []ApplicationOverviewGraph      `json:"graphs,omitempty"`
	GitURL  string                          `json:"git_url,omitempty"`
	History map[string][]WorkflowRunSummary `json:"history,omitempty"`
}

ApplicationOverview represents the overview of an application

type ApplicationOverviewGraph

type ApplicationOverviewGraph struct {
	Type  string            `json:"type"`
	Datas []json.RawMessage `json:"datas"`
}

ApplicationOverviewGraph represents data pushed by CDS for metrics

type ApplicationTemplate

type ApplicationTemplate struct {
	Value string `json:"value"`
}

ApplicationTemplate struct.

func (*ApplicationTemplate) IsValid

func (a *ApplicationTemplate) IsValid() error

IsValid returns application template validity.

type ApplicationTemplates

type ApplicationTemplates []ApplicationTemplate

ApplicationTemplates struct.

func (*ApplicationTemplates) Scan

func (a *ApplicationTemplates) Scan(src interface{}) error

Scan application templates.

func (ApplicationTemplates) Value

func (a ApplicationTemplates) Value() (driver.Value, error)

Value returns driver.Value from workflow template applications.

type ApplicationVariable

type ApplicationVariable struct {
	ID            int64  `json:"id,omitempty" cli:"-"`
	Name          string `json:"name" cli:"name,key"`
	Value         string `json:"value" cli:"value"`
	Type          string `json:"type" cli:"type"`
	ApplicationID int64  `json:"application_id" cli:"-"`
}

type ApplicationVariableAudit

type ApplicationVariableAudit struct {
	ID             int64                `json:"id" yaml:"-" db:"id"`
	ApplicationID  int64                `json:"application_id" yaml:"-" db:"application_id"`
	VariableID     int64                `json:"variable_id" yaml:"-" db:"variable_id"`
	Type           string               `json:"type" yaml:"-" db:"type"`
	VariableBefore *ApplicationVariable `json:"variable_before,omitempty" yaml:"-" db:"-"`
	VariableAfter  ApplicationVariable  `json:"variable_after,omitempty" yaml:"-" db:"-"`
	Versionned     time.Time            `json:"versionned" yaml:"-" db:"versionned"`
	Author         string               `json:"author" yaml:"-" db:"author"`
}

ApplicationVariableAudit represents an audit on an application variable

type ArtifactsStore

type ArtifactsStore struct {
	Name                  string `json:"name"`
	TemporaryURLSupported bool   `json:"temporary_url_supported"`
}

ArtifactsStore represents

type AsCodeEvent

type AsCodeEvent struct {
	ID             int64           `json:"id" db:"id"`
	WorkflowID     int64           `json:"workflow_id" db:"workflow_id"`
	PullRequestID  int64           `json:"pullrequest_id" db:"pullrequest_id"`
	PullRequestURL string          `json:"pullrequest_url" db:"pullrequest_url"`
	Username       string          `json:"username" db:"username"`
	CreateDate     time.Time       `json:"creation_date" db:"creation_date"`
	FromRepo       string          `json:"from_repository" db:"from_repository"`
	Migrate        bool            `json:"migrate" db:"migrate"`
	Data           AsCodeEventData `json:"data" db:"data"`
}

type AsCodeEventData

type AsCodeEventData struct {
	Workflows    AsCodeEventDataValue `json:"workflows"`
	Pipelines    AsCodeEventDataValue `json:"pipelines"`
	Applications AsCodeEventDataValue `json:"applications"`
	Environments AsCodeEventDataValue `json:"environments"`
}

func (*AsCodeEventData) Scan

func (d *AsCodeEventData) Scan(src interface{}) error

Scan consumer data.

func (AsCodeEventData) Value

func (d AsCodeEventData) Value() (driver.Value, error)

Value returns driver.Value from consumer data.

type AsCodeEventDataValue

type AsCodeEventDataValue map[int64]string

type Audit

type Audit interface {
	Compute(ctx context.Context, db gorp.SqlExecutor, e Event) error
}

Audit represents audit interface.

type AuditAction

type AuditAction struct {
	AuditCommon
	ActionID   int64  `json:"action_id" db:"action_id"`
	DataType   string `json:"data_type" db:"data_type"`
	DataBefore string `json:"data_before" db:"data_before"`
	DataAfter  string `json:"data_after" db:"data_after"`
}

AuditAction represents an audit data on a action.

type AuditCommon

type AuditCommon struct {
	ID          int64     `json:"id" db:"id"`
	TriggeredBy string    `json:"triggered_by" db:"triggered_by"`
	Created     time.Time `json:"created" db:"created" mapstructure:"-"`
	EventType   string    `json:"event_type" db:"event_type"`
}

AuditCommon contains basic stuff for audits.

type AuditWorkflow

type AuditWorkflow struct {
	AuditCommon
	ProjectKey string `json:"project_key" db:"project_key"`
	WorkflowID int64  `json:"workflow_id" db:"workflow_id"`
	DataType   string `json:"data_type" db:"data_type"`
	DataBefore string `json:"data_before" db:"data_before"`
	DataAfter  string `json:"data_after" db:"data_after"`
}

AuditWorkflow represents an audit data on a workflow.

type AuditWorkflowTemplate

type AuditWorkflowTemplate struct {
	AuditCommon
	WorkflowTemplateID int64            `json:"workflow_template_id" db:"workflow_template_id"`
	ChangeMessage      string           `json:"change_message,omitempty" db:"change_message"`
	DataBefore         WorkflowTemplate `json:"data_before" db:"data_before"`
	DataAfter          WorkflowTemplate `json:"data_after" db:"data_after"`
}

AuditWorkflowTemplate represents an audit data on a workflow template.

type AuditWorkflowTemplateInstance

type AuditWorkflowTemplateInstance struct {
	AuditCommon
	WorkflowTemplateInstanceID int64  `json:"workflow_template_instance_id" db:"workflow_template_instance_id"`
	DataType                   string `json:"data_type" db:"data_type"`
	DataBefore                 string `json:"data_before" db:"data_before"`
	DataAfter                  string `json:"data_after" db:"data_after"`
}

AuditWorkflowTemplateInstance represents an audit data on a workflow template instance.

type AuthConsumer

type AuthConsumer struct {
	ID                 string                      `json:"id" cli:"id,key" db:"id"`
	Name               string                      `json:"name" cli:"name" db:"name"`
	Description        string                      `json:"description" cli:"description" db:"description"`
	ParentID           *string                     `json:"parent_id,omitempty" db:"parent_id"`
	AuthentifiedUserID string                      `json:"user_id,omitempty" db:"user_id"`
	Type               AuthConsumerType            `json:"type" cli:"type" db:"type"`
	Data               AuthConsumerData            `json:"-" db:"data"` // NEVER returns auth consumer data in json, TODO this fields should be visible only in auth package
	Created            time.Time                   `json:"created" cli:"created" db:"created"`
	GroupIDs           Int64Slice                  `json:"group_ids,omitempty" cli:"group_ids" db:"group_ids"`
	InvalidGroupIDs    Int64Slice                  `json:"invalid_group_ids,omitempty" db:"invalid_group_ids"`
	ScopeDetails       AuthConsumerScopeDetails    `json:"scope_details,omitempty" cli:"scope_details" db:"scope_details"`
	DeprecatedIssuedAt time.Time                   `json:"issued_at" cli:"issued_at" db:"issued_at"`
	Disabled           bool                        `json:"disabled" cli:"disabled" db:"disabled"`
	Warnings           AuthConsumerWarnings        `json:"warnings,omitempty" db:"warnings"`
	LastAuthentication *time.Time                  `json:"last_authentication,omitempty" db:"last_authentication"`
	ValidityPeriods    AuthConsumerValidityPeriods `json:"validity_periods,omitempty" db:"validity_periods"`
	// aggregates
	AuthentifiedUser *AuthentifiedUser `json:"user,omitempty" db:"-"`
	Groups           Groups            `json:"groups,omitempty" db:"-"`
	// aggregates by router auth middleware
	Service *Service `json:"-" db:"-"`
	Worker  *Worker  `json:"-" db:"-"`
}

AuthConsumer issues session linked to an authentified user.

func (AuthConsumer) Admin

func (c AuthConsumer) Admin() bool

func (AuthConsumer) GetEmail

func (c AuthConsumer) GetEmail() string

func (AuthConsumer) GetFullname

func (c AuthConsumer) GetFullname() string

func (AuthConsumer) GetGroupIDs

func (c AuthConsumer) GetGroupIDs() []int64

GetGroupIDs returns group ids for auth consumer, if empty in consumer returns group ids from authentified user.

func (AuthConsumer) GetUsername

func (c AuthConsumer) GetUsername() string

func (AuthConsumer) IsValid

func (c AuthConsumer) IsValid(scopeDetails AuthConsumerScopeDetails) error

IsValid returns validity for auth consumer.

func (AuthConsumer) Maintainer

func (c AuthConsumer) Maintainer() bool

type AuthConsumerCreateResponse

type AuthConsumerCreateResponse struct {
	Token    string        `json:"token"` // sign in token
	Consumer *AuthConsumer `json:"consumer"`
}

AuthConsumerCreateResponse response for a auth consumer creation.

type AuthConsumerData

type AuthConsumerData map[string]string

AuthConsumerData contains specific information from the auth driver.

func (*AuthConsumerData) Scan

func (d *AuthConsumerData) Scan(src interface{}) error

Scan consumer data.

func (AuthConsumerData) Value

func (d AuthConsumerData) Value() (driver.Value, error)

Value returns driver.Value from consumer data.

type AuthConsumerRegenRequest

type AuthConsumerRegenRequest struct {
	RevokeSessions  bool   `json:"revoke_sessions"`
	OverlapDuration string `json:"overlap_duration"`
	NewDuration     int64  `json:"new_duration"`
}

AuthConsumerRegenRequest struct.

type AuthConsumerScope

type AuthConsumerScope string

AuthConsumerScope alias type for string.

const (
	AuthConsumerScopeUser         AuthConsumerScope = "User"
	AuthConsumerScopeAccessToken  AuthConsumerScope = "AccessToken"
	AuthConsumerScopeAction       AuthConsumerScope = "Action"
	AuthConsumerScopeAdmin        AuthConsumerScope = "Admin"
	AuthConsumerScopeGroup        AuthConsumerScope = "Group"
	AuthConsumerScopeTemplate     AuthConsumerScope = "Template"
	AuthConsumerScopeProject      AuthConsumerScope = "Project"
	AuthConsumerScopeRun          AuthConsumerScope = "Run"
	AuthConsumerScopeRunExecution AuthConsumerScope = "RunExecution"
	AuthConsumerScopeHooks        AuthConsumerScope = "Hooks"
	AuthConsumerScopeWorker       AuthConsumerScope = "Worker"
	AuthConsumerScopeWorkerModel  AuthConsumerScope = "WorkerModel"
	AuthConsumerScopeHatchery     AuthConsumerScope = "Hatchery"
	AuthConsumerScopeService      AuthConsumerScope = "Service"
)

Available auth consumer scopes.

func (AuthConsumerScope) IsValid

func (s AuthConsumerScope) IsValid() bool

IsValid returns validity for scope.

type AuthConsumerScopeDetail

type AuthConsumerScopeDetail struct {
	Scope     AuthConsumerScope          `json:"scope"`
	Endpoints AuthConsumerScopeEndpoints `json:"endpoints,omitempty"`
}

AuthConsumerScopeDetail contains all endpoints for a scope.

type AuthConsumerScopeDetails

type AuthConsumerScopeDetails []AuthConsumerScopeDetail

AuthConsumerScopeDetails type used for database json storage.

func NewAuthConsumerScopeDetails

func NewAuthConsumerScopeDetails(scopes ...AuthConsumerScope) AuthConsumerScopeDetails

func (AuthConsumerScopeDetails) IsValid

func (s AuthConsumerScopeDetails) IsValid() error

IsValid returns an error if current details are invalids.

func (*AuthConsumerScopeDetails) Scan

func (s *AuthConsumerScopeDetails) Scan(src interface{}) error

Scan scope detail slice.

func (AuthConsumerScopeDetails) ToEndpointsMap

func (AuthConsumerScopeDetails) Value

Value returns driver.Value from scope detail slice.

type AuthConsumerScopeEndpoint

type AuthConsumerScopeEndpoint struct {
	Route   string      `json:"route"`
	Methods StringSlice `json:"methods,omitempty"`
}

type AuthConsumerScopeEndpoints

type AuthConsumerScopeEndpoints []AuthConsumerScopeEndpoint

func (AuthConsumerScopeEndpoints) FindEndpoint

type AuthConsumerScopeSlice

type AuthConsumerScopeSlice []AuthConsumerScope

AuthConsumerScopeSlice type used for database json storage.

func (*AuthConsumerScopeSlice) Scan

func (s *AuthConsumerScopeSlice) Scan(src interface{}) error

Scan scope slice.

func (AuthConsumerScopeSlice) Value

Value returns driver.Value from scope slice.

type AuthConsumerSigninRequest

type AuthConsumerSigninRequest map[string]string

AuthConsumerSigninRequest struct for auth consumer signin request.

type AuthConsumerSigninResponse

type AuthConsumerSigninResponse struct {
	APIURL string            `json:"api_url,omitempty"`
	Token  string            `json:"token"` // session token
	User   *AuthentifiedUser `json:"user"`
}

AuthConsumerSigninResponse response for a auth consumer signin.

type AuthConsumerType

type AuthConsumerType string

AuthConsumerType constant to identify what is the driver used to create a consumer.

const (
	ConsumerBuiltin      AuthConsumerType = "builtin"
	ConsumerLocal        AuthConsumerType = "local"
	ConsumerLDAP         AuthConsumerType = "ldap"
	ConsumerCorporateSSO AuthConsumerType = "corporate-sso"
	ConsumerGithub       AuthConsumerType = "github"
	ConsumerGitlab       AuthConsumerType = "gitlab"
	ConsumerOIDC         AuthConsumerType = "openid-connect"
	ConsumerTest         AuthConsumerType = "futurama"
	ConsumerTest2        AuthConsumerType = "planet-express"
)

Consumer types.

func (AuthConsumerType) IsValid

func (t AuthConsumerType) IsValid() bool

IsValid returns validity of given auth consumer type.

func (AuthConsumerType) IsValidExternal

func (t AuthConsumerType) IsValidExternal() bool

IsValidExternal returns validity of given auth consumer type.

type AuthConsumerValidityPeriod

type AuthConsumerValidityPeriod struct {
	IssuedAt time.Time     `json:"issued_at" cli:"issued_at" `
	Duration time.Duration `json:"duration" cli:"duration"`
}

type AuthConsumerValidityPeriods

type AuthConsumerValidityPeriods []AuthConsumerValidityPeriod

func NewAuthConsumerValidityPeriod

func NewAuthConsumerValidityPeriod(iat time.Time, duration time.Duration) AuthConsumerValidityPeriods

func (AuthConsumerValidityPeriods) Latest

func (*AuthConsumerValidityPeriods) Scan

func (p *AuthConsumerValidityPeriods) Scan(src interface{}) error

func (*AuthConsumerValidityPeriods) Sort

func (p *AuthConsumerValidityPeriods) Sort()

func (AuthConsumerValidityPeriods) Value

type AuthConsumerWarning

type AuthConsumerWarning struct {
	Type      AuthConsumerWarningType `json:"type"`
	GroupID   int64                   `json:"group_id,omitempty"`
	GroupName string                  `json:"group_name,omitempty"`
}

AuthConsumerWarning contains info about a warning.

func NewConsumerWarningGroupInvalid

func NewConsumerWarningGroupInvalid(groupID int64, groupName string) AuthConsumerWarning

NewConsumerWarningGroupInvalid returns a new warning for given group info.

func NewConsumerWarningGroupRemoved

func NewConsumerWarningGroupRemoved(groupID int64, groupName string) AuthConsumerWarning

NewConsumerWarningGroupRemoved returns a new warning for given group info.

func NewConsumerWarningLastGroupRemoved

func NewConsumerWarningLastGroupRemoved() AuthConsumerWarning

NewConsumerWarningLastGroupRemoved returns a new warning.

type AuthConsumerWarningType

type AuthConsumerWarningType string

AuthConsumerWarningType constant for consumer warnings.

const (
	WarningGroupInvalid     AuthConsumerWarningType = "group-invalid"
	WarningGroupRemoved     AuthConsumerWarningType = "group-removed"
	WarningLastGroupRemoved AuthConsumerWarningType = "last-group-removed"
)

Consumer warning types.

type AuthConsumerWarnings

type AuthConsumerWarnings []AuthConsumerWarning

AuthConsumerWarnings contains specific information from the auth driver.

func (*AuthConsumerWarnings) Scan

func (w *AuthConsumerWarnings) Scan(src interface{}) error

Scan consumer data.

func (AuthConsumerWarnings) Value

func (w AuthConsumerWarnings) Value() (driver.Value, error)

Value returns driver.Value from consumer warnings.

type AuthConsumers

type AuthConsumers []AuthConsumer

AuthConsumers gives functions for auth consumer slice.

type AuthCurrentConsumerResponse

type AuthCurrentConsumerResponse struct {
	User           AuthentifiedUser   `json:"user"`
	Consumer       AuthConsumer       `json:"consumer"`
	Session        AuthSession        `json:"session"`
	DriverManifest AuthDriverManifest `json:"driver_manifest"`
}

AuthCurrentConsumerResponse describe the current consumer and the current session

type AuthDriver

type AuthDriver interface {
	GetManifest() AuthDriverManifest
	GetSessionDuration() time.Duration
	CheckSigninRequest(AuthConsumerSigninRequest) error
	GetUserInfo(context.Context, AuthConsumerSigninRequest) (AuthDriverUserInfo, error)
}

AuthDriver interface.

type AuthDriverManifest

type AuthDriverManifest struct {
	Type           AuthConsumerType `json:"type"`
	SignupDisabled bool             `json:"signup_disabled"`
	SupportMFA     bool             `json:"support_mfa"`
}

AuthDriverManifest struct describe a auth driver.

type AuthDriverManifests

type AuthDriverManifests []AuthDriverManifest

AuthDriverManifests gives functions on driver manifest slice.

func (AuthDriverManifests) ExistsConsumerType

func (a AuthDriverManifests) ExistsConsumerType(consumerType AuthConsumerType) bool

ExistsConsumerType returns if a driver exists for given consumer type.

func (AuthDriverManifests) FindByConsumerType

func (a AuthDriverManifests) FindByConsumerType(consumerType AuthConsumerType) (AuthDriverManifest, bool)

FindByConsumerType returns a manifest for given consumer type if exists.

type AuthDriverResponse

type AuthDriverResponse struct {
	IsFirstConnection bool                `json:"is_first_connection"`
	Drivers           AuthDriverManifests `json:"manifests"`
}

AuthDriverResponse struct contains drivers manifest and some info about auth config.

type AuthDriverSigningRedirect

type AuthDriverSigningRedirect struct {
	Method      string            `json:"method"`
	URL         string            `json:"url"`
	Body        map[string]string `json:"body"`
	ContentType string            `json:"content_type"`
}

type AuthDriverUserInfo

type AuthDriverUserInfo struct {
	ExternalID      string
	Username        string
	Fullname        string
	Email           string
	MFA             bool
	ExternalTokenID string
	Organization    string
}

AuthDriverUserInfo struct discribed a user returns by a auth driver.

type AuthDriverWithRedirect

type AuthDriverWithRedirect interface {
	AuthDriver
	GetSigninURI(AuthSigninConsumerToken) (AuthDriverSigningRedirect, error)
}

type AuthDriverWithSigninStateToken

type AuthDriverWithSigninStateToken interface {
	AuthDriver
	CheckSigninStateToken(AuthConsumerSigninRequest) error
}

type AuthSession

type AuthSession struct {
	ID         string    `json:"id" cli:"id,key" db:"id"`
	ConsumerID string    `json:"consumer_id" cli:"consumer_id" db:"consumer_id"`
	ExpireAt   time.Time `json:"expire_at,omitempty" cli:"expire_at" db:"expire_at"`
	Created    time.Time `json:"created" cli:"created" db:"created"`
	MFA        bool      `json:"mfa" cli:"mfa" db:"mfa"`
	// aggregates
	Consumer     *AuthConsumer `json:"consumer,omitempty" db:"-"`
	Groups       []Group       `json:"groups,omitempty" db:"-"`
	Current      bool          `json:"current,omitempty" cli:"current" db:"-"`
	LastActivity *time.Time    `json:"last_activity,omitempty" cli:"last_activity,omitempty" db:"-"`
}

AuthSession struct.

type AuthSessionJWTClaims

type AuthSessionJWTClaims struct {
	ID      string
	TokenID string
	jwt.StandardClaims
}

AuthSessionJWTClaims is the specific claims format for JWT session.

type AuthSessions

type AuthSessions []AuthSession

AuthSessions gives functions for auth session slice.

type AuthSigninConsumerToken

type AuthSigninConsumerToken struct {
	IssuedAt          int64  `json:"issued_at"`
	Origin            string `json:"origin,omitempty"`
	RedirectURI       string `json:"redirect_uri,omitempty"`
	RequireMFA        bool   `json:"require_mfa,omitempty"`
	IsFirstConnection bool   `json:"is_first_connection,omitempty"`
}

AuthSigninConsumerToken discribes the payload for a signin state token.

type AuthentifiedUser

type AuthentifiedUser struct {
	ID       string    `json:"id" yaml:"id" cli:"id" db:"id"`
	Created  time.Time `json:"created" yaml:"created" cli:"created" db:"created"`
	Username string    `json:"username" yaml:"username" cli:"username,key" db:"username"`
	Fullname string    `json:"fullname" yaml:"fullname,omitempty" cli:"fullname" db:"fullname"`
	Ring     string    `json:"ring" yaml:"ring,omitempty" cli:"ring" db:"ring"`
	// aggregates
	Contacts     UserContacts `json:"-" yaml:"-" db:"-"`
	Favorites    []Favorite   `json:"favorites" yaml:"favorites" db:"-"`
	Groups       Groups       `json:"groups" yaml:"groups" db:"-"`
	Organization string       `json:"organization,omitempty" yaml:"organization,omitempty" cli:"organization" db:"-"`
}

AuthentifiedUser struct contains all information about a cds user.

func (AuthentifiedUser) GetEmail

func (u AuthentifiedUser) GetEmail() string

GetEmail return the primary email for the authentified user (should exists).

func (AuthentifiedUser) GetFullname

func (u AuthentifiedUser) GetFullname() string

func (AuthentifiedUser) GetGroupIDs

func (u AuthentifiedUser) GetGroupIDs() []int64

GetGroupIDs returns groups ids for user

func (AuthentifiedUser) GetUsername

func (u AuthentifiedUser) GetUsername() string

func (AuthentifiedUser) IsValid

func (u AuthentifiedUser) IsValid() error

IsValid returns an error if given user's infos are not valid.

func (*AuthentifiedUser) Scan

func (u *AuthentifiedUser) Scan(src interface{}) error

Scan workflow template request.

func (AuthentifiedUser) Value

func (u AuthentifiedUser) Value() (driver.Value, error)

Value returns driver.Value from workflow template request.

type AuthentifiedUsers

type AuthentifiedUsers []AuthentifiedUser

AuthentifiedUsers provides func for authentified user list.

func (AuthentifiedUsers) IDs

func (a AuthentifiedUsers) IDs() []string

func (AuthentifiedUsers) ToMapByID

func (a AuthentifiedUsers) ToMapByID() map[string]AuthentifiedUser

ToMapByID returns a map of authentified users indexed by ids.

type Author

type Author struct {
	Username string `json:"username" cli:"-"`
	Fullname string `json:"fullname" cli:"-"`
	Email    string `json:"email" cli:"-"`
}

Author struct contains info about model author.

func (*Author) Scan

func (a *Author) Scan(src interface{}) error

Scan author.

func (Author) Value

func (a Author) Value() (driver.Value, error)

Value returns driver.Value from author.

type BitbucketServerActor

type BitbucketServerActor struct {
	Name         string `json:"name"`
	EmailAddress string `json:"emailAddress"`
	ID           int    `json:"id"`
	DisplayName  string `json:"displayName"`
	Active       bool   `json:"active"`
	Slug         string `json:"slug"`
	Type         string `json:"type"`
}

type BitbucketServerAuthor

type BitbucketServerAuthor struct {
	User     BitbucketServerActor `json:"user"`
	Role     string               `json:"role"`
	Approved bool                 `json:"approved"`
	Status   string               `json:"status"`
}

type BitbucketServerChange

type BitbucketServerChange struct {
	Ref      BitbucketServerRef `json:"ref"`
	RefID    string             `json:"refId"`
	FromHash string             `json:"fromHash"`
	ToHash   string             `json:"toHash"`
	Type     string             `json:"type"`
}

type BitbucketServerComment

type BitbucketServerComment struct {
	Properties  BitbucketServerProperties `json:"properties"`
	ID          int64                     `json:"id"`
	Version     int64                     `json:"version"`
	Text        string                    `json:"text"`
	Author      BitbucketServerActor      `json:"author"`
	CreatedDate int64                     `json:"createdDate"`
	UpdatedDate int64                     `json:"updatedDate"`
	Comments    []string                  `json:"comments"`
	Tasks       []string                  `json:"tasks"`
}

type BitbucketServerParticipant

type BitbucketServerParticipant struct {
	User               BitbucketServerActor `json:"user"`
	LastReviewedCommit string               `json:"lastReviewedCommit"`
	Role               string               `json:"role"`
	Approved           bool                 `json:"approved"`
	Status             string               `json:"status"`
}

type BitbucketServerPreviousTarget

type BitbucketServerPreviousTarget struct {
	ID              string `json:"id"`
	DisplayID       string `json:"displayId"`
	Type            string `json:"type"`
	LatestCommit    string `json:"latestCommit"`
	LatestChangeset string `json:"latestChangeset"`
}

type BitbucketServerProject

type BitbucketServerProject struct {
	Key    string `json:"key"`
	ID     int64  `json:"id"`
	Name   string `json:"name"`
	Public bool   `json:"public"`
	Type   string `json:"type"`
}

type BitbucketServerProperties

type BitbucketServerProperties struct {
	RepositoryID int64 `json:"repositoryId"`
}

type BitbucketServerPullRequest

type BitbucketServerPullRequest struct {
	ID          int                    `json:"id"`
	Version     int                    `json:"version"`
	Title       string                 `json:"title"`
	Description string                 `json:"description"`
	State       string                 `json:"state"`
	Open        bool                   `json:"open"`
	Closed      bool                   `json:"closed"`
	CreatedDate int                    `json:"createdDate"`
	UpdatedDate int                    `json:"updatedDate"`
	FromRef     BitbucketServerRef     `json:"fromRef"`
	ToRef       BitbucketServerRef     `json:"toRef"`
	Locked      bool                   `json:"locked"`
	Author      *BitbucketServerAuthor `json:"author,omitempty"`
	Reviewers   []struct {
		User               BitbucketServerActor `json:"user"`
		LastReviewedCommit string               `json:"lastReviewedCommit"`
		Role               string               `json:"role"`
		Approved           bool                 `json:"approved"`
		Status             string               `json:"status"`
	} `json:"reviewers,omitempty"`
	Participants []BitbucketServerParticipant `json:"participants,omitempty"`
	Properties   PullRequestProperties        `json:"properties,omitempty"`
	Links        struct {
		Self []struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"links"`
}

type BitbucketServerRef

type BitbucketServerRef struct {
	ID           string                    `json:"id"`
	DisplayID    string                    `json:"displayId"`
	LatestCommit string                    `json:"latestCommit"`
	Repository   BitbucketServerRepository `json:"repository"`
}

type BitbucketServerRepository

type BitbucketServerRepository struct {
	ID            int64                  `json:"id"`
	Slug          string                 `json:"slug"`
	Name          interface{}            `json:"name"`
	ScmID         string                 `json:"scmId"`
	State         string                 `json:"state"`
	StatusMessage string                 `json:"statusMessage"`
	Forkable      bool                   `json:"forkable"`
	Project       BitbucketServerProject `json:"project"`
	Public        bool                   `json:"public"`
}

type BitbucketServerWebhookEvent

type BitbucketServerWebhookEvent struct {
	EventKey string                `json:"eventKey"`
	Date     string                `json:"date"`
	Actor    *BitbucketServerActor `json:"actor"`

	// PR event data
	PullRequest         *BitbucketServerPullRequest    `json:"pullRequest"`
	PreviousTitle       string                         `json:"previousTitle"`
	PreviousDescription interface{}                    `json:"previousDescription"`
	PreviousTarget      *BitbucketServerPreviousTarget `json:"previousTarget"`

	// Review event data
	Participant    *BitbucketServerParticipant `json:"participant"`
	PreviousStatus string                      `json:"previousStatus"`

	// Reviewer edited data
	AddedReviewers   []BitbucketServerActor `json:"addedReviewers"`
	RemovedReviewers []BitbucketServerActor `json:"removedReviewers"`

	// PR Comment event data
	Comment         *BitbucketServerComment `json:"comment"`
	PreviousComment string                  `json:"previousComment"`

	// PushEvent data
	Repository *BitbucketServerRepository `json:"repository"`
	Changes    []BitbucketServerChange    `json:"changes"`
}

type BookedBy

type BookedBy struct {
	Name string `json:"name,omitempty"`
	ID   int64  `json:"id,omitempty"`
}

type Bookmark

type Bookmark struct {
	Icon        string `json:"icon" db:"icon"`
	Description string `json:"description" db:"description"`
	NavbarProjectData
}

Bookmark represents the type for a bookmark with his icon and description

type Broadcast

type Broadcast struct {
	ID         int64     `json:"id" db:"id" cli:"num,key"`
	Title      string    `json:"title" db:"title" cli:"title"`
	Content    string    `json:"content" db:"content" cli:"content"`
	Level      string    `json:"level" db:"level" cli:"level"`
	ProjectKey string    `json:"project_key,omitempty" db:"-" cli:"project"`
	Created    time.Time `json:"created" db:"created" cli:"created"`
	Updated    time.Time `json:"updated" db:"updated" cli:"-"`
	ProjectID  *int64    `json:"project_id,omitempty" db:"project_id" cli:"-"`
	Archived   bool      `json:"archived" db:"archived" cli:"archived"`
	Read       bool      `json:"read" db:"-" cli:"read"`
}

Broadcast represents a message (communication CDS admins -> users)

type BuildNumberAndHash

type BuildNumberAndHash struct {
	BuildNumber int64
	Hash        string
	Branch      string
	Tag         string
	Remote      string
	RemoteURL   string
}

BuildNumberAndHash represents BuildNumber, Commit Hash and Branch for a Pipeline Build or Node Run

type CDNApiRef

type CDNApiRef interface {
	ToHash() (string, error)
	ToFilename() string
}

func NewCDNApiRef

func NewCDNApiRef(t CDNItemType, signature cdn.Signature) (CDNApiRef, error)

func NewCDNLogApiRef

func NewCDNLogApiRef(signature cdn.Signature) CDNApiRef

func NewCDNRunResultApiRef

func NewCDNRunResultApiRef(signature cdn.Signature) CDNApiRef

func NewCDNWorkerCacheApiRef

func NewCDNWorkerCacheApiRef(signature cdn.Signature) CDNApiRef

type CDNConfig

type CDNConfig struct {
	TCPURL          string `json:"tcp_url"`
	TCPURLEnableTLS bool   `json:"tcp_url_enable_tls"`
	HTTPURL         string `json:"http_url"`
}

type CDNItem

type CDNItem struct {
	ID           string          `json:"id" db:"id"`
	Created      time.Time       `json:"created" db:"created"`
	LastModified time.Time       `json:"last_modified" db:"last_modified"`
	Hash         string          `json:"hash" db:"cipher_hash" gorpmapping:"encrypted,ID,APIRefHash,Type"`
	APIRefRaw    json.RawMessage `json:"api_ref" db:"-"`
	APIRef       CDNApiRef       `json:"-" db:"-"`
	APIRefHash   string          `json:"api_ref_hash" db:"api_ref_hash"`
	Status       string          `json:"status" db:"status"`
	Type         CDNItemType     `json:"type" db:"type"`
	Size         int64           `json:"size" db:"size"`
	MD5          string          `json:"md5" db:"md5"`
	ToDelete     bool            `json:"to_delete" db:"to_delete"`
}

func (CDNItem) GetCDNLogApiRef

func (c CDNItem) GetCDNLogApiRef() (*CDNLogAPIRef, bool)

func (CDNItem) GetCDNRunResultApiRef

func (c CDNItem) GetCDNRunResultApiRef() (*CDNRunResultAPIRef, bool)

func (CDNItem) GetCDNWorkerCacheApiRef

func (c CDNItem) GetCDNWorkerCacheApiRef() (*CDNWorkerCacheAPIRef, bool)

func (CDNItem) MarshalJSON

func (c CDNItem) MarshalJSON() ([]byte, error)

func (*CDNItem) UnmarshalJSON

func (c *CDNItem) UnmarshalJSON(data []byte) error
type CDNItemLinks struct {
	CDNHttpURL string    `json:"cdn_http_url"`
	Items      []CDNItem `json:"items"`
}

type CDNItemResume

type CDNItemResume struct {
	CDNItem  CDNItem                `json:"item"` // Here we can't use nested struct because of the custom CDNItem marshaller
	Location map[string]CDNItemUnit `json:"item_units"`
}

type CDNItemType

type CDNItemType string
const (
	CDNTypeItemStepLog     CDNItemType = "step-log"
	CDNTypeItemServiceLog  CDNItemType = "service-log"
	CDNTypeItemRunResult   CDNItemType = "run-result"
	CDNTypeItemWorkerCache CDNItemType = "worker-cache"
	CDNStatusItemIncoming              = "Incoming"
	CDNStatusItemCompleted             = "Completed"
)

func (CDNItemType) IsLog

func (t CDNItemType) IsLog() bool

func (CDNItemType) Validate

func (t CDNItemType) Validate() error

type CDNItemUnit

type CDNItemUnit struct {
	ID           string      `json:"id" db:"id"`
	Type         CDNItemType `json:"type" db:"type"`
	ItemID       string      `json:"item_id" db:"item_id"`
	UnitID       string      `json:"unit_id" db:"unit_id"`
	LastModified time.Time   `json:"last_modified" db:"last_modified"`
	Locator      string      `json:"locator" db:"cipher_locator" gorpmapping:"encrypted,UnitID,ItemID"`
	HashLocator  string      `json:"hash_locator" db:"hash_locator"`
	Item         *CDNItem    `json:"-" db:"-"`
	ToDelete     bool        `json:"to_delete" db:"to_delete"`
}

type CDNLogAPIRef

type CDNLogAPIRef struct {
	ProjectKey     string `json:"project_key"`
	WorkflowName   string `json:"workflow_name"`
	WorkflowID     int64  `json:"workflow_id"`
	RunID          int64  `json:"run_id"`
	NodeRunID      int64  `json:"node_run_id"`
	NodeRunName    string `json:"node_run_name"`
	NodeRunJobID   int64  `json:"node_run_job_id"`
	NodeRunJobName string `json:"node_run_job_name"`

	// for workers
	StepOrder int64  `json:"step_order"`
	StepName  string `json:"step_name,omitempty"`

	// for hatcheries
	RequirementServiceID   int64  `json:"service_id,omitempty"`
	RequirementServiceName string `json:"service_name,omitempty"`
}

func (*CDNLogAPIRef) Scan

func (a *CDNLogAPIRef) Scan(src interface{}) error

Scan CDNLogAPIRef.

func (*CDNLogAPIRef) ToFilename

func (a *CDNLogAPIRef) ToFilename() string

func (*CDNLogAPIRef) ToHash

func (a *CDNLogAPIRef) ToHash() (string, error)

func (CDNLogAPIRef) Value

func (a CDNLogAPIRef) Value() (driver.Value, error)

Value returns driver.Value from CDNLogAPIRef.

type CDNLogLink struct {
	CDNURL   string      `json:"cdn_url,omitempty"`
	ItemType CDNItemType `json:"item_type"`
	APIRef   string      `json:"api_ref"`
}

type CDNLogLinkData

type CDNLogLinkData struct {
	APIRef    string `json:"api_ref"`
	StepOrder int64  `json:"step_order"`
}
type CDNLogLinks struct {
	CDNURL   string           `json:"cdn_url,omitempty"`
	ItemType CDNItemType      `json:"item_type"`
	Data     []CDNLogLinkData `json:"datas"`
}

type CDNLogsLines

type CDNLogsLines struct {
	APIRef     string `json:"api_ref"`
	LinesCount int64  `json:"lines_count"`
}

type CDNMarkDelete

type CDNMarkDelete struct {
	RunID int64 `json:"run_id,omitempty"`
}

type CDNReaderFormat

type CDNReaderFormat string
const (
	CDNReaderFormatJSON CDNReaderFormat = "json"
	CDNReaderFormatText CDNReaderFormat = "text"
)

type CDNRunResultAPIRef

type CDNRunResultAPIRef struct {
	ProjectKey    string                `json:"project_key"`
	WorkflowName  string                `json:"workflow_name"`
	WorkflowID    int64                 `json:"workflow_id"`
	RunID         int64                 `json:"run_id"`
	RunJobID      int64                 `json:"run_job_id"`
	RunJobName    string                `json:"run_job_name"`
	RunNodeID     int64                 `json:"run_node_id"`
	ArtifactName  string                `json:"artifact_name"`
	Perm          uint32                `json:"perm"`
	RunResultType WorkflowRunResultType `json:"type"`
}

func (*CDNRunResultAPIRef) ToFilename

func (a *CDNRunResultAPIRef) ToFilename() string

func (*CDNRunResultAPIRef) ToHash

func (a *CDNRunResultAPIRef) ToHash() (string, error)

type CDNStreamFilter

type CDNStreamFilter struct {
	JobRunID int64 `json:"job_run_id"`
}

func (CDNStreamFilter) Validate

func (f CDNStreamFilter) Validate() error

type CDNUnit

type CDNUnit struct {
	ID      string        `json:"id" db:"id"`
	Created time.Time     `json:"created" db:"created"`
	Name    string        `json:"name" db:"name"`
	Config  ServiceConfig `json:"config" db:"config"`
}

type CDNUnitHandlerRequest

type CDNUnitHandlerRequest struct {
	ID      string `json:"id" cli:"id"`
	Name    string `json:"name" cli:"name"`
	NbItems int64  `json:"nb_items" cli:"nb_items"`
}

type CDNWSEvent

type CDNWSEvent struct {
	ItemType   CDNItemType `json:"item_type"`
	JobRunID   int64       `json:"job_run_id"`
	ItemUnitID string      `json:"new_item_unit_id"`
}

type CDNWorkerCacheAPIRef

type CDNWorkerCacheAPIRef struct {
	ProjectKey string    `json:"project_key"`
	CacheTag   string    `json:"cache_tag"`
	ExpireAt   time.Time `json:"expire_at"`
}

func (*CDNWorkerCacheAPIRef) ToFilename

func (a *CDNWorkerCacheAPIRef) ToFilename() string

func (*CDNWorkerCacheAPIRef) ToHash

func (a *CDNWorkerCacheAPIRef) ToHash() (string, error)

type Cache

type Cache struct {
	ID              int64  `json:"id" cli:"id"`
	Project         string `json:"project"`
	Name            string `json:"name" cli:"name"`
	Tag             string `json:"tag"`
	TmpURL          string `json:"tmp_url"`
	SecretKey       string `json:"secret_key"`
	IntegrationName string `json:"integration_name"`

	Files            []string `json:"files"`
	WorkingDirectory string   `json:"working_directory"`
}

Cache define a file needed to be save for cache

func (*Cache) GetName

func (c *Cache) GetName() string

GetName returns the name the artifact

func (*Cache) GetPath

func (c *Cache) GetPath() string

GetPath returns the path of the artifact

type CanonicalFormUsage

type CanonicalFormUsage struct {
	Signer string `json:"signer" db:"signer"`
	Number int64  `json:"number" db:"number"`
	Latest bool   `json:"latest"`
}

type CanonicalFormUsageResume

type CanonicalFormUsageResume map[string][]CanonicalFormUsage

type CanonicalService

type CanonicalService struct {
	ID         int64         `json:"id" db:"id"`
	Name       string        `json:"name" db:"name" cli:"name,key"`
	ConsumerID *string       `json:"-" db:"auth_consumer_id"`
	Type       string        `json:"type" db:"type" cli:"type"`
	HTTPURL    string        `json:"http_url" db:"http_url" cli:"url"`
	Config     ServiceConfig `json:"config" db:"config" cli:"-"`
	PublicKey  []byte        `json:"public_key" db:"public_key"`
}

type CheckFunc

type CheckFunc func(string) bool

CheckFunc is a function to check key of a map for map merge

type ConfigUser

type ConfigUser struct {
	URLUI  string `json:"url.ui"`
	URLAPI string `json:"url.api"`
}

ConfigUser struct.

type DatabaseMigrationStatus

type DatabaseMigrationStatus struct {
	ID        string     `json:"id" db:"id" cli:"id,key"`
	Migrated  bool       `json:"migrated" db:"-" cli:"migrated"`
	AppliedAt *time.Time `json:"applied_at" db:"applied_at" cli:"applied_at"`
	// aggregates
	Database string `json:"database" db:"-" cli:"database"`
}

DatabaseMigrationStatus represents on migration script status

type DefaultValues

type DefaultValues struct {
	DefaultGroupName string
}

DefaultValues contains default user values for init DB

type DownloadableResource

type DownloadableResource struct {
	Name      string `json:"name"`
	OS        string `json:"os"`
	Arch      string `json:"arch"`
	Variant   string `json:"variant,omitempty"`
	Filename  string `json:"filename,omitempty"`
	Available *bool  `json:"available,omitempty"`
}

func AllDownloadableResources

func AllDownloadableResources() []DownloadableResource

func AllDownloadableResourcesWithAvailability

func AllDownloadableResourcesWithAvailability(directoriesDownload string) []DownloadableResource

AllDownloadableResourcesWithAvailability set flag Available on downloads list

type EncryptFunc

type EncryptFunc func(context.Context, gorp.SqlExecutor, int64, string, string) (string, error)

EncryptFunc is a common type

type EntitiesPermissions

type EntitiesPermissions map[string]Permissions

func (EntitiesPermissions) Level

func (e EntitiesPermissions) Level(s string) int

func (EntitiesPermissions) Permissions

func (e EntitiesPermissions) Permissions(s string) Permissions

type Environment

type Environment struct {
	ID                   int64                 `json:"id" yaml:"-" db:"id"`
	Name                 string                `json:"name" yaml:"name" cli:"name,key" db:"name"`
	Variables            []EnvironmentVariable `json:"variables,omitempty" yaml:"variables"`
	ProjectID            int64                 `json:"-" yaml:"-" db:"project_id"`
	ProjectKey           string                `json:"project_key" yaml:"-"`
	Created              time.Time             `json:"created" db:"created"`
	LastModified         time.Time             `json:"last_modified" db:"last_modified"`
	Keys                 []EnvironmentKey      `json:"keys"`
	Usage                *Usage                `json:"usage,omitempty"`
	FromRepository       string                `json:"from_repository,omitempty" db:"from_repository"`
	WorkflowAscodeHolder *Workflow             `json:"workflow_ascode_holder,omitempty" cli:"-"`
}

Environment represent a deployment environment

func NewEnvironment

func NewEnvironment(name string) *Environment

NewEnvironment instantiate a new Environment

func (Environment) GetKey

func (e Environment) GetKey(kname string) *EnvironmentKey

GetKey return a key by name

func (Environment) GetSSHKey

func (e Environment) GetSSHKey(kname string) *EnvironmentKey

GetSSHKey return a key by name

func (Environment) PGPKeys

func (e Environment) PGPKeys() []EnvironmentKey

PGPKeys returns the slice of pgp key for an environment

func (Environment) SSHKeys

func (e Environment) SSHKeys() []EnvironmentKey

SSHKeys returns the slice of ssh key for an environment

func (*Environment) UnmarshalJSON

func (e *Environment) UnmarshalJSON(data []byte) error

UnmarshalJSON custom for last modified.

type EnvironmentKey

type EnvironmentKey struct {
	ID            int64   `json:"id" db:"id" cli:"-"`
	Name          string  `json:"name" db:"name" cli:"name"`
	Public        string  `json:"public" db:"public" cli:"publickey"`
	Private       string  `json:"private" db:"private" cli:"-" gorpmapping:"encrypted,ID,Name"`
	KeyID         string  `json:"key_id" db:"key_id" cli:"-"`
	Type          KeyType `json:"type" db:"type" cli:"type"`
	EnvironmentID int64   `json:"environment_id" db:"environment_id"`
}

EnvironmentKey represent a key attach to an environment

type EnvironmentTemplate

type EnvironmentTemplate struct {
	Value string `json:"value"`
}

EnvironmentTemplate struct.

func (*EnvironmentTemplate) IsValid

func (e *EnvironmentTemplate) IsValid() error

IsValid returns environment template validity.

type EnvironmentTemplates

type EnvironmentTemplates []EnvironmentTemplate

EnvironmentTemplates struct.

func (*EnvironmentTemplates) Scan

func (e *EnvironmentTemplates) Scan(src interface{}) error

Scan environment templates.

func (EnvironmentTemplates) Value

func (e EnvironmentTemplates) Value() (driver.Value, error)

Value returns driver.Value from workflow template applications.

type EnvironmentVariable

type EnvironmentVariable struct {
	ID            int64  `json:"id,omitempty" cli:"-"`
	Name          string `json:"name" cli:"name,key"`
	Value         string `json:"value" cli:"value"`
	Type          string `json:"type" cli:"type"`
	EnvironmentID int64  `json:"environment_id" cli:"-"`
}

type EnvironmentVariableAudit

type EnvironmentVariableAudit struct {
	ID             int64                `json:"id" yaml:"-" db:"id"`
	EnvironmentID  int64                `json:"environment_id" yaml:"-" db:"environment_id"`
	VariableID     int64                `json:"variable_id" yaml:"-" db:"variable_id"`
	Type           string               `json:"type" yaml:"-" db:"type"`
	VariableBefore *EnvironmentVariable `json:"variable_before,omitempty" yaml:"-" db:"-"`
	VariableAfter  EnvironmentVariable  `json:"variable_after,omitempty" yaml:"-" db:"-"`
	Versionned     time.Time            `json:"versionned" yaml:"-" db:"versionned"`
	Author         string               `json:"author" yaml:"-" db:"author"`
}

EnvironmentVariableAudit represents an audit on an environment variable

type Error

type Error struct {
	ID         int         `json:"id"`
	Status     int         `json:"-"`
	Message    string      `json:"message"`
	Data       interface{} `json:"data,omitempty"`
	RequestID  string      `json:"request_id,omitempty"`
	StackTrace string      `json:"stack_trace,omitempty"`
	From       string      `json:"from,omitempty"`
}

Error type.

func ExtractHTTPError

func ExtractHTTPError(source error) Error

ExtractHTTPError tries to recognize given error and return http error with message in a language matching Accepted-Language.

func (Error) Error

func (e Error) Error() string

func (Error) Translate

func (e Error) Translate() string

type Event

type Event struct {
	Timestamp           time.Time        `json:"timestamp"`
	Hostname            string           `json:"hostname"`
	CDSName             string           `json:"cdsname"`
	EventType           string           `json:"type_event"` // go type of payload
	Payload             json.RawMessage  `json:"payload"`
	Attempts            int              `json:"attempt"`
	Username            string           `json:"username,omitempty"`
	UserMail            string           `json:"user_mail,omitempty"`
	ProjectKey          string           `json:"project_key,omitempty"`
	ApplicationName     string           `json:"application_name,omitempty"`
	PipelineName        string           `json:"pipeline_name,omitempty"`
	EnvironmentName     string           `json:"environment_name,omitempty"`
	WorkflowName        string           `json:"workflow_name,omitempty"`
	WorkflowRunNum      int64            `json:"workflow_run_num,omitempty"`
	WorkflowRunNumSub   int64            `json:"workflow_run_num_sub,omitempty"`
	WorkflowNodeRunID   int64            `json:"workflow_node_run_id,omitempty"`
	OperationUUID       string           `json:"operation_uuid,omitempty"`
	Status              string           `json:"status,omitempty"`
	Tags                []WorkflowRunTag `json:"tag,omitempty"`
	EventIntegrationsID []int64          `json:"event_integrations_id"`
}

Event represents a event from API Event is "create", "update", "delete" Status is "Waiting" "Building" "Success" "Fail" "Unknown", optional DateEvent is a date (timestamp format)

type EventActionAdd

type EventActionAdd struct {
	Action Action
}

EventActionAdd represents the event when adding an action.

type EventActionUpdate

type EventActionUpdate struct {
	OldAction Action
	NewAction Action
}

EventActionUpdate represents the event when updating an action.

type EventApplicationAdd

type EventApplicationAdd struct {
	Application
}

EventApplicationAdd represents the event when adding an application

type EventApplicationDelete

type EventApplicationDelete struct {
}

EventApplicationDelete represents the event when deleting an application

type EventApplicationKeyAdd

type EventApplicationKeyAdd struct {
	Key ApplicationKey `json:"key"`
}

EventApplicationKeyAdd represents the event when adding an application key

type EventApplicationKeyDelete

type EventApplicationKeyDelete struct {
	Key ApplicationKey `json:"key"`
}

EventApplicationKeyDelete represents the event when deleting an application key

type EventApplicationPermissionAdd

type EventApplicationPermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventApplicationPermissionAdd represents the event when adding an application permission

type EventApplicationPermissionDelete

type EventApplicationPermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventApplicationPermissionDelete represents the event when deleting an application permission

type EventApplicationPermissionUpdate

type EventApplicationPermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventApplicationPermissionUpdate represents the event when updating an application permission

type EventApplicationRepositoryAdd

type EventApplicationRepositoryAdd struct {
	VCSServer  string `json:"vcs_server"`
	Repository string `json:"repository"`
}

EventApplicationRepositoryAdd represents the event when adding a repository to an application

type EventApplicationRepositoryDelete

type EventApplicationRepositoryDelete struct {
	VCSServer  string `json:"vcs_server"`
	Repository string `json:"repository"`
}

EventApplicationRepositoryDelete represents the event when deleting a repository to an application

type EventApplicationUpdate

type EventApplicationUpdate struct {
	OldName               string             `json:"old_name"`
	NewName               string             `json:"new_name"`
	OldMetadata           Metadata           `json:"old_metadata"`
	NewMetadata           Metadata           `json:"new_metadata"`
	OldRepositoryStrategy RepositoryStrategy `json:"old_vcs_strategy"`
	NewRepositoryStrategy RepositoryStrategy `json:"new_vcs_strategy"`
}

EventApplicationUpdate represents the event when updating an application

type EventApplicationVariableAdd

type EventApplicationVariableAdd struct {
	Variable ApplicationVariable `json:"variable"`
}

EventApplicationVariableAdd represents the event when adding an application variable

type EventApplicationVariableDelete

type EventApplicationVariableDelete struct {
	Variable ApplicationVariable `json:"variable"`
}

EventApplicationVariableDelete represents the event when deleting an application variable

type EventApplicationVariableUpdate

type EventApplicationVariableUpdate struct {
	OldVariable ApplicationVariable `json:"old_variable"`
	NewVariable ApplicationVariable `json:"new_variable"`
}

EventApplicationVariableUpdate represents the event when updating an application variable

type EventApplicationVulnerabilityUpdate

type EventApplicationVulnerabilityUpdate struct {
	OldVulnerability Vulnerability `json:"old_vulnerability"`
	NewVulnerability Vulnerability `json:"new_vulnerability"`
}

EventApplicationVulnerabilityUpdate represents the event when updating a vulnerability

type EventAsCodeEvent

type EventAsCodeEvent struct {
	Event AsCodeEvent `json:"as_code_event"`
}

EventAsCodeEvent represents the event when add/update a workflow event

type EventBroadcastAdd

type EventBroadcastAdd struct {
	Broadcast
}

EventBroadcastAdd represents the event when adding a broadcast

type EventBroadcastDelete

type EventBroadcastDelete struct {
	BroadcastID int64
}

EventBroadcastDelete represents the event when deleting a broadcast

type EventBroadcastUpdate

type EventBroadcastUpdate struct {
	OldBroadcast Broadcast
	NewBroadcast Broadcast
}

EventBroadcastUpdate represents the event when updating a broadcast

type EventEngine

type EventEngine struct {
	Message string `json:"message"`
}

EventEngine contains event data for engine

type EventEnvironmentAdd

type EventEnvironmentAdd struct {
	Environment
}

EventEnvironmentAdd represents the event when adding an environment

type EventEnvironmentDelete

type EventEnvironmentDelete struct {
}

EventEnvironmentDelete represents the event when deleting an environment

type EventEnvironmentKeyAdd

type EventEnvironmentKeyAdd struct {
	Key EnvironmentKey `json:"key"`
}

EventEnvironmentKeyAdd represents the event when adding an environment key

type EventEnvironmentKeyDelete

type EventEnvironmentKeyDelete struct {
	Key EnvironmentKey `json:"key"`
}

EventEnvironmentKeyDelete represents the event when deleting an environment key

type EventEnvironmentPermissionAdd

type EventEnvironmentPermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventEnvironmentPermissionAdd represents the event when adding an environment permission

type EventEnvironmentPermissionDelete

type EventEnvironmentPermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventEnvironmentPermissionDelete represents the event when deleting an environment permission

type EventEnvironmentPermissionUpdate

type EventEnvironmentPermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventEnvironmentPermissionUpdate represents the event when updating an environment permission

type EventEnvironmentUpdate

type EventEnvironmentUpdate struct {
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

EventEnvironmentUpdate represents the event when updating an environment

type EventEnvironmentVariableAdd

type EventEnvironmentVariableAdd struct {
	Variable EnvironmentVariable `json:"variable"`
}

EventEnvironmentVariableAdd represents the event when adding an environment variable

type EventEnvironmentVariableDelete

type EventEnvironmentVariableDelete struct {
	Variable EnvironmentVariable `json:"variable"`
}

EventEnvironmentVariableDelete represents the event when deleting an environment variable

type EventEnvironmentVariableUpdate

type EventEnvironmentVariableUpdate struct {
	OldVariable EnvironmentVariable `json:"old_variable"`
	NewVariable EnvironmentVariable `json:"new_variable"`
}

EventEnvironmentVariableUpdate represents the event when updating an environment variable

type EventFake

type EventFake struct {
	Data int64 `json:"data"`
}

EventFake is used for test purpose

type EventFilter

type EventFilter struct {
	CurrentItem int            `json:"current_item"`
	Filter      TimelineFilter `json:"filter"`
}

EventFilter represents filters when getting events

type EventMaintenance

type EventMaintenance struct {
	Enable bool `json:"enable"`
}

EventMaintenance contains event data for maintenance event

type EventNotif

type EventNotif struct {
	Recipients []string `json:"recipients"`
	Subject    string   `json:"subject,omitempty"`
	Body       string   `json:"body,omitempty"`
}

EventNotif contains event data for a job

type EventOperation

type EventOperation struct {
	Operation
}

type EventPipelineAdd

type EventPipelineAdd struct {
	Pipeline
}

EventPipelineAdd represents the event when adding a pipeline

type EventPipelineDelete

type EventPipelineDelete struct {
}

EventPipelineDelete represents the event when deleting a pipeline

type EventPipelineJobAdd

type EventPipelineJobAdd struct {
	StageID         int64  `json:"stage_id"`
	StageName       string `json:"stage_name"`
	StageBuildOrder int    `json:"stage_build_order"`
	Job             Job    `json:"job"`
}

EventPipelineJobAdd represents the event when adding a job

type EventPipelineJobDelete

type EventPipelineJobDelete struct {
	StageID         int64  `json:"stage_id"`
	StageName       string `json:"stage_name"`
	StageBuildOrder int    `json:"stage_build_order"`
	JobName         string `json:"job_name"`
}

EventPipelineJobDelete represents the event when deleting a job

type EventPipelineJobUpdate

type EventPipelineJobUpdate struct {
	StageID         int64  `json:"stage_id"`
	StageName       string `json:"stage_name"`
	StageBuildOrder int    `json:"stage_build_order"`
	OldJob          Job    `json:"old_job"`
	NewJob          Job    `json:"new_job"`
}

EventPipelineJobUpdate represents the event when updating a job

type EventPipelineParameterAdd

type EventPipelineParameterAdd struct {
	Parameter Parameter `json:"parameter"`
}

EventPipelineParameterAdd represents the event when adding a pipeline parameter

type EventPipelineParameterDelete

type EventPipelineParameterDelete struct {
	Parameter Parameter `json:"parameter"`
}

EventPipelineParameterDelete represents the event when deleting a pipeline parameter

type EventPipelineParameterUpdate

type EventPipelineParameterUpdate struct {
	OldParameter Parameter `json:"old_parameter"`
	NewParameter Parameter `json:"new_parameter"`
}

EventPipelineParameterUpdate represents the event when updating a pipeline parameter

type EventPipelinePermissionAdd

type EventPipelinePermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventPipelinePermissionAdd represents the event when adding a pipeline permission

type EventPipelinePermissionDelete

type EventPipelinePermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventPipelinePermissionDelete represents the event when deleting a pipeline permission

type EventPipelinePermissionUpdate

type EventPipelinePermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventPipelinePermissionUpdate represents the event when updating a pipeline permission

type EventPipelineStageAdd

type EventPipelineStageAdd struct {
	Name         string         `json:"name"`
	BuildOrder   int            `json:"build_order"`
	Enabled      bool           `json:"enabled"`
	Prerequisite []Prerequisite `json:"prerequisite"`
}

EventPipelineStageAdd represents the event when adding a stage

type EventPipelineStageDelete

type EventPipelineStageDelete struct {
	ID         int64  `json:"id"`
	Name       string `json:"name"`
	BuildOrder int    `json:"build_order"`
}

EventPipelineStageDelete represents the event when deleting a stage

type EventPipelineStageMove

type EventPipelineStageMove struct {
	StageName          string `json:"stage_name"`
	StageID            int64  `json:"stage_id"`
	OldStageBuildOrder int    `json:"old_build_order"`
	NewStageBuildOrder int    `json:"new_build_order"`
}

EventPipelineStageMove represent the event when moving a stage

type EventPipelineStageUpdate

type EventPipelineStageUpdate struct {
	NewName         string         `json:"name"`
	NewBuildOrder   int            `json:"build_order"`
	NewPrerequisite []Prerequisite `json:"prerequisite"`
	OldName         string         `json:"old_name"`
	OldBuildOrder   int            `json:"old_build_order"`
	OldPrerequisite []Prerequisite `json:"old_prerequisite"`
	NewEnabled      bool           `json:"enabled"`
	OldEnabled      bool           `json:"old_enabled"`
}

EventPipelineStageUpdate represents the event when updating a stage

type EventPipelineUpdate

type EventPipelineUpdate struct {
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

EventPipelineUpdate represents the event when updating a pipeline

type EventProjectAdd

type EventProjectAdd struct {
	Variables   []ProjectVariable `json:"variables"`
	Permissions []GroupPermission `json:"groups_permission"`
	Keys        []ProjectKey      `json:"keys"`
	Metadata    Metadata          `json:"metadata"`
}

EventProjectAdd represents the event when adding a project

type EventProjectDelete

type EventProjectDelete struct {
}

EventProjectDelete represents the event when deleting a project

type EventProjectIntegrationAdd

type EventProjectIntegrationAdd struct {
	Integration ProjectIntegration `json:"integration"`
}

EventProjectIntegrationAdd represents the event when adding a project integration

type EventProjectIntegrationDelete

type EventProjectIntegrationDelete struct {
	Integration ProjectIntegration `json:"integration"`
}

EventProjectIntegrationDelete represents the event when deleting a project integration

type EventProjectIntegrationUpdate

type EventProjectIntegrationUpdate struct {
	OldIntegration  ProjectIntegration `json:"old_integration"`
	NewsIntegration ProjectIntegration `json:"new_integration"`
}

EventProjectIntegrationUpdate represents the event when updating a project integration

type EventProjectKeyAdd

type EventProjectKeyAdd struct {
	Key ProjectKey `json:"key"`
}

EventProjectKeyAdd represents the event when adding a project key

type EventProjectKeyDelete

type EventProjectKeyDelete struct {
	Key ProjectKey `json:"key"`
}

EventProjectKeyDelete represents the event when deleting a project key

type EventProjectPermissionAdd

type EventProjectPermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventProjectPermissionAdd represents the event when adding a project permission

type EventProjectPermissionDelete

type EventProjectPermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventProjectPermissionDelete represents the event when deleting a project permission

type EventProjectPermissionUpdate

type EventProjectPermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventProjectPermissionUpdate represents the event when updating a project permission

type EventProjectUpdate

type EventProjectUpdate struct {
	OldName     string   `json:"old_name"`
	NewName     string   `json:"new_name"`
	OldMetadata Metadata `json:"old_metadata"`
	NewMetadata Metadata `json:"new_metadata"`
}

EventProjectUpdate represents the event when updating a project

type EventProjectVCSServerAdd

type EventProjectVCSServerAdd struct {
	VCSServerName string `json:"vcs_server"`
}

EventProjectVCSServerAdd represents the event when adding a project vcs server

type EventProjectVCSServerDelete

type EventProjectVCSServerDelete struct {
	VCSServerName string `json:"vcs_server"`
}

EventProjectVCSServerDelete represents the event when deleting a project vcs server

type EventProjectVariableAdd

type EventProjectVariableAdd struct {
	Variable ProjectVariable `json:"variable"`
}

EventProjectVariableAdd represents the event when adding a project variable

type EventProjectVariableDelete

type EventProjectVariableDelete struct {
	Variable ProjectVariable `json:"variable"`
}

EventProjectVariableDelete represents the event when deleting a project variable

type EventProjectVariableUpdate

type EventProjectVariableUpdate struct {
	OldVariable ProjectVariable `json:"old_variable"`
	NewVariable ProjectVariable `json:"new_variable"`
}

EventProjectVariableUpdate represents the event when updating a project variable

type EventRetentionWorkflowDryRun

type EventRetentionWorkflowDryRun struct {
	Runs         []WorkflowRunToKeep `json:"runs"`
	Status       string              `json:"status"`
	Error        string              `json:"error"`
	RunsAnalyzed int64               `json:"nb_runs_analyzed"`
}

EventRetentionWorkflowDryRun represents the vent when execution dry run on workflow retention

type EventRunWorkflow

type EventRunWorkflow struct {
	ID               int64            `json:"id"`
	Number           int64            `json:"num"`
	Status           string           `json:"status"`
	Start            int64            `json:"start"`
	LastExecution    int64            `json:"last_execution"`
	LastModified     int64            `json:"last_modified"`
	LastModifiedNano int64            `json:"last_modified_nano"`
	Tags             []WorkflowRunTag `json:"tags"`
	ToDelete         bool             `json:"to_delete"`
}

EventRunWorkflow contains event data for a workflow run

type EventRunWorkflowJob

type EventRunWorkflowJob struct {
	ID     int64  `json:"id,omitempty"`
	Status string `json:"status,omitempty"`
	Start  int64  `json:"start,omitempty"`
	Done   int64  `json:"done,omitempty"`
}

EventRunWorkflowJob contains event data for a workflow job node run

type EventRunWorkflowNode

type EventRunWorkflowNode struct {
	ID                    int64                     `json:"id,omitempty"`
	NodeID                int64                     `json:"node_id,omitempty"`
	RunID                 int64                     `json:"run_id,omitempty"`
	Number                int64                     `json:"num,omitempty"`
	SubNumber             int64                     `json:"subnum,omitempty"`
	Status                string                    `json:"status,omitempty"`
	Start                 int64                     `json:"start,omitempty"`
	Done                  int64                     `json:"done,omitempty"`
	Payload               interface{}               `json:"payload,omitempty"`
	HookEvent             *WorkflowNodeRunHookEvent `json:"hook_event"`
	Manual                *WorkflowNodeRunManual    `json:"manual"`
	SourceNodeRuns        []int64                   `json:"source_node_runs"`
	WorkflowRunID         int64                     `json:"workflow_run_id"`
	RepositoryManagerName string                    `json:"repository_manager_name"`
	RepositoryFullName    string                    `json:"repository_full_name"`
	Hash                  string                    `json:"hash"`
	Tag                   string                    `json:"tag"`
	BranchName            string                    `json:"branch_name"`
	NodeName              string                    `json:"node_name"`
	StagesSummary         []StageSummary            `json:"stages_summary"`
	HookUUID              string                    `json:"hook_uuid"`
	HookLog               string                    `json:"log,omitempty"`
	NodeType              string                    `json:"node_type,omitempty"`
	GerritChange          *GerritChangeEvent        `json:"gerrit_change,omitempty"`
	EventIntegrations     []int64                   `json:"event_integrations_id,omitempty"`
}

EventRunWorkflowNode contains event data for a workflow node run

type EventRunWorkflowOutgoingHook

type EventRunWorkflowOutgoingHook struct {
	HookID            int64  `json:"hook_id"`
	ID                string `json:"id"`
	Status            string `json:"status,omitempty"`
	Start             int64  `json:"start,omitempty"`
	Done              int64  `json:"done,omitempty"`
	Log               string `json:"log,omitempty"`
	WorkflowRunID     int64  `json:"workflow_run_id"`
	WorkflowRunNumber *int64 `json:"workflow_run_number,omitempty"`
}

EventRunWorkflowOutgoingHook contains event data for a workflow outgoing hook run

type EventSubscription

type EventSubscription struct {
	UUID         string `json:"uuid"`
	ProjectKey   string `json:"key"`
	WorkflowName string `json:"workflow_name"`
	WorkflowNum  int64  `json:"num"`
	WorkflowRuns bool   `json:"runs"`
	Overwrite    bool   `json:"overwrite"`
}

EventSubscription data send to api to subscribe to an event

type EventWarningAdd

type EventWarningAdd struct {
	Warning
}

EventWarningAdd represents the event when adding a warning

type EventWarningDelete

type EventWarningDelete struct {
	Type    string
	Element string
}

EventWarningDelete represents the event when deleting a warning

type EventWarningUpdate

type EventWarningUpdate struct {
	Warning
}

EventWarningUpdate represents the event when updating a warning

type EventWorkflowAdd

type EventWorkflowAdd struct {
	Workflow Workflow `json:"workflow"`
}

EventWorkflowAdd represents the event when adding a workflow

type EventWorkflowDelete

type EventWorkflowDelete struct {
	Workflow Workflow `json:"workflow"`
}

EventWorkflowDelete represents the event when deleting a workflow

type EventWorkflowPermissionAdd

type EventWorkflowPermissionAdd struct {
	WorkflowID int64           `json:"workflow_id"`
	Permission GroupPermission `json:"group_permission"`
}

EventWorkflowPermissionAdd represents the event when adding a workflow permission

type EventWorkflowPermissionDelete

type EventWorkflowPermissionDelete struct {
	WorkflowID int64           `json:"workflow_id"`
	Permission GroupPermission `json:"group_permission"`
}

EventWorkflowPermissionDelete represents the event when deleting a workflow permission

type EventWorkflowPermissionUpdate

type EventWorkflowPermissionUpdate struct {
	WorkflowID    int64           `json:"workflow_id"`
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventWorkflowPermissionUpdate represents the event when updating a workflow permission

type EventWorkflowTemplateAdd

type EventWorkflowTemplateAdd struct {
	WorkflowTemplate WorkflowTemplate `json:"workflow_template"`
}

EventWorkflowTemplateAdd represents the event when adding a workflow template.

type EventWorkflowTemplateInstanceAdd

type EventWorkflowTemplateInstanceAdd struct {
	WorkflowTemplateInstance WorkflowTemplateInstance `json:"workflow_template_instance"`
}

EventWorkflowTemplateInstanceAdd represents the event when adding a workflow template instance.

type EventWorkflowTemplateInstanceUpdate

type EventWorkflowTemplateInstanceUpdate struct {
	OldWorkflowTemplateInstance WorkflowTemplateInstance `json:"old_workflow_template_instance"`
	NewWorkflowTemplateInstance WorkflowTemplateInstance `json:"new_workflow_template_instance"`
}

EventWorkflowTemplateInstanceUpdate represents the event when updating a workflow template instance.

type EventWorkflowTemplateUpdate

type EventWorkflowTemplateUpdate struct {
	OldWorkflowTemplate WorkflowTemplate `json:"old_workflow_template"`
	NewWorkflowTemplate WorkflowTemplate `json:"new_workflow_template"`
	ChangeMessage       string           `json:"change_message"`
}

EventWorkflowTemplateUpdate represents the event when updating a workflow template.

type EventWorkflowUpdate

type EventWorkflowUpdate struct {
	NewWorkflow Workflow `json:"new_workflow"`
	OldWorkflow Workflow `json:"old_workflow"`
}

EventWorkflowUpdate represents the event when updating a workflow

type ExecutedJob

type ExecutedJob struct {
	Job
	StepStatus []StepStatus `json:"step_status" db:"-"`
	Reason     string       `json:"reason" db:"-"`
	WorkerName string       `json:"worker_name" db:"-"`
	WorkerID   string       `json:"worker_id" db:"-"`
}

ExecutedJob represents a running job

func (ExecutedJob) ToSummary

func (j ExecutedJob) ToSummary() ExecutedJobSummary

ToSummary transforms an ExecutedJob to an ExecutedJobSummary

type ExecutedJobSummary

type ExecutedJobSummary struct {
	StepStatusSummary []StepStatusSummary `json:"step_status"`
	Reason            string              `json:"reason"`
	WorkerName        string              `json:"worker_name"`
	WorkerID          string              `json:"worker_id"`
	JobName           string              `json:"job_name"`
	PipelineActionID  int64               `json:"pipeline_action_id"`
	PipelineStageID   int64               `json:"pipeline_stage_id"`
	Steps             []ActionSummary     `json:"steps"`
}

ExecutedJobSummary is a light representation of ExecutedJob for CDS event

type Expiration

type Expiration int

Expiration defines how worker key should expire

type Favorite

type Favorite struct {
	ProjectIDs  []int64 `json:"project_ids" yaml:"project_ids"`
	WorkflowIDs []int64 `json:"workflow_ids" yaml:"workflow_ids"`
}

Favorite represent the favorites workflow or project of the user

type FavoriteParams

type FavoriteParams struct {
	Type         string `json:"type"`
	ProjectKey   string `json:"project_key"`
	WorkflowName string `json:"workflow_name,omitempty"`
}

FavoriteParams represents a project or workflow user's bookmark

type Feature

type Feature struct {
	ID   int64       `json:"id" db:"id" cli:"-" yaml:"-"`
	Name FeatureName `json:"name" db:"name" cli:"name" yaml:"name"`
	Rule string      `json:"rule" db:"rule" cli:"-" yaml:"rule"`
}

type FeatureEnabledResponse

type FeatureEnabledResponse struct {
	Name    FeatureName `json:"name"`
	Enabled bool        `json:"enabled"`
	Exists  bool        `json:"exists"`
}

type FeatureName

type FeatureName string
const (
	FeatureCDNArtifact  FeatureName = "cdn-artifact"
	FeatureCDNJobLogs   FeatureName = "cdn-job-logs"
	FeatureMFARequired  FeatureName = "mfa_required"
	FeaturePurgeName    FeatureName = "workflow-retention-policy"
	FeaturePurgeMaxRuns FeatureName = "workflow-retention-maxruns"
	FeatureTracing      FeatureName = "tracing"
	FeatureWorkflowV3   FeatureName = "workflow-v3"
	FeatureRegion       FeatureName = "region"
)

type FileInfo

type FileInfo struct {
	Size int64
	Md5  string
	Type string
}

type GRPCPlugin

type GRPCPlugin struct {
	ID                 int64              `json:"id" yaml:"id" cli:"id" db:"id"`
	Name               string             `json:"name" yaml:"name" cli:"name,key" db:"name"`
	Type               string             `json:"type" yaml:"type" cli:"type" db:"type"`
	Author             string             `json:"author" yaml:"author" cli:"author" db:"author"`
	Description        string             `json:"description" yaml:"description" cli:"description" db:"description"`
	Parameters         []Parameter        `json:"parameters,omitempty" yaml:"parameters,omitempty" cli:"parameters" db:"-"`
	Binaries           GRPCPluginBinaries `json:"binaries" yaml:"binaries" cli:"-" db:"binaries"`
	IntegrationModelID *int64             `json:"-" db:"integration_model_id" yaml:"-" cli:"-"`
	Integration        string             `json:"integration" db:"-" yaml:"integration" cli:"integration"`
}

GRPCPlugin is the type representing a plugin over GRPC

func (GRPCPlugin) GetBinary

func (p GRPCPlugin) GetBinary(os, arch string) *GRPCPluginBinary

GetBinary returns the binary for a specific os and arch

func (*GRPCPlugin) Validate

func (p *GRPCPlugin) Validate() error

type GRPCPluginBinaries

type GRPCPluginBinaries []GRPCPluginBinary

func (*GRPCPluginBinaries) Scan

func (b *GRPCPluginBinaries) Scan(src interface{}) error

Scan plugin binaries.

func (GRPCPluginBinaries) Value

func (b GRPCPluginBinaries) Value() (driver.Value, error)

Value returns driver.Value from plugin binary slice.

type GRPCPluginBinary

type GRPCPluginBinary struct {
	OS               string          `json:"os,omitempty" yaml:"os"`
	Arch             string          `json:"arch,omitempty" yaml:"arch"`
	Name             string          `json:"name,omitempty" yaml:"-"`
	ObjectPath       string          `json:"object_path,omitempty" yaml:"-"`
	Size             int64           `json:"size,omitempty" yaml:"-"`
	Perm             uint32          `json:"perm,omitempty" yaml:"-"`
	MD5sum           string          `json:"md5sum,omitempty" yaml:"-"`
	SHA512sum        string          `json:"sha512sum,omitempty" yaml:"-"`
	TempURL          string          `json:"temp_url,omitempty" yaml:"-"`
	TempURLSecretKey string          `json:"-" yaml:"-"`
	Entrypoints      []string        `json:"entrypoints,omitempty" yaml:"entrypoints"`
	Cmd              string          `json:"cmd,omitempty" yaml:"cmd"`
	Args             []string        `json:"args,omitempty" yaml:"args"`
	Requirements     RequirementList `json:"requirements,omitempty" yaml:"requirements"`
	FileContent      []byte          `json:"file_content,omitempty" yaml:"-"` //only used for upload
	PluginName       string          `json:"plugin_name,omitempty" yaml:"-"`
}

GRPCPluginBinary represents a binary file (for a specific os and arch) serving a GRPCPlugin

func (GRPCPluginBinary) GetName

func (b GRPCPluginBinary) GetName() string

GetName is a part of the objectstore.Object interface implementation

func (GRPCPluginBinary) GetPath

func (b GRPCPluginBinary) GetPath() string

GetPath is a part of the objectstore.Object interface implementation

type GerritChangeEvent

type GerritChangeEvent struct {
	ID         string `json:"id,omitempty"`
	Project    string `json:"project,omitempty"`
	DestBranch string `json:"dest_branch,omitempty"`
	Revision   string `json:"revision,omitempty"`
	Report     string `json:"report,omitempty"`
	URL        string `json:"url,omitempty"`
}

GerritChangeEvent Gerrit information that are needed on event

type GerritEventExecution

type GerritEventExecution struct {
	Message []byte `json:"message"`
}

GerritEventExecution contains specific data for a gerrit event execution

type GoRoutine

type GoRoutine struct {
	Name    string
	Func    func(ctx context.Context)
	Restart bool
	Active  bool
	// contains filtered or unexported fields
}

type GoRoutines

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

GoRoutines contains list of routines that have to stay up

func NewGoRoutines

func NewGoRoutines(ctx context.Context) *GoRoutines

NewGoRoutines instanciates a new GoRoutineManager

func (*GoRoutines) Exec

func (m *GoRoutines) Exec(c context.Context, name string, fn func(ctx context.Context))

Exec runs the function within a goroutine with a panic recovery

func (*GoRoutines) GetStatus

func (m *GoRoutines) GetStatus() []MonitoringStatusLine

GetStatus returns the monitoring status of goroutines that should be running

func (*GoRoutines) GoRoutine

func (m *GoRoutines) GoRoutine(name string) *GoRoutine

func (*GoRoutines) Run

func (m *GoRoutines) Run(c context.Context, name string, fn func(ctx context.Context))

Run runs the function within a goroutine with a panic recovery, and keep GoRoutine status.

func (*GoRoutines) RunWithRestart

func (m *GoRoutines) RunWithRestart(c context.Context, name string, fn func(ctx context.Context))

RunWithRestart runs the function within a goroutine with a panic recovery, and keep GoRoutine status. if the goroutine is stopped, it will ne restarted

type Group

type Group struct {
	ID   int64  `json:"id" yaml:"-" db:"id"`
	Name string `json:"name" yaml:"name" cli:"name,key" db:"name"`
	// aggregate
	Members      GroupMembers `json:"members,omitempty" yaml:"members,omitempty" db:"-"`
	Admin        bool         `json:"admin,omitempty" yaml:"admin,omitempty" db:"-"`
	Organization string       `json:"organization,omitempty" yaml:"organization,omitempty" cli:"organization" db:"-"`
}

Group represent a group of user.

func (Group) IsAdmin

func (g Group) IsAdmin(u AuthentifiedUser) bool

IsAdmin checks if given authentified user is admin for current group, group should have members aggregated and authentified user old user struct should be set.

func (Group) IsMember

func (g Group) IsMember(groupIDs []int64) bool

IsMember checks if given group memeber is part of current group.

func (Group) IsValid

func (g Group) IsValid() error

IsValid returns an error if given group is not valid.

type GroupMember

type GroupMember struct {
	ID           string `json:"id" yaml:"id" cli:"id,key"`
	Username     string `json:"username" yaml:"username" cli:"username"`
	Fullname     string `json:"fullname" yaml:"fullname,omitempty" cli:"fullname"`
	Admin        bool   `json:"admin,omitempty" yaml:"admin,omitempty" cli:"admin"`
	Organization string `json:"organization,omitempty" yaml:"organization,omitempty" cli:"organization"`
}

GroupMember struct.

type GroupMembers

type GroupMembers []GroupMember

func (GroupMembers) CheckAdminExists

func (m GroupMembers) CheckAdminExists() error

func (GroupMembers) ComputeOrganization

func (m GroupMembers) ComputeOrganization() (string, error)

func (GroupMembers) DiffUserIDs

func (m GroupMembers) DiffUserIDs(o GroupMembers) []string

func (GroupMembers) IsValid

func (m GroupMembers) IsValid() error

func (GroupMembers) UserIDs

func (m GroupMembers) UserIDs() []string

type GroupPermission

type GroupPermission struct {
	Group      Group `json:"group"`
	Permission int   `json:"permission"`
}

GroupPermission represent a group and his role in the project

func (GroupPermission) IsValid

func (g GroupPermission) IsValid() error

IsValid returns an error if group permission is not valid.

type GroupPermissions

type GroupPermissions []GroupPermission

func (GroupPermissions) ComputeOrganization

func (g GroupPermissions) ComputeOrganization() (string, error)

type Groups

type Groups []Group

Groups type provides useful func on group list.

func (Groups) HasOneOf

func (g Groups) HasOneOf(groupIDs ...int64) bool

HasOneOf returns true if one of the given ids is in groups list.

func (Groups) ToIDs

func (g Groups) ToIDs() []int64

ToIDs returns ids for groups.

func (Groups) ToMap

func (g Groups) ToMap() map[int64]Group

ToMap returns a map of groups by ids.

type IDName

type IDName struct {
	ID          int64   `json:"id" db:"id"`
	Name        string  `json:"name" db:"name"`
	Description string  `json:"description,omitempty" db:"description"`
	Icon        string  `json:"icon,omitempty" db:"icon"`
	Labels      []Label `json:"labels,omitempty" db:"-"`
}

IDName is generally used when you want to get basic informations from db

type IDNames

type IDNames []IDName

func (IDNames) IDs

func (idNames IDNames) IDs() []int64

func (IDNames) Names

func (idNames IDNames) Names() []string

type Identifiable

type Identifiable interface {
	GetUsername() string
	GetEmail() string
	GetFullname() string
}

type Int64Slice

type Int64Slice []int64

Int64Slice type used for database json storage.

func (*Int64Slice) Contains

func (s *Int64Slice) Contains(v int64) bool

Contains return true if given value is in the slice.

func (*Int64Slice) Remove

func (s *Int64Slice) Remove(v int64)

Remove all occurrences of given value from the slice.

func (*Int64Slice) Scan

func (s *Int64Slice) Scan(src interface{}) error

Scan int64 slice.

func (*Int64Slice) Unique

func (s *Int64Slice) Unique()

Remove duplicated value from slice.

func (Int64Slice) Value

func (s Int64Slice) Value() (driver.Value, error)

Value returns driver.Value from int64 slice.

type IntegrationConfig

type IntegrationConfig map[string]IntegrationConfigValue

IntegrationConfig represent the configuration of an integration

func (IntegrationConfig) Blur

func (config IntegrationConfig) Blur()

func (IntegrationConfig) Clone

func (config IntegrationConfig) Clone() IntegrationConfig

Clone return a copy of the config (with a copy of the underlying data structure)

func (IntegrationConfig) DecryptSecrets

func (config IntegrationConfig) DecryptSecrets(decryptFunc func(string) (string, error)) error

DecryptSecrets decrypt secrets given a cypher func

func (IntegrationConfig) EncryptSecrets

func (config IntegrationConfig) EncryptSecrets(encryptFunc func(string) (string, error)) error

EncryptSecrets encrypt secrets given a cypher func

func (*IntegrationConfig) HideSecrets

func (config *IntegrationConfig) HideSecrets()

HideSecrets replaces password with a placeholder

func (IntegrationConfig) MergeWith

func (config IntegrationConfig) MergeWith(cfg IntegrationConfig)

MergeWith set new values from new config and update existing values if not default.

func (*IntegrationConfig) Scan

func (config *IntegrationConfig) Scan(src interface{}) error

Scan IntegrationConfig.

func (IntegrationConfig) SetValue

func (config IntegrationConfig) SetValue(name string, value string)

Set value

func (IntegrationConfig) Value

func (config IntegrationConfig) Value() (driver.Value, error)

Value returns driver.Value from IntegrationConfig.

type IntegrationConfigMap

type IntegrationConfigMap map[string]IntegrationConfig

func (IntegrationConfigMap) Blur

func (config IntegrationConfigMap) Blur()

func (IntegrationConfigMap) Clone

func (*IntegrationConfigMap) Scan

func (config *IntegrationConfigMap) Scan(src interface{}) error

Scan IntegrationConfig.

func (IntegrationConfigMap) Value

func (config IntegrationConfigMap) Value() (driver.Value, error)

Value returns driver.Value from IntegrationConfig.

type IntegrationConfigValue

type IntegrationConfigValue struct {
	Value       string `json:"value" yaml:"value"`
	Type        string `json:"type" yaml:"type"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	Static      bool   `json:"static,omitempty" yaml:"static,omitempty"`
}

IntegrationConfigValue represent a configuration value for a integration

type IntegrationModel

type IntegrationModel struct {
	ID                      int64                `json:"id" db:"id" yaml:"-" cli:"-"`
	Name                    string               `json:"name" db:"name" yaml:"name" cli:"name,key"`
	Author                  string               `json:"author" db:"author" yaml:"author" cli:"author"`
	Identifier              string               `json:"identifier" db:"identifier" yaml:"identifier,omitempty"`
	Icon                    string               `json:"icon" db:"icon" yaml:"icon"`
	DefaultConfig           IntegrationConfig    `json:"default_config" db:"default_config" yaml:"default_config"`
	AdditionalDefaultConfig IntegrationConfig    `json:"additional_default_config" db:"additional_default_config" yaml:"additional_default_config"`
	PublicConfigurations    IntegrationConfigMap `json:"public_configurations,omitempty" db:"cipher_public_configurations" yaml:"public_configurations"`
	Disabled                bool                 `json:"disabled" db:"disabled" yaml:"disabled"`
	Hook                    bool                 `json:"hook" db:"hook" yaml:"hook" cli:"hooks_supported"`
	Storage                 bool                 `json:"storage" db:"storage" yaml:"storage" cli:"storage supported"`
	Deployment              bool                 `json:"deployment" db:"deployment" yaml:"deployment" cli:"deployment_supported"`
	Compute                 bool                 `json:"compute" db:"compute" yaml:"compute" cli:"compute_supported"`
	Event                   bool                 `json:"event" db:"event" yaml:"event" cli:"event_supported"`
	ArtifactManager         bool                 `json:"artifact_manager" db:"artifact_manager" yaml:"artifact_manager" cli:"artifact_manager_supported"`
	Public                  bool                 `json:"public,omitempty" db:"public" yaml:"public,omitempty"`
}

IntegrationModel represent a integration model with its default configuration

func (*IntegrationModel) Blur

func (p *IntegrationModel) Blur()

func (IntegrationModel) IsBuiltin

func (p IntegrationModel) IsBuiltin() bool

IsBuiltin checks is the model is builtin or not

type IntegrationType

type IntegrationType string

IntegrationType represents all different type of integrations

type Job

type Job struct {
	PipelineActionID int64                  `json:"pipeline_action_id"`
	PipelineStageID  int64                  `json:"pipeline_stage_id"`
	Enabled          bool                   `json:"enabled"`
	LastModified     int64                  `json:"last_modified"`
	Action           Action                 `json:"action"`
	Warnings         []PipelineBuildWarning `json:"warnings"`
}

Job is the element of a stage

func (Job) IsValid

func (j Job) IsValid() error

IsValid returns job's validity.

type KafkaTaskExecution

type KafkaTaskExecution struct {
	Message []byte `json:"message"`
}

KafkaTaskExecution contains specific data for a kafka hook

type Key

type Key struct {
	ID      int64   `json:"id" db:"id" cli:"-"`
	Name    string  `json:"name" db:"name" cli:"name"`
	Public  string  `json:"public" db:"public" cli:"publickey"`
	Private string  `json:"private" db:"private" cli:"-"`
	KeyID   string  `json:"keyID" db:"key_id" cli:"-"`
	Type    KeyType `json:"type" db:"type" cli:"type"`
}

Key represent a key of type SSH or GPG.

type KeyType

type KeyType string
const (
	KeyTypeSSH KeyType = "ssh"
	KeyTypePGP KeyType = "pgp"
)

Those are types if key managed in CDS

func (KeyType) String

func (k KeyType) String() string

type KeyValues

type KeyValues struct {
	Key    string
	Values []string
}

type Label

type Label struct {
	ID         int64  `json:"id" db:"id"`
	Name       string `json:"name" db:"name" cli:"label,key"`
	Color      string `json:"color" db:"color"`
	ProjectID  int64  `json:"project_id" db:"project_id"`
	WorkflowID int64  `json:"workflow_id,omitempty" db:"-"`
}

Label represent a label linked to a workflow

func (*Label) IsValid

func (label *Label) IsValid() error

IsValid return an error or update label if it is not valid.

type Labels

type Labels []Label

Labels slice.

func (Labels) IsValid

func (l Labels) IsValid() error

IsValid returns an error if a label is not valid.

type LastModification

type LastModification struct {
	Key          string `json:"key,omitempty"`
	Name         string `json:"name"`
	Username     string `json:"username"`
	LastModified int64  `json:"last_modified"`
	Type         string `json:"type,omitempty"`
}

LastModification is stored in cache and used for ProjectLastUpdates computing

type MergeCommitProperty

type MergeCommitProperty struct {
	ID        string `json:"id"`
	DisplayID string `json:"displayId"`
}

type Message

type Message struct {
	ID     string
	Format trad
	Args   []interface{}
	Type   string
}

Message represent a struc format translated messages

func ErrorToMessage

func ErrorToMessage(err error) (Message, bool)

ErrorToMessage returns message from an error if possible

func NewMessage

func NewMessage(m *Message, args ...interface{}) Message

NewMessage instanciantes a new message

func (*Message) String

func (m *Message) String() string

String returns formated string for the specified language

func (Message) ToSpawnMsg

func (m Message) ToSpawnMsg() SpawnMsg

type Metadata

type Metadata map[string]string

Metadata represents metadata

func (*Metadata) Scan

func (a *Metadata) Scan(src interface{}) error

Scan Metadata.

func (Metadata) Value

func (a Metadata) Value() (driver.Value, error)

Value returns driver.Value from Metadata.

type Metric

type Metric struct {
	ProjectKey    string             `json:"project_key"`
	ApplicationID int64              `json:"application_id"`
	WorkflowID    int64              `json:"workflow_id"`
	Key           string             `json:"key"`
	Value         map[string]float64 `json:"value"`
	Date          time.Time          `json:"timestamp"`
	Num           int64              `json:"run"`
}

Metric represent a CDS metric

type MetricRequest

type MetricRequest struct {
	ProjectKey    string `json:"project_key"`
	ApplicationID int64  `json:"application_id"`
	WorkflowID    int64  `json:"workflow_id"`
	Key           string `json:"key"`
}

MetricRequest represents the request to retrieve metrics

type Migration

type Migration struct {
	ID        int64     `json:"id" db:"id" cli:"id"`
	Name      string    `json:"name" db:"name" cli:"name"`
	Status    string    `json:"status" db:"status" cli:"status"`
	Progress  string    `json:"progress" db:"progress" cli:"progress"`
	Error     string    `json:"error" db:"error" cli:"error"`
	Automatic bool      `json:"automatic" db:"mandatory" cli:"automatic"`
	Created   time.Time `json:"created" db:"created" cli:"created"`
	Done      time.Time `json:"done" db:"done" cli:"done"`
	Release   string    `json:"release" db:"release" cli:"release"`
	Major     uint64    `json:"major" db:"major" cli:"major"`
	Minor     uint64    `json:"minor" db:"minor" cli:"minor"`
	Patch     uint64    `json:"patch" db:"patch" cli:"patch"`
	Blocker   bool      `json:"-" db:"-" cli:"-"`

	ExecFunc func(ctx context.Context) error `json:"-" db:"-" cli:"-" yaml:"-"`
}

Migration represent a CDS migration

type Model

type Model struct {
	ID                  int64               `json:"id" db:"id" cli:"-"`
	Name                string              `json:"name" db:"name" cli:"name,key"`
	Description         string              `json:"description" db:"description" cli:"description"`
	Type                string              `json:"type" db:"type" cli:"type"`
	Disabled            bool                `json:"disabled" db:"disabled" cli:"disabled"`
	Restricted          bool                `json:"restricted" db:"restricted" cli:"restricted"`
	RegisteredOS        *string             `json:"registered_os" db:"registered_os" cli:"-"`
	RegisteredArch      *string             `json:"registered_arch" db:"registered_arch" cli:"-"`
	NeedRegistration    bool                `json:"need_registration" db:"need_registration" cli:"-"`
	LastRegistration    time.Time           `json:"last_registration" db:"last_registration" cli:"-"`
	CheckRegistration   bool                `json:"check_registration" db:"check_registration" cli:"-"`
	UserLastModified    time.Time           `json:"user_last_modified" db:"user_last_modified" cli:"-"`
	Author              Author              `json:"created_by" db:"created_by" cli:"-"`
	GroupID             int64               `json:"group_id" db:"group_id" cli:"-"`
	NbSpawnErr          int64               `json:"nb_spawn_err" db:"nb_spawn_err" cli:"nb_spawn_err"`
	LastSpawnErr        *string             `json:"last_spawn_err" db:"last_spawn_err" cli:"-"`
	LastSpawnErrLogs    *string             `json:"last_spawn_err_log" db:"last_spawn_err_log" cli:"-"`
	DateLastSpawnErr    *time.Time          `json:"date_last_spawn_err" db:"date_last_spawn_err" cli:"-"`
	IsDeprecated        bool                `json:"is_deprecated" db:"is_deprecated" cli:"deprecated"`
	ModelVirtualMachine ModelVirtualMachine `json:"model_virtual_machine,omitempty" db:"model_virtual_machine" cli:"-"`
	ModelDocker         ModelDocker         `json:"model_docker,omitempty" db:"model_docker" cli:"-"`
	// aggregates
	Editable               bool          `json:"editable,omitempty" db:"-"`
	Group                  *Group        `json:"group" db:"-" cli:"-"`
	RegisteredCapabilities []Requirement `json:"registered_capabilities" db:"-" cli:"-"`
	IsOfficial             bool          `json:"is_official" db:"-" cli:"official"`
	PatternName            string        `json:"pattern_name,omitempty" db:"-" cli:"-"`
}

Model represents a worker model (ex: Go 1.5.1 Docker Images) with specified capabilities (ex: go, golint and go2xunit binaries)

func (Model) IsValid

func (m Model) IsValid() error

IsValid returns error if the model is not valid.

func (Model) IsValidType

func (m Model) IsValidType() error

func (Model) Path

func (m Model) Path() string

Path returns full path of the model that contains group and model names.

func (*Model) Update

func (m *Model) Update(data Model)

Update workflow template field from new data.

type ModelCmds

type ModelCmds struct {
	Envs    map[string]string `json:"envs,omitempty"`
	Shell   string            `json:"shell,omitempty"`
	PreCmd  string            `json:"pre_cmd,omitempty"`
	Cmd     string            `json:"cmd,omitempty"`
	PostCmd string            `json:"post_cmd,omitempty"`
}

ModelCmds is the struct to represent a pattern

func (*ModelCmds) Scan

func (m *ModelCmds) Scan(src interface{}) error

Scan model cmds.

func (ModelCmds) Value

func (m ModelCmds) Value() (driver.Value, error)

Value returns driver.Value from model cmds.

type ModelDocker

type ModelDocker struct {
	Image    string            `json:"image,omitempty"`
	Private  bool              `json:"private,omitempty"`
	Registry string            `json:"registry,omitempty"`
	Username string            `json:"username,omitempty"`
	Password string            `json:"password,omitempty"`
	Memory   int64             `json:"memory,omitempty"`
	Envs     map[string]string `json:"envs,omitempty"`
	Shell    string            `json:"shell,omitempty"`
	Cmd      string            `json:"cmd,omitempty"`
}

ModelDocker for swarm, marathon and kubernetes.

func (*ModelDocker) Scan

func (m *ModelDocker) Scan(src interface{}) error

Scan model docker.

func (ModelDocker) Value

func (m ModelDocker) Value() (driver.Value, error)

Value returns driver.Value from model docker.

type ModelPattern

type ModelPattern struct {
	ID    int64     `json:"id" db:"id"`
	Name  string    `json:"name" db:"name"`
	Type  string    `json:"type" db:"type"`
	Model ModelCmds `json:"model" db:"model"`
}

ModelPattern represent patterns for users and admin when creating a worker model

type ModelVirtualMachine

type ModelVirtualMachine struct {
	Image    string `json:"image,omitempty"`
	Flavor   string `json:"flavor,omitempty"`
	PreCmd   string `json:"pre_cmd,omitempty"`
	Cmd      string `json:"cmd,omitempty"`
	PostCmd  string `json:"post_cmd,omitempty"`
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

ModelVirtualMachine for openstack or vsphere.

func (*ModelVirtualMachine) Scan

func (m *ModelVirtualMachine) Scan(src interface{}) error

Scan model virtual machine.

func (ModelVirtualMachine) Value

func (m ModelVirtualMachine) Value() (driver.Value, error)

Value returns driver.Value from model virtual machine.

type Models

type Models []Model

type MonDBMigrate

type MonDBMigrate struct {
	ID        string    `db:"id" cli:"id"`
	AppliedAt time.Time `db:"applied_at" cli:"applied_at"`
}

MonDBMigrate is used by /mon/db/migrate

type MonitoringStatus

type MonitoringStatus struct {
	Now   time.Time              `json:"now"`
	Lines []MonitoringStatusLine `json:"lines"`

	ServiceType     string `json:"-"`
	ServiceName     string `json:"-"`
	ServiceHostname string `json:"-"`
}

MonitoringStatus contains status of CDS Component

func (*MonitoringStatus) AddLine

func (m *MonitoringStatus) AddLine(lines ...MonitoringStatusLine)

AddLine adds line to MonitoringStatus, including the Type of component

func (MonitoringStatus) HTTPStatusCode

func (m MonitoringStatus) HTTPStatusCode() int

HTTPStatusCode returns the http status code

func (*MonitoringStatus) Scan

func (m *MonitoringStatus) Scan(src interface{}) error

Scan workflow template request.

func (MonitoringStatus) Value

func (m MonitoringStatus) Value() (driver.Value, error)

Value returns driver.Value from workflow template request.

type MonitoringStatusLine

type MonitoringStatusLine struct {
	Status     string `json:"status" cli:"status"`
	Component  string `json:"component" cli:"component"`
	Value      string `json:"value" cli:"value"`
	Type       string `json:"type" cli:"type"`
	Service    string `json:"service" cli:"service"`
	Hostname   string `json:"hostname" cli:"hostname"`
	SessionID  string `json:"session,omitempty" cli:"session"`
	ConsumerID string `json:"consumer,omitempty" cli:"consumer"`
}

MonitoringStatusLine represents a CDS Component Status

func (MonitoringStatusLine) String

func (l MonitoringStatusLine) String() string

type MultiError

type MultiError []error

MultiError is just an array of error

func (*MultiError) Append

func (e *MultiError) Append(err error)

Append appends an error to a MultiError

func (*MultiError) Error

func (e *MultiError) Error() string

func (*MultiError) IsEmpty

func (e *MultiError) IsEmpty() bool

IsEmpty return true if MultiError is empty, false otherwise

func (*MultiError) Join

func (e *MultiError) Join(j MultiError)

Join joins errors from MultiError to another errors MultiError

type NavbarProjectData struct {
	Key             string `json:"key" db:"key"`
	Name            string `json:"name" db:"project_name"`
	Description     string `json:"description" db:"description"`
	ApplicationName string `json:"application_name,omitempty" db:"application_name"`
	WorkflowName    string `json:"workflow_name,omitempty" db:"workflow_name"`
	Type            string `json:"type,omitempty" db:"type"`
	Favorite        bool   `json:"favorite" db:"favorite"`
}

NavbarProjectData is the sub struct returned by getNavbarHandler

type Node

type Node struct {
	ID                  int64             `json:"id" db:"id"`
	WorkflowID          int64             `json:"workflow_id" db:"workflow_id"`
	Name                string            `json:"name" db:"name"`
	Ref                 string            `json:"ref" db:"ref"`
	Type                string            `json:"type" db:"type"`
	Triggers            []NodeTrigger     `json:"triggers" db:"-"`
	TriggerID           int64             `json:"-" db:"-"`
	Context             *NodeContext      `json:"context" db:"-"`
	OutGoingHookContext *NodeOutGoingHook `json:"outgoing_hook" db:"-"`
	JoinContext         []NodeJoin        `json:"parents" db:"-"`
	Hooks               []NodeHook        `json:"hooks" db:"-"`
	Groups              []GroupPermission `json:"groups,omitempty" db:"-"`
}

Node represents a node in a workflow

func (*Node) AddTrigger

func (n *Node) AddTrigger(name string, dest Node)

AddTrigger adds a trigger to the destination node from the node found by its name

func (*Node) Ancestors

func (n *Node) Ancestors(w WorkflowData) []int64

func (Node) CheckApplicationDeploymentStrategies

func (n Node) CheckApplicationDeploymentStrategies(proj Project, w *Workflow) error

CheckApplicationDeploymentStrategies checks application deployment strategies

func (*Node) FilterHooksConfig

func (n *Node) FilterHooksConfig(s ...string)

FilterHooksConfig filter all hooks configuration and remove somme configuration key

func (Node) GetHook

func (n Node) GetHook(UUID string) *NodeHook

func (*Node) IsLinkedToRepo

func (n *Node) IsLinkedToRepo(w *Workflow) bool

IsLinkedToRepo returns boolean to know if the node is linked to an application which is also linked to a repository

func (*Node) Sort

func (n *Node) Sort()

Sort sorts the workflow node

func (*Node) VisitNode

func (n *Node) VisitNode(w *Workflow, visitor func(node *Node, w *Workflow))

VisitNode all the workflow and apply the visitor func on the current node and the children

type NodeContext

type NodeContext struct {
	ID                        int64                  `json:"id" db:"id"`
	NodeID                    int64                  `json:"node_id" db:"node_id"`
	PipelineID                int64                  `json:"pipeline_id" db:"pipeline_id"`
	PipelineName              string                 `json:"pipeline_name" db:"-"`
	ApplicationID             int64                  `json:"application_id" db:"application_id"`
	ApplicationName           string                 `json:"application_name" db:"-"`
	EnvironmentID             int64                  `json:"environment_id" db:"environment_id"`
	EnvironmentName           string                 `json:"environment_name" db:"-"`
	ProjectIntegrationID      int64                  `json:"project_integration_id" db:"project_integration_id"`
	ProjectIntegrationName    string                 `json:"project_integration_name" db:"-"`
	DefaultPayload            interface{}            `json:"default_payload,omitempty" db:"-"`
	DefaultPipelineParameters []Parameter            `json:"default_pipeline_parameters" db:"-"`
	Conditions                WorkflowNodeConditions `json:"conditions" db:"-"`
	Mutex                     bool                   `json:"mutex" db:"mutex"`
}

NodeContext represents a node linked to a pipeline

func (*NodeContext) DefaultPayloadToMap

func (c *NodeContext) DefaultPayloadToMap() (map[string]string, error)

func (*NodeContext) HasDefaultPayload

func (c *NodeContext) HasDefaultPayload() bool

type NodeHook

type NodeHook struct {
	ID            int64                  `json:"id" db:"id"`
	UUID          string                 `json:"uuid" db:"uuid"`
	NodeID        int64                  `json:"node_id" db:"node_id"`
	HookModelID   int64                  `json:"hook_model_id" db:"hook_model_id"`
	HookModelName string                 `json:"hook_model_name" db:"-"`
	Config        WorkflowNodeHookConfig `json:"config" db:"config"`
	Conditions    WorkflowNodeConditions `json:"conditions" db:"conditions"`
}

NodeHook represents a hook which cann trigger the workflow from a given node

func (NodeHook) ConfigValueContainsEventsDefault

func (h NodeHook) ConfigValueContainsEventsDefault() bool

func (NodeHook) Equals

func (h NodeHook) Equals(h1 NodeHook) bool

Equals checks functional equality between two hooks

func (NodeHook) GetConfigValue

func (h NodeHook) GetConfigValue(k string) (string, bool)

func (NodeHook) IsRepositoryWebHook

func (h NodeHook) IsRepositoryWebHook() bool

func (NodeHook) Ref

func (h NodeHook) Ref() string

type NodeJoin

type NodeJoin struct {
	ID         int64  `json:"id" db:"id"`
	NodeID     int64  `json:"node_id" db:"node_id"`
	ParentName string `json:"parent_name,omitempty" db:"-"`
	ParentID   int64  `json:"parent_id,omitempty" db:"parent_id"`
}

NodeJoin represents a join type node

type NodeOutGoingHook

type NodeOutGoingHook struct {
	ID            int64                  `json:"id" db:"id"`
	NodeID        int64                  `json:"node_id" db:"node_id"`
	HookModelID   int64                  `json:"hook_model_id" db:"hook_model_id"`
	HookModelName string                 `json:"-" db:"-"`
	Config        WorkflowNodeHookConfig `json:"config" db:"-"`
}

NodeOutGoingHook represents the link between a node a its outgoings hooks

type NodeTrigger

type NodeTrigger struct {
	ID             int64  `json:"id" db:"id"`
	ParentNodeID   int64  `json:"parent_node_id" db:"parent_node_id"`
	ChildNodeID    int64  `json:"child_node_id" db:"child_node_id"`
	ParentNodeName string `json:"parent_node_name" db:"-"`
	ChildNode      Node   `json:"child_node" db:"-"`
}

NodeTrigger represents the link between 2 nodes

type Operation

type Operation struct {
	UUID               string                   `json:"uuid"`
	VCSServer          string                   `json:"vcs_server,omitempty"`
	RepoFullName       string                   `json:"repo_fullname,omitempty"`
	URL                string                   `json:"url"`
	RepositoryStrategy RepositoryStrategy       `json:"strategy,omitempty"`
	Setup              OperationSetup           `json:"setup,omitempty"`
	LoadFiles          OperationLoadFiles       `json:"load_files,omitempty"`
	Status             OperationStatus          `json:"status"`
	Error              *OperationError          `json:"error_details,omitempty"`
	DeprecatedError    string                   `json:"error,omitempty"`
	RepositoryInfo     *OperationRepositoryInfo `json:"repository_info,omitempty"`
	Date               *time.Time               `json:"date,omitempty"`
	User               struct {
		Username string `json:"username,omitempty"  db:"-" cli:"-"`
		Fullname string `json:"fullname,omitempty"  db:"-" cli:"-"`
		Email    string `json:"email,omitempty"  db:"-" cli:"-"`
	} `json:"user,omitempty"`
	RequestID string `json:"request_id,omitempty"`
	NbRetries int    `json:"nb_retries,omitempty"`
}

Operation is the main business object use in repositories service

type OperationCheckout

type OperationCheckout struct {
	Tag    string `json:"tag,omitempty"`
	Branch string `json:"branch,omitempty"`
	Commit string `json:"commit,omitempty"`
}

OperationCheckout represents a smart git checkout

type OperationError

type OperationError struct {
	ID         int    `json:"id"`
	Status     int    `json:"status,omitempty"`
	Message    string `json:"message"`
	StackTrace string `json:"stack_trace,omitempty"`
	From       string `json:"from,omitempty"`
}

func ToOperationError

func ToOperationError(err error) *OperationError

func (*OperationError) ToError

func (opError *OperationError) ToError() error

type OperationLoadFiles

type OperationLoadFiles struct {
	Pattern string            `json:"pattern,omitempty"`
	Results map[string][]byte `json:"results,omitempty"`
}

OperationLoadFiles represents files loading from a globbing pattern

type OperationPush

type OperationPush struct {
	FromBranch string `json:"from_branch,omitempty"`
	ToBranch   string `json:"to_branch,omitempty"`
	Message    string `json:"message,omitempty"`
	PRLink     string `json:"pr_link,omitempty"`
	Update     bool   `json:"update,omitempty"`
}

OperationPush represents information about push operation

type OperationRepo

type OperationRepo struct {
	Basedir            string
	URL                string
	RepositoryStrategy RepositoryStrategy
}

OperationRepo is an operation

func (OperationRepo) ID

func (r OperationRepo) ID() string

ID returns a generated ID for a Operation

type OperationRepositoryInfo

type OperationRepositoryInfo struct {
	Name          string `json:"name,omitempty"`
	FetchURL      string `json:"fetch_url,omitempty"`
	DefaultBranch string `json:"default_branch,omitempty"`
}

OperationRepositoryInfo represents global information about the repository

type OperationSetup

type OperationSetup struct {
	Checkout OperationCheckout `json:"checkout,omitempty"`
	Push     OperationPush     `json:"push,omitempty"`
}

OperationSetup is the setup for an operation basically its a checkout

type OperationStatus

type OperationStatus int

OperationStatus is the status of an operation

const (
	OperationStatusPending OperationStatus = iota
	OperationStatusProcessing
	OperationStatusDone
	OperationStatusError
)

There are the different OperationStatus values

type Parameter

type Parameter struct {
	ID          int64  `json:"id" yaml:"-"`
	Name        string `json:"name"`
	Type        string `json:"type"`
	Value       string `json:"value"`
	Description string `json:"description,omitempty" yaml:"desc,omitempty"`
	Advanced    bool   `json:"advanced,omitempty" yaml:"advanced,omitempty"`
}

Parameter can be a String/Date/Script/URL...

func ApplicationVariablesToParameters

func ApplicationVariablesToParameters(prefix string, variables []ApplicationVariable) []Parameter

func EnvironmentVariablesToParameters

func EnvironmentVariablesToParameters(prefix string, variables []EnvironmentVariable) []Parameter

func NewStringParameter

func NewStringParameter(s string) (Parameter, error)

NewStringParameter creates a Parameter from a string with <name>=<value> format

func ParameterFind

func ParameterFind(vars []Parameter, s string) *Parameter

ParameterFind return a parameter given its name if it exists in array

func ParametersFromMap

func ParametersFromMap(m map[string]string) []Parameter

ParametersFromMap returns an array of parameters from a map

func ParametersMerge

func ParametersMerge(src []Parameter, overwritter []Parameter) []Parameter

ParametersMerge merges two slices of parameters

func ProjectVariablesToParameters

func ProjectVariablesToParameters(prefix string, variables []ProjectVariable) []Parameter

func VariablesToParameters

func VariablesToParameters(prefix string, variables []Variable) []Parameter

func (Parameter) IsValid

func (p Parameter) IsValid() error

IsValid returns error if the parameter is not valid.

type Permissions

type Permissions struct {
	Readable   bool `json:"readable"`
	Writable   bool `json:"writable"`
	Executable bool `json:"executable"`
}

func (Permissions) IsMaxLevel

func (p Permissions) IsMaxLevel() bool

IsMaxLevel returns true if permissions has level 7 (writable + readable + executable)

func (Permissions) Level

func (p Permissions) Level() int

type Pipeline

type Pipeline struct {
	ID             int64         `json:"id" yaml:"-" db:"id"`
	Name           string        `json:"name" cli:"name,key" db:"name"`
	Description    string        `json:"description" cli:"description" db:"description"`
	ProjectKey     string        `json:"projectKey" db:"projectKey"`
	ProjectID      int64         `json:"-" db:"project_id"`
	Stages         []Stage       `json:"stages"`
	Parameter      []Parameter   `json:"parameters,omitempty"`
	Usage          *Usage        `json:"usage,omitempty"`
	LastModified   int64         `json:"last_modified" cli:"modified"`
	FromRepository string        `json:"from_repository" cli:"from_repository" db:"from_repository"`
	AsCodeEvents   []AsCodeEvent `json:"ascode_events" cli:"-" db:"-"`
	// aggregate
	WorkflowAscodeHolder *Workflow `json:"workflow_ascode_holder,omitempty" cli:"-" db:"-"`
}

Pipeline represents the complete behavior of CDS for each projects

type PipelineAction

type PipelineAction struct {
	ActionName      string      `json:"actionName"`
	Args            []Parameter `json:"args"`
	PipelineStageID int64       `json:"pipeline_stage_id"`
}

PipelineAction represents an action in a pipeline

type PipelineAudit

type PipelineAudit struct {
	ID         int64     `json:"id" db:"id"`
	PipelineID int64     `json:"pipeline_id" db:"pipeline_id"`
	UserName   string    `json:"username" db:"username"`
	Versionned time.Time `json:"versionned" db:"versionned"`
	Pipeline   *Pipeline `json:"pipeline" db:"-"`
	Action     string    `json:"action" db:"action"`
}

PipelineAudit represents pipeline audit

type PipelineBuildWarning

type PipelineBuildWarning struct {
	Type   string `json:"type"`
	Action Action `json:"action"`
}

PipelineBuildWarning Struct for display warnings about build

type PipelineTemplate

type PipelineTemplate struct {
	Value string `json:"value"`
}

PipelineTemplate struct.

func (*PipelineTemplate) IsValid

func (p *PipelineTemplate) IsValid() error

IsValid returns pipeline template validity.

type PipelineTemplates

type PipelineTemplates []PipelineTemplate

PipelineTemplates struct.

func (*PipelineTemplates) Scan

func (p *PipelineTemplates) Scan(src interface{}) error

Scan pipeline templates.

func (PipelineTemplates) Value

func (p PipelineTemplates) Value() (driver.Value, error)

Value returns driver.Value from workflow template pipelines.

type Prerequisite

type Prerequisite struct {
	Parameter     string `json:"parameter"`
	ExpectedValue string `json:"expected_value"`
}

Prerequisite defines a expected value to one triggering pipeline parameter

type Project

type Project struct {
	ID           int64     `json:"-" yaml:"-" db:"id" cli:"-"`
	Key          string    `json:"key" yaml:"key" db:"projectkey" cli:"key,key"`
	Name         string    `json:"name" yaml:"name" db:"name" cli:"name"`
	Description  string    `json:"description" yaml:"description" db:"description" cli:"description"`
	Icon         string    `json:"icon" yaml:"icon" db:"icon" cli:"-"`
	Created      time.Time `json:"created" yaml:"created" db:"created" `
	LastModified time.Time `json:"last_modified" yaml:"last_modified" db:"last_modified"`
	// aggregates
	Workflows        []Workflow             `json:"workflows,omitempty" yaml:"workflows,omitempty" db:"-" cli:"-"`
	WorkflowNames    IDNames                `json:"workflow_names,omitempty" yaml:"workflow_names,omitempty" db:"-" cli:"-"`
	Pipelines        []Pipeline             `json:"pipelines,omitempty" yaml:"pipelines,omitempty" db:"-"  cli:"-"`
	PipelineNames    IDNames                `json:"pipeline_names,omitempty" yaml:"pipeline_names,omitempty" db:"-"  cli:"-"`
	Applications     []Application          `json:"applications,omitempty" yaml:"applications,omitempty" db:"-"  cli:"-"`
	ApplicationNames IDNames                `json:"application_names,omitempty" yaml:"application_names,omitempty" db:"-"  cli:"-"`
	ProjectGroups    GroupPermissions       `json:"groups,omitempty" yaml:"permissions,omitempty" db:"-"  cli:"-"`
	Variables        []ProjectVariable      `json:"variables,omitempty" yaml:"variables,omitempty" db:"-"  cli:"-"`
	Environments     []Environment          `json:"environments,omitempty" yaml:"environments,omitempty" db:"-"  cli:"-"`
	EnvironmentNames IDNames                `json:"environment_names,omitempty" yaml:"environment_names,omitempty" db:"-"  cli:"-"`
	Labels           []Label                `json:"labels,omitempty" yaml:"labels,omitempty" db:"-"  cli:"-"`
	Permissions      Permissions            `json:"permissions" yaml:"-" db:"-"  cli:"-"`
	Metadata         Metadata               `json:"metadata" yaml:"metadata" db:"metadata" cli:"-"`
	Keys             []ProjectKey           `json:"keys,omitempty" yaml:"keys" db:"-" cli:"-"`
	VCSServers       []ProjectVCSServerLink `json:"vcs_servers" yaml:"vcs_servers" db:"-" cli:"-"`
	Integrations     []ProjectIntegration   `json:"integrations" yaml:"integrations" db:"-" cli:"-"`
	Features         map[string]bool        `json:"features" yaml:"features" db:"-" cli:"-"`
	Favorite         bool                   `json:"favorite" yaml:"favorite" db:"-" cli:"favorite"`
	URLs             URL                    `json:"urls" yaml:"-" db:"-" cli:"-"`
	Organization     string                 `json:"organization" yaml:"-" db:"-" cli:"-"`
}

Project represent a team with group of users and pipelines

func (Project) GetIntegration

func (proj Project) GetIntegration(pfName string) (ProjectIntegration, bool)

GetIntegration returns the ProjectIntegration given a name

func (Project) GetIntegrationByID

func (proj Project) GetIntegrationByID(id int64) *ProjectIntegration

GetIntegrationByID returns the ProjectIntegration given a name

func (Project) GetSSHKey

func (proj Project) GetSSHKey(name string) *ProjectKey

GetSSHKey returns a ssh key given his name

func (Project) IsValid

func (proj Project) IsValid() error

IsValid returns error if the project is not valid.

func (Project) PGPKeys

func (proj Project) PGPKeys() []ProjectKey

PGPKeys returns the slice of pgp key for a project

func (Project) SSHKeys

func (proj Project) SSHKeys() []ProjectKey

SSHKeys returns the slice of ssh key for an application

func (*Project) SetApplication

func (proj *Project) SetApplication(app Application)

SetApplication data on project

func (*Project) SetEnvironment

func (proj *Project) SetEnvironment(env Environment)

SetEnvironment data on project

func (*Project) SetPipeline

func (proj *Project) SetPipeline(pip Pipeline)

SetPipeline data on project

type ProjectFilter

type ProjectFilter struct {
	Key           string   `json:"key"`
	WorkflowNames []string `json:"workflow_names"`
}

ProjectFilter represents filter on a project

type ProjectGroup

type ProjectGroup struct {
	Project    Project `json:"project"`
	Permission int     `json:"permission"`
}

ProjectGroup represent a link with a project

type ProjectIntegration

type ProjectIntegration struct {
	ID                 int64             `json:"id" db:"id" yaml:"-"`
	ProjectID          int64             `json:"project_id" db:"project_id" yaml:"-"`
	Name               string            `json:"name" db:"name" cli:"name,key" yaml:"name"`
	IntegrationModelID int64             `json:"integration_model_id" db:"integration_model_id" yaml:"-"`
	Model              IntegrationModel  `json:"model" db:"-" yaml:"model"`
	Config             IntegrationConfig `json:"config" db:"cipher_config" yaml:"config" gorpmapping:"encrypted,ProjectID,IntegrationModelID"`
	// GRPCPlugin field is used to get all plugins associatied to an integration
	// when we GET /project/{permProjectKey}/integrations/{integrationName}
	GRPCPlugins []GRPCPlugin `json:"integration_plugins,omitempty" db:"-" yaml:"-"`
}

ProjectIntegration is an instanciation of a integration model

func (*ProjectIntegration) Blur

func (pf *ProjectIntegration) Blur()

Blur replaces password with a placeholder

type ProjectKey

type ProjectKey struct {
	ID        int64   `json:"id" db:"id" cli:"-"`
	Name      string  `json:"name" db:"name" cli:"name"`
	Public    string  `json:"public" db:"public" cli:"publickey"`
	Private   string  `json:"private" db:"private" cli:"-" gorpmapping:"encrypted,ID,Name"`
	KeyID     string  `json:"key_id" db:"key_id" cli:"-"`
	Type      KeyType `json:"type" db:"type" cli:"type"`
	ProjectID int64   `json:"project_id" db:"project_id" cli:"-"`
	Builtin   bool    `json:"-" db:"builtin" cli:"-"`
}

ProjectKey represent a key attach to a project

type ProjectLastUpdates

type ProjectLastUpdates struct {
	LastModification
	Applications []LastModification `json:"applications"`
	Pipelines    []LastModification `json:"pipelines"`
	Environments []LastModification `json:"environments"`
	Workflows    []LastModification `json:"workflows"`
}

ProjectLastUpdates update times of project, application and pipelines Deprecated

type ProjectVCSServer

type ProjectVCSServer struct {
	Name     string            `json:"name" yaml:"name" db:"-" cli:"name"`
	Username string            `json:"username" yaml:"username" db:"-" cli:"username"`
	Data     map[string]string `json:"-" yaml:"data" db:"-" cli:"-"`
}

ProjectVCSServer represents associations between a project and a vcs server

func (ProjectVCSServer) Hash

func (vcs ProjectVCSServer) Hash() uint64

Hash creating a unique hash value

type ProjectVCSServerLink struct {
	ID                       int64                      `json:"id" db:"id" cli:"-"`
	ProjectID                int64                      `json:"project_id" db:"project_id" cli:"-"`
	Name                     string                     `json:"name" db:"name" cli:"name"`
	Username                 string                     `json:"username" db:"username" cli:"username"`
	VCSProject               string                     `json:"vcs_project" db:"vcs_project" cli:"vcs_project"` // not used for the moment
	ProjectVCSServerLinkData []ProjectVCSServerLinkData `json:"-" db:"-"`
}

func (ProjectVCSServerLink) Get

func (l ProjectVCSServerLink) Get(key string) (string, bool)

func (*ProjectVCSServerLink) Set

func (l *ProjectVCSServerLink) Set(key, value string)

type ProjectVCSServerLinkData

type ProjectVCSServerLinkData struct {
	ID                     int64  `json:"id" db:"id"`
	ProjectVCSServerLinkID int64  `json:"project_vcs_server_link_id" db:"project_vcs_server_link_id"`
	Key                    string `json:"key" db:"key"`
	Value                  string `json:"value" db:"cipher_value" gorpmapping:"encrypted,ID,ProjectVCSServerLinkID"`
}

type ProjectVariable

type ProjectVariable struct {
	ID        int64  `json:"id,omitempty" cli:"-"`
	Name      string `json:"name" cli:"name,key"`
	Value     string `json:"value" cli:"value"`
	Type      string `json:"type" cli:"type"`
	ProjectID int64  `json:"project_id" cli:"-"`
}

type ProjectVariableAudit

type ProjectVariableAudit struct {
	ID             int64            `json:"id" yaml:"-" db:"id"`
	ProjectID      int64            `json:"project_id" yaml:"-" db:"project_id"`
	VariableID     int64            `json:"variable_id" yaml:"-" db:"variable_id"`
	Type           string           `json:"type" yaml:"-" db:"type"`
	VariableBefore *ProjectVariable `json:"variable_before,omitempty" yaml:"-" db:"-"`
	VariableAfter  ProjectVariable  `json:"variable_after,omitempty" yaml:"-" db:"-"`
	Versionned     time.Time        `json:"versionned" yaml:"-" db:"versionned"`
	Author         string           `json:"author" yaml:"-" db:"author"`
}

ProjectVariableAudit represents an audit on a project variable

type Projects

type Projects []Project

func (Projects) Keys

func (projects Projects) Keys() []string

type PullRequestProperties

type PullRequestProperties struct {
	MergeCommit MergeCommitProperty `json:"mergeCommit"`
}

type PurgeDryRunRequest

type PurgeDryRunRequest struct {
	RetentionPolicy string `json:"retention_policy"`
}

type PurgeDryRunResponse

type PurgeDryRunResponse struct {
	NbRunsToAnalize int64 `json:"nb_runs_to_analyze"`
}

type PurgeTags

type PurgeTags []string

func (*PurgeTags) Scan

func (a *PurgeTags) Scan(src interface{}) error

Scan PurgeTags.

func (PurgeTags) Value

func (a PurgeTags) Value() (driver.Value, error)

Value returns driver.Value from PurgeTags.

type RabbitMQTaskExecution

type RabbitMQTaskExecution struct {
	Message []byte `json:"message"`
}

RabbitMQTaskExecution contains specific data for a kafka hook

type ReleaseAsset

type ReleaseAsset struct {
	ID                 *int       `json:"id,omitempty"`
	URL                *string    `json:"url,omitempty"`
	Name               *string    `json:"name,omitempty"`
	Label              *string    `json:"label,omitempty"`
	State              *string    `json:"state,omitempty"`
	ContentType        *string    `json:"content_type,omitempty"`
	Size               *int       `json:"size,omitempty"`
	DownloadCount      *int       `json:"download_count,omitempty"`
	CreatedAt          *Timestamp `json:"created_at,omitempty"`
	UpdatedAt          *Timestamp `json:"updated_at,omitempty"`
	BrowserDownloadURL *string    `json:"browser_download_url,omitempty"`
}

ReleaseAsset represents a GitHub release asset in a repository.

type Repository

type Repository struct {
	URL  string
	Hook bool
}

Repository structs contains all needed information about a single repository

type RepositoryEvents

type RepositoryEvents struct {
	PushEvents        []VCSPushEvent        `json:"push_events" db:"-"`
	CreateEvents      []VCSCreateEvent      `json:"create_events" db:"-"`
	DeleteEvents      []VCSDeleteEvent      `json:"delete_events" db:"-"`
	PullRequestEvents []VCSPullRequestEvent `json:"pullrequest_events" db:"-"`
}

RepositoryEvents group all repository events

type RepositoryPollerExecution

type RepositoryPollerExecution struct {
	ID                    int64            `json:"id" db:"id"`
	ApplicationID         int64            `json:"-" db:"application_id"`
	PipelineID            int64            `json:"-" db:"pipeline_id"`
	ExecutionPlannedDate  time.Time        `json:"execution_planned_date,omitempty" db:"execution_planned_date"`
	ExecutionDate         *time.Time       `json:"execution_date" db:"execution_date"`
	Executed              bool             `json:"executed" db:"executed"`
	PipelineBuildVersions map[string]int64 `json:"pipeline_build_version" db:"-"`
	Error                 string           `json:"error" db:"error"`
	RepositoryEvents
}

RepositoryPollerExecution is a polling execution

type RepositoryRelease

type RepositoryRelease struct {
	ID              *int           `json:"id,omitempty"`
	TagName         *string        `json:"tag_name,omitempty"`
	TargetCommitish *string        `json:"target_commitish,omitempty"`
	Name            *string        `json:"name,omitempty"`
	Body            *string        `json:"body,omitempty"`
	Draft           *bool          `json:"draft,omitempty"`
	Prerelease      *bool          `json:"prerelease,omitempty"`
	CreatedAt       *Timestamp     `json:"created_at,omitempty"`
	PublishedAt     *Timestamp     `json:"published_at,omitempty"`
	URL             *string        `json:"url,omitempty"`
	HTMLURL         *string        `json:"html_url,omitempty"`
	AssetsURL       *string        `json:"assets_url,omitempty"`
	Assets          []ReleaseAsset `json:"assets,omitempty"`
	UploadURL       *string        `json:"upload_url,omitempty"`
	ZipballURL      *string        `json:"zipball_url,omitempty"`
	TarballURL      *string        `json:"tarball_url,omitempty"`
}

RepositoryRelease represents a GitHub release in a repository.

type RepositoryStrategy

type RepositoryStrategy struct {
	ConnectionType string `json:"connection_type"`
	SSHKey         string `json:"ssh_key"`
	SSHKeyContent  string `json:"ssh_key_content,omitempty"`
	User           string `json:"user"`
	Password       string `json:"password"`
	Branch         string `json:"branch,omitempty"`
	DefaultBranch  string `json:"default_branch,omitempty"`
	PGPKey         string `json:"pgp_key"`
}

RepositoryStrategy represents the way to use the repository

type Requirement

type Requirement struct {
	ID       int64  `json:"id" db:"id"`
	ActionID int64  `json:"action_id" db:"action_id"`
	Name     string `json:"name" yaml:"name" db:"name"`
	Type     string `json:"type" yaml:"type" db:"type"`
	Value    string `json:"value" yaml:"value" db:"value"`
}

Requirement can be : - a binary "which /usr/bin/docker"

type RequirementList

type RequirementList []Requirement

RequirementList is a list of requirement

func RequirementListDeduplicate

func RequirementListDeduplicate(l RequirementList) RequirementList

RequirementListDeduplicate returns requirements list without duplicate values.

func (RequirementList) IsValid

func (l RequirementList) IsValid() error

IsValid returns requirement list validity.

func (RequirementList) Values

func (l RequirementList) Values() []string

Values returns all Requirement.Value

type Result

type Result struct {
	ID           int64      `json:"id,omitempty"`
	BuildID      int64      `json:"buildID,omitempty"`
	Status       string     `json:"status,omitempty"`
	Version      int64      `json:"version,omitempty"`
	Reason       string     `json:"reason,omitempty"`
	RemoteTime   time.Time  `json:"remoteTime,omitempty"`
	Duration     string     `json:"duration,omitempty"`
	NewVariables []Variable `json:"new_variables,omitempty"`
}

type ScheduledTaskExecution

type ScheduledTaskExecution struct {
	DateScheduledExecution string `json:"date_scheduled_execution"`
}

ScheduledTaskExecution contains specific data for a scheduled task execution

type SchemaResponse

type SchemaResponse struct {
	Workflow    string `json:"workflow"`
	Application string `json:"application"`
	Pipeline    string `json:"pipeline"`
	Environment string `json:"environment"`
}

SchemaResponse contains all json schema for a user.

type Secret

type Secret struct {
	ProjectID int64  `json:"project_id" db:"project_id" cli:"-"`
	Name      string `json:"name" db:"content_name" cli:"name,key"`
	Token     string `json:"token" db:"token" cli:"token"`
	Status    string `json:"status" db:"-" cli:"status"`
}

type Service

type Service struct {
	CanonicalService
	LastHeartbeat    time.Time        `json:"last_heartbeat" db:"last_heartbeat" cli:"heartbeat"`
	MonitoringStatus MonitoringStatus `json:"monitoring_status" db:"-" cli:"-"`
	Version          string           `json:"version" db:"-" cli:"version"`
	Uptodate         bool             `json:"up_to_date" db:"-"`
}

Service is a µService registered on CDS API.

func (*Service) Update

func (s *Service) Update(data Service)

Update service field from new data.

type ServiceConfig

type ServiceConfig map[string]interface{}

func (*ServiceConfig) Scan

func (c *ServiceConfig) Scan(src interface{}) error

Scan workflow template request.

func (ServiceConfig) Value

func (c ServiceConfig) Value() (driver.Value, error)

Value returns driver.Value from workflow template request.

type ServiceConfiguration

type ServiceConfiguration struct {
	Name       string `toml:"name" json:"name"`
	URL        string `toml:"url" json:"url"`
	Port       string `toml:"port" json:"port"`
	Path       string `toml:"path" json:"path"`
	HealthURL  string `toml:"healthUrl" json:"health_url"`
	HealthPort string `toml:"healthPort" json:"health_port"`
	HealthPath string `toml:"healthPath" json:"health_path"`
	Type       string `toml:"type" json:"type"`
	PublicKey  string `json:"publicKey"`
	ID         int64  `json:"id"`
}

ServiceConfiguration is the configuration of service

type ServiceStatus

type ServiceStatus struct {
	ID               int64            `json:"-" db:"id"`
	MonitoringStatus MonitoringStatus `json:"monitoring_status" db:"monitoring_status" cli:"-"`
	ServiceID        int64            `json:"-" db:"service_id"`
	SessionID        *string          `json:"-" db:"auth_session_id"`
}

ServiceStatus contains the status for a service. The status can be attached to a sesion_id : all services except api or a serviceId for API instance.

type SpawnErrorForm

type SpawnErrorForm struct {
	Error string
	Logs  []byte
}

SpawnErrorForm represents the arguments needed to add error registration on worker model

type SpawnInfo

type SpawnInfo struct {
	APITime    time.Time `json:"api_time,omitempty" db:"-" mapstructure:"-"`
	RemoteTime time.Time `json:"remote_time,omitempty" db:"-" mapstructure:"-"`
	Message    SpawnMsg  `json:"message,omitempty" db:"-"`
	// UserMessage contains msg translated for end user
	UserMessage string `json:"user_message,omitempty" db:"-"`
}

SpawnInfo contains an information about spawning

type SpawnMsg

type SpawnMsg struct {
	ID   string        `json:"id" db:"-"`
	Args []interface{} `json:"args" db:"-"`
	Type string        `json:"type" db:"-"`
}

SpawnMsg represents a msg for spawnInfo

func SpawnMsgNew

func SpawnMsgNew(msg Message, args ...interface{}) SpawnMsg

func (SpawnMsg) DefaultUserMessage

func (s SpawnMsg) DefaultUserMessage() string

type Stage

type Stage struct {
	ID            int64                  `json:"id" yaml:"pipeline_stage_id"`
	Name          string                 `json:"name"`
	PipelineID    int64                  `json:"-" yaml:"-"`
	BuildOrder    int                    `json:"build_order"`
	Enabled       bool                   `json:"enabled"`
	RunJobs       []WorkflowNodeJobRun   `json:"run_jobs"`
	Prerequisites []Prerequisite         `json:"prerequisites"` //TODO: to delete
	Conditions    WorkflowNodeConditions `json:"conditions"`
	LastModified  time.Time              `json:"last_modified"`
	Jobs          []Job                  `json:"jobs"`
	Status        string                 `json:"status"`
	Warnings      []PipelineBuildWarning `json:"warnings"`
}

Stage Pipeline step that parallelize actions by order

func NewStage

func NewStage(name string) *Stage

NewStage instantiate a new Stage

func (*Stage) PlainConditions

func (s *Stage) PlainConditions() []WorkflowNodeCondition

Conditions returns stage prerequisites as a set of WorkflowTriggerCondition regex

func (Stage) ToSummary

func (s Stage) ToSummary() StageSummary

ToSummary transforms a Stage into a StageSummary

func (*Stage) UnmarshalJSON

func (s *Stage) UnmarshalJSON(data []byte) error

type StageSummary

type StageSummary struct {
	ID             int64                       `json:"id"`
	Name           string                      `json:"name"`
	BuildOrder     int                         `json:"build_order"`
	Enabled        bool                        `json:"enabled"`
	Status         string                      `json:"status"`
	Jobs           []Job                       `json:"jobs"`
	RunJobsSummary []WorkflowNodeJobRunSummary `json:"run_jobs_summary"`
}

StageSummary is a light representation of stage for CDS event

type StaticFiles

type StaticFiles struct {
	ID                   int64     `json:"id" db:"id" cli:"id"`
	Name                 string    `json:"name" db:"name" cli:"name"`
	WorkflowID           int64     `json:"workflow_id" db:"-"`
	NodeRunID            int64     `json:"workflow_node_run_id" db:"workflow_node_run_id"`
	NodeJobRunID         int64     `json:"workflow_node_run_job_id,omitempty" db:"-"`
	EntryPoint           string    `json:"entrypoint" db:"entrypoint"`
	StaticKey            string    `json:"static_key" db:"static_key"`
	PublicURL            string    `json:"public_url" db:"public_url" cli:"public_url"`
	Created              time.Time `json:"created" db:"created" cli:"created"`
	ProjectIntegrationID *int64    `json:"project_integration_id" db:"project_integration_id"`

	TempURL   string `json:"temp_url,omitempty" db:"-"`
	SecretKey string `json:"secret_key,omitempty" db:"-"`
}

StaticFiles define a files needed to be save for serving static files

func (StaticFiles) Equal

func (staticfile StaticFiles) Equal(currStaticfile StaticFiles) bool

Equal returns true if StaticFiles are equal to another one

func (*StaticFiles) GetName

func (staticfile *StaticFiles) GetName() string

GetName returns the name the artifact

func (*StaticFiles) GetPath

func (staticfile *StaticFiles) GetPath() string

GetPath returns the path of the artifact

type StepStatus

type StepStatus struct {
	StepOrder int       `json:"step_order" db:"-"`
	Status    string    `json:"status" db:"-"`
	Start     time.Time `json:"start" db:"-"`
	Done      time.Time `json:"done" db:"-"`
}

StepStatus Represent a step and his status

func (StepStatus) ToSummary

func (ss StepStatus) ToSummary() StepStatusSummary

ToSummary transform a StepStatus into a StepStatusSummary

type StepStatusSummary

type StepStatusSummary struct {
	StepOrder int    `json:"step_order" db:"-"`
	Status    string `json:"status" db:"-"`
	Start     int64  `json:"start" db:"-"`
	Done      int64  `json:"done" db:"-"`
}

StepStatusSummary Represent a step and his status for CDS event

type StringSlice

type StringSlice []string

StringSlice type used for database json storage.

func (StringSlice) Contains

func (s StringSlice) Contains(value string) bool

func (*StringSlice) Scan

func (s *StringSlice) Scan(src interface{}) error

Scan string slice.

func (StringSlice) Value

func (s StringSlice) Value() (driver.Value, error)

Value returns driver.Value from string slice.

type TCPServer

type TCPServer struct {
	Addr               string `toml:"addr" default:"" comment:"Listen address without port, example: 127.0.0.1" json:"addr"`
	Port               int    `toml:"port" default:"8090" json:"port"`
	GlobalTCPRateLimit int64  `toml:"globalTCPRateLimit" default:"2097152" comment:"Rate limit (B/s) for incoming logs" json:"globalTCPRateLimit"`
}

type TarOptions

type TarOptions struct {
	TrimDirName string
}

TarOptions useful to indicate some options when we want to tar directory or files

type Task

type Task struct {
	UUID              string                 `json:"uuid" cli:"UUID,key"`
	Type              string                 `json:"type" cli:"Type"`
	Config            WorkflowNodeHookConfig `json:"config" cli:"Config"`
	Conditions        WorkflowNodeConditions `json:"conditions" cli:"Conditions"`
	Stopped           bool                   `json:"stopped" cli:"Stopped"`
	Executions        []TaskExecution        `json:"executions"`
	NbExecutionsTotal int                    `json:"nb_executions_total" cli:"nb_executions_total"`
	NbExecutionsTodo  int                    `json:"nb_executions_todo" cli:"nb_executions_todo"`
}

Task is a generic hook tasks such as webhook, scheduler,... which will be started and wait for execution

type TaskExecution

type TaskExecution struct {
	UUID                string                  `json:"uuid" cli:"uuid,key"`
	Type                string                  `json:"type" cli:"type"`
	Timestamp           int64                   `json:"timestamp" cli:"timestamp"`
	NbErrors            int64                   `json:"nb_errors" cli:"nb_errors"`
	LastError           string                  `json:"last_error,omitempty" cli:"last_error"`
	ProcessingTimestamp int64                   `json:"processing_timestamp" cli:"processing_timestamp"`
	WorkflowRun         int64                   `json:"workflow_run" cli:"workflow_run"`
	Config              WorkflowNodeHookConfig  `json:"config" cli:"-"`
	WebHook             *WebHookExecution       `json:"webhook,omitempty" cli:"-"`
	Kafka               *KafkaTaskExecution     `json:"kafka,omitempty" cli:"-"`
	RabbitMQ            *RabbitMQTaskExecution  `json:"rabbitmq,omitempty" cli:"-"`
	ScheduledTask       *ScheduledTaskExecution `json:"scheduled_task,omitempty" cli:"-"`
	GerritEvent         *GerritEventExecution   `json:"gerrit,omitempty" cli:"-"`
	Status              string                  `json:"status" cli:"status"`
}

TaskExecution represents an execution instance of a task. It the task is a webhook; this represents the call of the webhook

type TemplateParameterType

type TemplateParameterType string

TemplateParameterType used for template parameter.

const (
	ParameterTypeString     TemplateParameterType = "string"
	ParameterTypeBoolean    TemplateParameterType = "boolean"
	ParameterTypeRepository TemplateParameterType = "repository"
	ParameterTypeSSHKey     TemplateParameterType = "ssh-key"
	ParameterTypePGPKey     TemplateParameterType = "pgp-key"
	ParameterTypeJSON       TemplateParameterType = "json"
)

Parameter types.

func (TemplateParameterType) IsValid

func (t TemplateParameterType) IsValid() bool

IsValid returns parameter type validity.

type TimelineFilter

type TimelineFilter struct {
	Projects []ProjectFilter `json:"projects"`
}

TimelineFilter represents a user filter for the cds timeline

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp. This is necessary for some fields since the GitHub API is inconsistent in how it represents times. All exported methods of time.Time can be called on Timestamp.

func (Timestamp) Equal

func (t Timestamp) Equal(u Timestamp) bool

Equal reports whether t and u are equal based on time.Equal

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.

type Token

type Token struct {
	ID          int64      `json:"id" cli:"id,key"`
	GroupID     int64      `json:"group_id"`
	GroupName   string     `json:"group_name" cli:"group_name"`
	Token       string     `json:"token" cli:"token"`
	Description string     `json:"description" cli:"description"`
	Creator     string     `json:"creator" cli:"creator"`
	Expiration  Expiration `json:"expiration" cli:"expiration"`
	Created     time.Time  `json:"created" cli:"created"`
}

Token describes tokens used by worker to access the API on behalf of a group.

type URL

type URL struct {
	APIURL string `json:"api_url,omitempty"`
	UIURL  string `json:"ui_url,omitempty"`
}

type UpdateMaxRunRequest

type UpdateMaxRunRequest struct {
	MaxRuns int64 `json:"max_runs"`
}

type Usage

type Usage struct {
	Workflows    []WorkflowName `json:"workflows,omitempty"`
	Environments []Environment  `json:"environments,omitempty"`
	Pipelines    []Pipeline     `json:"pipelines,omitempty"`
	Applications []Application  `json:"applications,omitempty"`
}

Usage is type to represent usage of each type

type UsageAction

type UsageAction struct {
	GroupID          int64  `json:"group_id"`
	GroupName        string `json:"group_name"`
	ParentActionID   int64  `json:"parent_action_id"`
	ParentActionName string `json:"parent_action_name"`
	ActionID         int64  `json:"action_id"`
	ActionName       string `json:"action_name"`
	Warning          bool   `json:"warning"`
}

UsageAction represent a action using an action.

type UsagePipeline

type UsagePipeline struct {
	ProjectID    int64  `json:"project_id"`
	ProjectKey   string `json:"project_key"`
	ProjectName  string `json:"project_name"`
	PipelineID   int64  `json:"pipeline_id"`
	PipelineName string `json:"pipeline_name"`
	StageID      int64  `json:"stage_id"`
	StageName    string `json:"stage_name"`
	JobID        int64  `json:"job_id"`
	JobName      string `json:"job_name"`
	ActionID     int64  `json:"action_id"`
	ActionName   string `json:"action_name"`
	Warning      bool   `json:"warning"`
}

UsagePipeline represent a pipeline using an action.

type UserContact

type UserContact struct {
	ID       int64     `json:"id" cli:"id,key" db:"id"`
	Created  time.Time `json:"created" cli:"created" db:"created"`
	UserID   string    `json:"user_id" db:"user_id"`
	Type     string    `json:"type" cli:"type" db:"type"`
	Value    string    `json:"value" cli:"value" db:"value"`
	Primary  bool      `json:"primary" cli:"primary" db:"primary_contact"`
	Verified bool      `json:"verified" cli:"verified" db:"verified"`
}

UserContact struct

type UserContacts

type UserContacts []UserContact

func (UserContacts) Filter

func (u UserContacts) Filter(t string) UserContacts

func (UserContacts) Find

func (u UserContacts) Find(contactType, contactValue string) *UserContact

func (UserContacts) Primary

func (u UserContacts) Primary() *UserContact

type UserLoginRequest

type UserLoginRequest struct {
	RequestToken string `json:"request_token"`
	Username     string `json:"username"`
	Password     string `json:"password"`
}

UserLoginRequest login request

type UserNotification

type UserNotification struct {
	ApplicationPipelineID int64                               `json:"application_pipeline_id"`
	Pipeline              Pipeline                            `json:"pipeline"`
	Environment           Environment                         `json:"environment"`
	Notifications         map[string]UserNotificationSettings `json:"notifications"`
}

UserNotification is a settings on application_pipeline/env to trigger notification on pipeline event

type UserNotificationSettings

type UserNotificationSettings struct {
	OnSuccess    string                    `json:"on_success,omitempty" yaml:"on_success,omitempty"`         // default is "onChange", empty means onChange
	OnFailure    string                    `json:"on_failure,omitempty" yaml:"on_failure,omitempty"`         // default is "always", empty means always
	OnStart      *bool                     `json:"on_start,omitempty" yaml:"on_start,omitempty"`             // default is false, nil is false
	SendToGroups *bool                     `json:"send_to_groups,omitempty" yaml:"send_to_groups,omitempty"` // default is false, nil is false
	SendToAuthor *bool                     `json:"send_to_author,omitempty" yaml:"send_to_author,omitempty"` // default is true, nil is true
	Recipients   []string                  `json:"recipients,omitempty" yaml:"recipients,omitempty"`
	Template     *UserNotificationTemplate `json:"template,omitempty" yaml:"template,omitempty"`
	Conditions   WorkflowNodeConditions    `json:"conditions,omitempty" yaml:"conditions,omitempty"`
}

UserNotificationSettings are jabber or email settings

func (*UserNotificationSettings) Scan

func (a *UserNotificationSettings) Scan(src interface{}) error

Scan UserNotificationSettings.

func (UserNotificationSettings) Value

Value returns driver.Value from Metadata.

type UserNotificationTemplate

type UserNotificationTemplate struct {
	Subject string `json:"subject,omitempty" yaml:"subject,omitempty"`
	Body    string `json:"body,omitempty" yaml:"body,omitempty"`

	// For VCS
	DisableComment *bool `json:"disable_comment,omitempty" yaml:"disable_comment,omitempty"`
	DisableStatus  *bool `json:"disable_status,omitempty" yaml:"disable_status,omitempty"`
}

UserNotificationTemplate is the notification content

type UserRegistration

type UserRegistration struct {
	ID       string    `json:"id" db:"id"`
	Created  time.Time `json:"created" db:"created"`
	Username string    `json:"username"  db:"username"`
	Fullname string    `json:"fullname"  db:"fullname"`
	Email    string    `json:"email"  db:"email"`
	Hash     string    `json:"-"  db:"hash"` // do no return hash in json
}

type UserResetRequest

type UserResetRequest struct {
	Email       string `json:"email"`
	Username    string `json:"username"`
	VerifyToken string `json:"verify_token"`
	Callback    string `json:"callback"`
}

type UserResponse

type UserResponse struct {
	AuthentifiedUser
	VerifyToken string `json:"verify_token"`
}

type UserTimelineFilter

type UserTimelineFilter struct {
	AuthenticatedUserID string         `json:"-" db:"authentified_user_id"`
	Filter              TimelineFilter `json:"filter" db:"-"`
}

UserTimelineFilter represents user_timeline table

type VCSAuthor

type VCSAuthor struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Email       string `json:"emailAddress"`
	Avatar      string `json:"avatar"`
}

VCSAuthor represents the auhor for every commit

type VCSAuthorizedClient

type VCSAuthorizedClient interface {
	VCSAuthorizedClientCommon
	PullRequests(ctx context.Context, repo string, opts VCSPullRequestOptions) ([]VCSPullRequest, error)
}

type VCSAuthorizedClientCommon

type VCSAuthorizedClientCommon interface {
	//Repos
	Repos(context.Context) ([]VCSRepo, error)
	RepoByFullname(ctx context.Context, fullname string) (VCSRepo, error)

	//Branches
	Branches(context.Context, string, VCSBranchesFilter) ([]VCSBranch, error)
	Branch(ctx context.Context, repo string, filters VCSBranchFilters) (*VCSBranch, error)

	//Tags
	Tags(ctx context.Context, repo string) ([]VCSTag, error)

	//Commits
	Commits(ctx context.Context, repo, branch, since, until string) ([]VCSCommit, error)
	Commit(ctx context.Context, repo, hash string) (VCSCommit, error)
	CommitsBetweenRefs(ctx context.Context, repo, base, head string) ([]VCSCommit, error)

	// PullRequests
	PullRequest(ctx context.Context, repo string, id string) (VCSPullRequest, error)
	PullRequestComment(ctx context.Context, repo string, c VCSPullRequestCommentRequest) error
	PullRequestCreate(ctx context.Context, repo string, pr VCSPullRequest) (VCSPullRequest, error)

	//Hooks
	CreateHook(ctx context.Context, repo string, hook *VCSHook) error
	UpdateHook(ctx context.Context, repo string, hook *VCSHook) error
	GetHook(ctx context.Context, repo, url string) (VCSHook, error)
	DeleteHook(ctx context.Context, repo string, hook VCSHook) error

	//Events
	GetEvents(ctx context.Context, repo string, dateRef time.Time) ([]interface{}, time.Duration, error)
	PushEvents(context.Context, string, []interface{}) ([]VCSPushEvent, error)
	CreateEvents(context.Context, string, []interface{}) ([]VCSCreateEvent, error)
	DeleteEvents(context.Context, string, []interface{}) ([]VCSDeleteEvent, error)
	PullRequestEvents(context.Context, string, []interface{}) ([]VCSPullRequestEvent, error)

	// Set build status on repository
	SetStatus(context.Context, Event) error
	ListStatuses(ctx context.Context, repo string, ref string) ([]VCSCommitStatus, error)

	// Release
	Release(ctx context.Context, repo, tagName, releaseTitle, releaseDescription string) (*VCSRelease, error)
	UploadReleaseFile(ctx context.Context, repo string, releaseName string, uploadURL string, artifactName string, r io.Reader, length int) error

	// Forks
	ListForks(ctx context.Context, repo string) ([]VCSRepo, error)

	// Permissions
	GrantWritePermission(ctx context.Context, repo string) error

	// Access Token
	GetAccessToken(ctx context.Context) string
}

VCSAuthorizedClientCommon is an interface for a connected client on a VCS Server.

type VCSAuthorizedClientService

type VCSAuthorizedClientService interface {
	VCSAuthorizedClientCommon
	PullRequests(ctx context.Context, repo string, mods ...VCSRequestModifier) ([]VCSPullRequest, error)
}

type VCSBranch

type VCSBranch struct {
	ID           string   `json:"id"`
	DisplayID    string   `json:"display_id"`
	LatestCommit string   `json:"latest_commit"`
	Default      bool     `json:"default"`
	Parents      []string `json:"parents"`
}

VCSBranch represents branches known by the repositories manager

func GetDefaultBranch

func GetDefaultBranch(branches []VCSBranch) VCSBranch

GetDefaultBranch return the default branch

type VCSBranchFilters

type VCSBranchFilters struct {
	BranchName string
	Default    bool
}

type VCSBranchesFilter

type VCSBranchesFilter struct {
	Limit int64
}

type VCSCommit

type VCSCommit struct {
	Hash      string    `json:"id"`
	Author    VCSAuthor `json:"author"`
	Timestamp int64     `json:"authorTimestamp"`
	Message   string    `json:"message"`
	URL       string    `json:"url"`
}

VCSCommit represents the commit in the repository

type VCSCommitStatus

type VCSCommitStatus struct {
	Ref        string    `json:"ref"`
	CreatedAt  time.Time `json:"created_at"`
	State      string    `json:"state"`
	Decription string    `json:"description"`
}

VCSCommitStatus represents a status on a VCS repository

type VCSConfiguration

type VCSConfiguration struct {
	Type     string `json:"type"`
	Username string `json:"username"`
	Password string `json:"password"`
	URL      string `json:"url"`
	SSHPort  int    `json:"sshport"`
}

VCSConfiguration represent a small vcs configuration

type VCSCreateEvent

type VCSCreateEvent VCSPushEvent

VCSCreateEvent represents a push events for polling

type VCSDeleteEvent

type VCSDeleteEvent struct {
	Branch VCSBranch `json:"branch"`
}

VCSDeleteEvent represents a push events for polling

type VCSHook

type VCSHook struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Events      []string `json:"events"`
	Method      string   `json:"method"`
	URL         string   `json:"url"`
	ContentType string   `json:"content_type"`
	Body        string   `json:"body"`
	Disable     bool     `json:"disable"`
	InsecureSSL bool     `json:"insecure_ssl"`
	Workflow    bool     `json:"workflow"`
}

VCSHook represents a hook on a VCS repository

type VCSPullRequest

type VCSPullRequest struct {
	ID       int          `json:"id"`
	ChangeID string       `json:"change_id"`
	URL      string       `json:"url"`
	User     VCSAuthor    `json:"user"`
	Head     VCSPushEvent `json:"head"`
	Base     VCSPushEvent `json:"base"`
	Title    string       `json:"title"`
	Merged   bool         `json:"merged"`
	Closed   bool         `json:"closed"`
	Revision string       `json:"revision"`
	Updated  time.Time    `json:"updated"`
}

VCSPullRequest represents a pull request

type VCSPullRequestCommentRequest

type VCSPullRequestCommentRequest struct {
	VCSPullRequest
	Message string `json:"message"`
}

type VCSPullRequestEvent

type VCSPullRequestEvent struct {
	Action string       `json:"action"` // opened | closed
	URL    string       `json:"url"`
	Repo   string       `json:"repo"`
	User   VCSAuthor    `json:"user"`
	Head   VCSPushEvent `json:"head"`
	Base   VCSPushEvent `json:"base"`
	Branch VCSBranch    `json:"branch"`
}

VCSPullRequestEvent represents a push events for polling

type VCSPullRequestOptions

type VCSPullRequestOptions struct {
	State VCSPullRequestState
}

type VCSPullRequestState

type VCSPullRequestState string
const (
	VCSPullRequestStateAll    VCSPullRequestState = "all"
	VCSPullRequestStateOpen   VCSPullRequestState = "open"
	VCSPullRequestStateClosed VCSPullRequestState = "closed"
	VCSPullRequestStateMerged VCSPullRequestState = "merged"
)

func (VCSPullRequestState) IsValid

func (s VCSPullRequestState) IsValid() bool

type VCSPushEvent

type VCSPushEvent struct {
	Repo     string    `json:"repo"`
	Branch   VCSBranch `json:"branch"`
	Commit   VCSCommit `json:"commit"`
	CloneURL string    `json:"clone_url"`
}

VCSPushEvent represents a push events for polling

type VCSRelease

type VCSRelease struct {
	ID        int64  `json:"id"`
	UploadURL string `json:"upload_url"`
}

VCSRelease represents data about release on github, etc..

type VCSRemote

type VCSRemote struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

VCSRemote represents remotes known by the repositories manager

type VCSRepo

type VCSRepo struct {
	ID           string `json:"id"`
	Name         string `json:"name"`     //On Github: Name = Slug
	Slug         string `json:"slug"`     //On Github: Slug = Name
	Fullname     string `json:"fullname"` //On Stash : projectkey/slug, on Github : owner/slug
	URL          string `json:"url"`      //Web URL
	HTTPCloneURL string `json:"http_url"` //Git clone URL  "https://<baseURL>/scm/PRJ/my-repo.git"
	SSHCloneURL  string `json:"ssh_url"`  //Git clone URL  "ssh://git@<baseURL>/PRJ/my-repo.git"
}

VCSRepo represents data about repository even on stash, or github, etc...

type VCSRequestModifier

type VCSRequestModifier func(r *http.Request)

func VCSRequestModifierWithState

func VCSRequestModifierWithState(state VCSPullRequestState) VCSRequestModifier

type VCSServer

type VCSServer interface {
	VCSServerCommon
	GetAuthorizedClient(context.Context, string, string, int64) (VCSAuthorizedClient, error)
}

VCSServer is an interface for a OAuth VCS Server. The goal of this interface is to return a VCSAuthorizedClient.

type VCSServerCommon

type VCSServerCommon interface {
	AuthorizeRedirect(context.Context) (string, string, error)
	AuthorizeToken(context.Context, string, string) (string, string, error)
}

type VCSServerService

type VCSServerService interface {
	VCSServerCommon
	GetAuthorizedClient(context.Context, string, string, int64) (VCSAuthorizedClientService, error)
}

type VCSTag

type VCSTag struct {
	Tag     string    `json:"tag"`
	Sha     string    `json:"sha"` // Represent sha of tag
	Message string    `json:"message"`
	Tagger  VCSAuthor `json:"tagger"`
	Hash    string    `json:"hash"` // Represent hash of commit
}

VCSTag represents branches known by the repositories manager

type Variable

type Variable struct {
	ID    int64  `json:"id,omitempty" cli:"-"`
	Name  string `json:"name" cli:"name,key"`
	Value string `json:"value" cli:"value"`
	Type  string `json:"type" cli:"type"`
}

Variable represent a variable for a project or pipeline

func FromAplicationVariables

func FromAplicationVariables(appVars []ApplicationVariable) []Variable

func FromEnvironmentVariables

func FromEnvironmentVariables(envVars []EnvironmentVariable) []Variable

func FromProjectVariables

func FromProjectVariables(appVars []ProjectVariable) []Variable

func VariableFind

func VariableFind(vars []Variable, s string) *Variable

VariableFind return a variable given its name if it exists in array

func VariablesFilter

func VariablesFilter(vars []Variable, types ...string) []Variable

VariablesFilter return a slice of variables filtered by type

func VariablesPrefix

func VariablesPrefix(vars []Variable, prefix string) []Variable

VariablesPrefix add a prefix on all the variable in the slice

func (*Variable) ToApplicationVariable

func (v *Variable) ToApplicationVariable(appID int64) *ApplicationVariable

func (Variable) ToParameter

func (v Variable) ToParameter(prefix string) Parameter

type VariableAudit

type VariableAudit struct {
	ID         int        `json:"id"`
	Variables  []Variable `json:"variables"`
	Versionned time.Time  `json:"versionned"`
	Author     string     `json:"author"`
}

VariableAudit represent audit for a variable

type Version

type Version struct {
	Version      string `json:"version" yaml:"version"`
	Architecture string `json:"architecture" yaml:"architecture"`
	OS           string `json:"os" yaml:"os"`
	GitHash      string `json:"git_hash" yaml:"git_hash"`
	BuildTime    string `json:"build_time" yaml:"build_time"`
	DBMigrate    string `json:"db_migrate,omitempty" yaml:"db_migrate,omitempty"`
}

Version is used by /mon/version

func VersionCurrent

func VersionCurrent() Version

VersionCurrent returns the current version

type Vulnerability

type Vulnerability struct {
	ID            int64  `json:"id" db:"id"`
	ApplicationID int64  `json:"application_id" db:"application_id"`
	Title         string `json:"title" db:"title"`
	Description   string `json:"description" db:"description"`
	CVE           string `json:"cve" db:"cve"`
	Link          string `json:"link" db:"link"`
	Component     string `json:"component" db:"component"`
	Version       string `json:"version" db:"version"`
	Origin        string `json:"origin" db:"origin"`
	Severity      string `json:"severity" db:"severity"`
	FixIn         string `json:"fix_in" db:"fix_in"`
	Ignored       bool   `json:"ignored" db:"ignored"`
	Type          string `json:"type" db:"type"`
}

Vulnerability represents vulnerabilities on an application

type VulnerabilityWorkerReport

type VulnerabilityWorkerReport struct {
	Summary         map[string]int64 `json:"summary"`
	Vulnerabilities []Vulnerability  `json:"vulnerabilities"`
	Type            string           `json:"type"`
}

VulnerabilityWorkerReport represent a vulnerability report

type Warning

type Warning struct {
	ID            int64             `json:"id" db:"id"`
	Key           string            `json:"key" db:"project_key"`
	AppName       string            `json:"application_name" db:"application_name"`
	PipName       string            `json:"pipeline_name" db:"pipeline_name"`
	WorkflowName  string            `json:"workflow_name" db:"workflow_name"`
	EnvName       string            `json:"environment_name" db:"environment_name"`
	Type          string            `json:"type" db:"type"`
	Element       string            `json:"element" db:"element"`
	Created       time.Time         `json:"created" db:"created"`
	MessageParams map[string]string `json:"message_params" db:"-"`
	Message       string            `json:"message" db:"-"`
	Hash          string            `json:"hash" db:"hash"`
	Ignored       bool              `json:"ignored" db:"ignored"`
}

Warning Represents warning database structure

func (*Warning) ComputeMessage

func (w *Warning) ComputeMessage(ctx context.Context, language string)

type WebHookExecution

type WebHookExecution struct {
	RequestURL    string              `json:"request_url"`
	RequestBody   []byte              `json:"request_body"`
	RequestHeader map[string][]string `json:"request_header"`
	RequestMethod string              `json:"request_method"`
}

WebHookExecution contains specific data for a webhook execution

type WebsocketEvent

type WebsocketEvent struct {
	Status string `json:"status"`
	Error  string `json:"error"`
	Event  Event  `json:"event"`
}

type WebsocketFilter

type WebsocketFilter struct {
	Type              WebsocketFilterType `json:"type"`
	ProjectKey        string              `json:"project_key"`
	ApplicationName   string              `json:"application_name"`
	PipelineName      string              `json:"pipeline_name"`
	EnvironmentName   string              `json:"environment_name"`
	WorkflowName      string              `json:"workflow_name"`
	WorkflowRunNumber int64               `json:"workflow_run_num"`
	WorkflowNodeRunID int64               `json:"workflow_node_run_id"`
	OperationUUID     string              `json:"operation_uuid"`
}

func (WebsocketFilter) IsValid

func (f WebsocketFilter) IsValid() error

IsValid return an error if given filter is not valid.

func (WebsocketFilter) Key

func (f WebsocketFilter) Key() string

Key generates the unique key associated to given filter.

type WebsocketFilterType

type WebsocketFilterType string
const (
	WebsocketFilterTypeGlobal                  WebsocketFilterType = "global"
	WebsocketFilterTypeProject                 WebsocketFilterType = "project"
	WebsocketFilterTypeWorkflow                WebsocketFilterType = "workflow"
	WebsocketFilterTypeWorkflowRun             WebsocketFilterType = "workflow-run"
	WebsocketFilterTypeWorkflowNodeRun         WebsocketFilterType = "workflow-node-run"
	WebsocketFilterTypePipeline                WebsocketFilterType = "pipeline"
	WebsocketFilterTypeApplication             WebsocketFilterType = "application"
	WebsocketFilterTypeEnvironment             WebsocketFilterType = "environment"
	WebsocketFilterTypeQueue                   WebsocketFilterType = "queue"
	WebsocketFilterTypeOperation               WebsocketFilterType = "operation"
	WebsocketFilterTypeTimeline                WebsocketFilterType = "timeline"
	WebsocketFilterTypeAscodeEvent             WebsocketFilterType = "ascode-event"
	WebsocketFilterTypeDryRunRetentionWorkflow WebsocketFilterType = "workflow-retention-dryrun"
)

func (WebsocketFilterType) IsValid

func (f WebsocketFilterType) IsValid() bool

type WebsocketFilters

type WebsocketFilters []WebsocketFilter

type Worker

type Worker struct {
	ID           string    `json:"id" cli:"-" db:"id"`
	Name         string    `json:"name" cli:"name,key" db:"name"`
	LastBeat     time.Time `json:"lastbeat" cli:"lastbeat" db:"last_beat"`
	ModelID      *int64    `json:"model_id" cli:"-"  db:"model_id"`
	JobRunID     *int64    `json:"job_run_id" cli:"-"  db:"job_run_id"`
	Status       string    `json:"status" cli:"status" db:"status"` // Waiting, Building, Disabled, Unknown
	HatcheryID   *int64    `json:"hatchery_id,omitempty" cli:"-" db:"hatchery_id"`
	HatcheryName string    `json:"hatchery_name" cli:"-" db:"hatchery_name"` // If the hatchery service was deleted we will keep its name in the worker
	Uptodate     bool      `json:"uptodate" cli:"-" db:"-"`
	ConsumerID   string    `json:"-" cli:"-"  db:"auth_consumer_id"`
	Version      string    `json:"version" cli:"version"  db:"version"`
	OS           string    `json:"os" cli:"os"  db:"os"`
	Arch         string    `json:"arch" cli:"arch"  db:"arch"`
	PrivateKey   []byte    `json:"private_key,omitempty" cli:"-" db:"cypher_private_key" gorpmapping:"encrypted,ID,Name,JobRunID"`
}

Worker represents instances of CDS workers living to serve.

type WorkerHookProjectIntegrationModel

type WorkerHookProjectIntegrationModel struct {
	ID                   int64                         `json:"id" db:"id" cli:"id,key"`
	ProjectIntegrationID int64                         `json:"project_integration_id" db:"project_integration_id" cli:"-"`
	Configuration        WorkerHookSetupTeardownConfig `json:"configuration" db:"configuration" cli:"configuration"`
	Disable              bool                          `json:"disable" db:"disable" cli:"disable"`
}

type WorkerHookSetupTeardownConfig

type WorkerHookSetupTeardownConfig struct {
	DisableOnRegions []string                                  `json:"disable_on_regions" yaml:"disable_on_regions"`
	ByCapabilities   map[string]WorkerHookSetupTeardownScripts `json:"by_capabilities" yaml:"by_capabilities"`
}

func (*WorkerHookSetupTeardownConfig) Scan

func (w *WorkerHookSetupTeardownConfig) Scan(src interface{}) error

Scan action.

func (WorkerHookSetupTeardownConfig) Value

Value returns driver.Value from WorkerHookSetupTeardownConfig.

type WorkerHookSetupTeardownScripts

type WorkerHookSetupTeardownScripts struct {
	Priority int    `json:"priority" yaml:"priority"`
	Label    string `json:"label" yaml:"label"`
	Setup    string `json:"setup" yaml:"setup"`
	Teardown string `json:"teardown" yaml:"teardown"`
}

type WorkerModelSecret

type WorkerModelSecret struct {
	ID            string    `json:"id" db:"id"`
	Created       time.Time `json:"created" cli:"created" db:"created"`
	WorkerModelID int64     `json:"worker_model_id" db:"worker_model_id"`
	Name          string    `json:"name" db:"name"`
	Value         string    `json:"value" db:"cipher_value" gorpmapping:"encrypted,WorkerModelID,Name"`
}

type WorkerModelSecrets

type WorkerModelSecrets []WorkerModelSecret

func (WorkerModelSecrets) ToMap

func (w WorkerModelSecrets) ToMap() map[string]string

type WorkerRegistrationForm

type WorkerRegistrationForm struct {
	BinaryCapabilities []string
	Version            string
	OS                 string
	Arch               string
}

WorkerRegistrationForm represents the arguments needed to register a worker

type Workflow

type Workflow struct {
	ID                       int64                        `json:"id" db:"id" cli:"-"`
	Name                     string                       `json:"name" db:"name" cli:"name,key"`
	Description              string                       `json:"description,omitempty" db:"description" cli:"description"`
	Icon                     string                       `json:"icon,omitempty" db:"icon" cli:"-"`
	LastModified             time.Time                    `json:"last_modified" db:"last_modified" mapstructure:"-"`
	ProjectID                int64                        `json:"project_id,omitempty" db:"project_id" cli:"-"`
	ProjectKey               string                       `json:"project_key" db:"-" cli:"-"`
	Groups                   GroupPermissions             `json:"groups,omitempty" db:"-" cli:"-"`
	Permissions              Permissions                  `json:"permissions" db:"-" cli:"-"`
	Metadata                 Metadata                     `json:"metadata,omitempty" yaml:"metadata" db:"metadata"`
	Usage                    *Usage                       `json:"usage,omitempty" db:"-" cli:"-"`
	HistoryLength            int64                        `json:"history_length" db:"history_length" cli:"-"`
	PurgeTags                PurgeTags                    `json:"purge_tags,omitempty" db:"purge_tags" cli:"-"`
	RetentionPolicy          string                       `json:"retention_policy,omitempty" db:"retention_policy" cli:"-"`
	MaxRuns                  int64                        `json:"max_runs,omitempty" db:"max_runs" cli:"-"`
	Notifications            []WorkflowNotification       `json:"notifications,omitempty" db:"-" cli:"-"`
	FromRepository           string                       `json:"from_repository,omitempty" db:"from_repository" cli:"from"`
	DerivedFromWorkflowID    int64                        `json:"derived_from_workflow_id,omitempty" db:"derived_from_workflow_id" cli:"-"`
	DerivedFromWorkflowName  string                       `json:"derived_from_workflow_name,omitempty" db:"derived_from_workflow_name" cli:"-"`
	DerivationBranch         string                       `json:"derivation_branch,omitempty" db:"derivation_branch" cli:"-"`
	Audits                   []AuditWorkflow              `json:"audits,omitempty" db:"-"`
	Pipelines                map[int64]Pipeline           `json:"pipelines,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	Applications             map[int64]Application        `json:"applications,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	Environments             map[int64]Environment        `json:"environments,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	ProjectIntegrations      map[int64]ProjectIntegration `json:"project_integrations,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	HookModels               map[int64]WorkflowHookModel  `json:"hook_models,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	OutGoingHookModels       map[int64]WorkflowHookModel  `json:"outgoing_hook_models,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	Labels                   []Label                      `json:"labels,omitempty" db:"-" cli:"labels"`
	ToDelete                 bool                         `json:"to_delete" db:"to_delete" cli:"-"`
	ToDeleteWithDependencies *bool                        `json:"to_delete_with_dependencies" db:"to_delete_with_dependencies" cli:"-"`
	Favorite                 bool                         `json:"favorite" db:"-" cli:"favorite"`
	WorkflowData             WorkflowData                 `json:"workflow_data" db:"workflow_data" cli:"-"`
	Integrations             []WorkflowProjectIntegration `json:"integrations,omitempty" db:"-" cli:"-"`
	AsCodeEvent              []AsCodeEvent                `json:"as_code_events,omitempty" db:"-" cli:"-"`
	// aggregates
	TemplateInstance *WorkflowTemplateInstance `json:"template_instance,omitempty" db:"-" cli:"-"`
	FromTemplate     string                    `json:"from_template,omitempty" db:"-" cli:"-"`
	TemplateUpToDate bool                      `json:"template_up_to_date,omitempty" db:"-" cli:"-"`
	URLs             URL                       `json:"urls" yaml:"-" db:"-" cli:"-"`
	Runs             []WorkflowRun             `json:"runs,omitempty" yaml:"-" db:"-" cli:"-"`
	Organization     string                    `json:"organization,omitempty" yaml:"-" db:"-" cli:"-"`
}

Workflow represents a pipeline based workflow

func (*Workflow) AddTrigger

func (w *Workflow) AddTrigger(name string, dest Node)

AddTrigger adds a trigger to the destination node from the node found by its name

func (*Workflow) AssignEmptyType

func (w *Workflow) AssignEmptyType()

AssignEmptyType fill node type field

func (*Workflow) FilterHooksConfig

func (w *Workflow) FilterHooksConfig(s ...string)

FilterHooksConfig filter all hooks configuration and remove some configuration key

func (*Workflow) GetApplication

func (w *Workflow) GetApplication(ID int64) Application

GetApplication retrieve application from workflow

func (*Workflow) GetEventIntegration

func (w *Workflow) GetEventIntegration() []WorkflowProjectIntegration

func (*Workflow) GetRepositories

func (w *Workflow) GetRepositories() []string

GetRepositories returns the list of repositories from applications

func (*Workflow) InitMaps

func (w *Workflow) InitMaps()

func (*Workflow) Normalize

func (w *Workflow) Normalize()

AssignEmptyType fill node type field This function should be called after completing the maps

func (*Workflow) ResetIDs

func (w *Workflow) ResetIDs()

ResetIDs resets all nodes, joins, integration ids

func (*Workflow) Scan

func (w *Workflow) Scan(src interface{}) error

func (*Workflow) SortNode

func (w *Workflow) SortNode()

Sort sorts the workflow

func (*Workflow) ValidateType

func (w *Workflow) ValidateType() error

ValidateType check if nodes have a correct nodeType

func (Workflow) Value

func (w Workflow) Value() (driver.Value, error)

func (*Workflow) VisitNode

func (w *Workflow) VisitNode(visitor func(*Node, *Workflow))

Visit all the workflow and apply the visitor func on all nodes

type WorkflowData

type WorkflowData struct {
	Node  Node   `json:"node" db:"-" cli:"-"`
	Joins []Node `json:"joins" db:"-" cli:"-"`
}

func (*WorkflowData) AncestorsNames

func (w *WorkflowData) AncestorsNames(n Node) []string

func (*WorkflowData) Array

func (w *WorkflowData) Array() []*Node

func (*WorkflowData) GetHooks

func (w *WorkflowData) GetHooks() map[string]*NodeHook

GetHooks returns the list of all hooks in the workflow tree

func (*WorkflowData) GetHooksMapRef

func (w *WorkflowData) GetHooksMapRef() map[string]NodeHook

GetHooksMapRef returns the list of all hooks in the workflow tree

func (*WorkflowData) Maps

func (w *WorkflowData) Maps() map[int64]*Node

func (*WorkflowData) NodeByID

func (w *WorkflowData) NodeByID(ID int64) *Node

func (*WorkflowData) NodeByName

func (w *WorkflowData) NodeByName(s string) *Node

func (*WorkflowData) NodeByRef

func (w *WorkflowData) NodeByRef(ref string) *Node

func (*WorkflowData) Scan

func (a *WorkflowData) Scan(src interface{}) error

Scan WorkflowData.

func (WorkflowData) Value

func (a WorkflowData) Value() (driver.Value, error)

Value returns driver.Value from WorkflowData.

type WorkflowDeleteDependencies

type WorkflowDeleteDependencies struct {
	DeletedDependencies        WorkflowDependencies `json:"deleted_dependencies"`
	UnlinkedAsCodeDependencies WorkflowDependencies `json:"unlinked_as_code_dependencies"`
}

type WorkflowDependencies

type WorkflowDependencies struct {
	Pipelines    []IDName `json:"pipelines"`
	Applications []IDName `json:"applications"`
	Environments []IDName `json:"environments"`
}

type WorkflowGroup

type WorkflowGroup struct {
	Workflow   Workflow `json:"workflow"`
	Permission int      `json:"permission"`
}

WorkflowGroup represents the permission to a workflow

type WorkflowHookModel

type WorkflowHookModel struct {
	ID            int64                  `json:"id" db:"id" cli:"-"`
	Name          string                 `json:"name" db:"name" cli:"name"`
	Type          string                 `json:"type"  db:"type"`
	Author        string                 `json:"author" db:"author"`
	Description   string                 `json:"description" db:"description"`
	Identifier    string                 `json:"identifier" db:"identifier"`
	Icon          string                 `json:"icon" db:"icon"`
	Command       string                 `json:"command" db:"command"`
	DefaultConfig WorkflowNodeHookConfig `json:"default_config" db:"-"`
	Disabled      bool                   `json:"disabled" db:"disabled"`
}

WorkflowHookModel represents a hook which can be used in workflows.

func GetBuiltinHookModelByName

func GetBuiltinHookModelByName(name string) *WorkflowHookModel

GetBuiltinHookModelByName retrieve the hook model

func GetBuiltinOutgoingHookModelByName

func GetBuiltinOutgoingHookModelByName(name string) *WorkflowHookModel

GetBuiltinOutgoingHookModelByName retrieve the outgoing hook model

func GetDefaultHookModel

func GetDefaultHookModel(modelName string) WorkflowHookModel

GetDefaultHookModel return the workflow hook model by its name

type WorkflowName

type WorkflowName struct {
	ID         int64  `json:"id" db:"id" cli:"-"`
	Name       string `json:"name" db:"name" cli:"name,key"`
	ProjectKey string `json:"project_key" db:"project_key" cli:"project_key"`
	ProjectID  int64  `json:"project_id" db:"project_id" cli:"-"`
}

type WorkflowNodeCondition

type WorkflowNodeCondition struct {
	Variable string `json:"variable" yaml:"variable"`
	Operator string `json:"operator" yaml:"operator"`
	Value    string `json:"value" yaml:"value"`
}

WorkflowNodeCondition represents a condition to trigger ot not a pipeline in a workflow. Operator can be =, !=, regex

type WorkflowNodeConditions

type WorkflowNodeConditions struct {
	PlainConditions []WorkflowNodeCondition `json:"plain,omitempty" yaml:"check,omitempty"`
	LuaScript       string                  `json:"lua_script,omitempty" yaml:"script,omitempty"`
}

WorkflowNodeConditions is either an array of WorkflowNodeCondition or a lua script

func (*WorkflowNodeConditions) Scan

func (w *WorkflowNodeConditions) Scan(src interface{}) error

Scan workflow template request.

func (WorkflowNodeConditions) Value

Value returns driver.Value from WorkflowNodeConditions request.

type WorkflowNodeContextDefaultPayloadVCS

type WorkflowNodeContextDefaultPayloadVCS struct {
	GitBranch     string `json:"git.branch" db:"-"`
	GitTag        string `json:"git.tag" db:"-"`
	GitHash       string `json:"git.hash" db:"-"`
	GitAuthor     string `json:"git.author" db:"-"`
	GitHashBefore string `json:"git.hash.before" db:"-"`
	GitRepository string `json:"git.repository" db:"-"`
	GitMessage    string `json:"git.message" db:"-"`
}

WorkflowNodeContextDefaultPayloadVCS represents a default payload when a workflow is attached to a repository Webhook

type WorkflowNodeHookConfig

type WorkflowNodeHookConfig map[string]WorkflowNodeHookConfigValue

WorkflowNodeHookConfig represents the configguration for a WorkflowNodeHook

func (WorkflowNodeHookConfig) Clone

Clone returns a copied dinstance of cfg

func (WorkflowNodeHookConfig) Equals

func (WorkflowNodeHookConfig) Filter

func (WorkflowNodeHookConfig) MergeWith

func (*WorkflowNodeHookConfig) Scan

func (w *WorkflowNodeHookConfig) Scan(src interface{}) error

Scan workflow template request.

func (WorkflowNodeHookConfig) Value

Value returns driver.Value from WorkflowNodeHookConfig request.

func (WorkflowNodeHookConfig) Values

Values return values of the WorkflowNodeHookConfig

type WorkflowNodeHookConfigValue

type WorkflowNodeHookConfigValue struct {
	Value              string   `json:"value"`
	Configurable       bool     `json:"configurable"`
	Type               string   `json:"type"`
	MultipleChoiceList []string `json:"multiple_choice_list"`
}

WorkflowNodeHookConfigValue represents the value of a node hook config

type WorkflowNodeJobRun

type WorkflowNodeJobRun struct {
	ProjectID          int64              `json:"project_id"`
	ID                 int64              `json:"id"`
	WorkflowNodeRunID  int64              `json:"workflow_node_run_id,omitempty"`
	Job                ExecutedJob        `json:"job"`
	Parameters         []Parameter        `json:"parameters,omitempty"`
	Status             string             `json:"status"`
	Retry              int                `json:"retry"`
	Queued             time.Time          `json:"queued,omitempty" cli:"queued"`
	QueuedSeconds      int64              `json:"queued_seconds,omitempty"`
	Start              time.Time          `json:"start,omitempty"`
	Done               time.Time          `json:"done,omitempty"`
	Model              string             `json:"model,omitempty"`
	ModelType          string             `json:"model_type,omitempty"`
	Region             *string            `json:"region,omitempty"`
	BookedBy           BookedBy           `json:"bookedby,omitempty"`
	SpawnInfos         []SpawnInfo        `json:"spawninfos"`
	ExecGroups         Groups             `json:"exec_groups"`
	Header             WorkflowRunHeaders `json:"header,omitempty"`
	ContainsService    bool               `json:"contains_service,omitempty"`
	HatcheryName       string             `json:"hatchery_name,omitempty"`
	WorkerName         string             `json:"worker_name,omitempty"`
	IntegrationPlugins []GRPCPlugin       `json:"integration_plugin,omitempty"`
}

WorkflowNodeJobRun represents an job to be run

func (*WorkflowNodeJobRun) GetPuginBinary

func (wnjr *WorkflowNodeJobRun) GetPuginBinary(pluginType string, os string, arch string) *GRPCPluginBinary

func (WorkflowNodeJobRun) ToSummary

ToSummary transforms a WorkflowNodeJobRun into a WorkflowNodeJobRunSummary

func (*WorkflowNodeJobRun) Translate

func (wnjr *WorkflowNodeJobRun) Translate()

Translate translates messages in WorkflowNodeJobRun

type WorkflowNodeJobRunBooked

type WorkflowNodeJobRunBooked struct {
	ProjectKey   string `json:"project_key"`
	WorkflowName string `json:"workflow_name"`
	WorkflowID   int64  `json:"workflow_id"`
	RunID        int64  `json:"run_id"`
	NodeRunName  string `json:"node_run_name"`
	NodeRunID    int64  `json:"node_run_id"`
	JobName      string `json:"job_name"`
}

type WorkflowNodeJobRunCount

type WorkflowNodeJobRunCount struct {
	Count int64     `json:"version"`
	Since time.Time `json:"since"`
	Until time.Time `json:"until"`
}

WorkflowNodeJobRunCount return nb workflow run job since 'since'

type WorkflowNodeJobRunData

type WorkflowNodeJobRunData struct {
	NodeJobRun               WorkflowNodeJobRun
	Secrets                  []Variable
	Features                 map[FeatureName]bool
	Number                   int64
	SubNumber                int64
	SigningKey               string
	GelfServiceAddr          string
	GelfServiceAddrEnableTLS bool
	CDNHttpAddr              string
	ProjectKey               string
	WorkflowName             string
	WorkflowID               int64
	RunID                    int64
	NodeRunName              string
}

WorkflowNodeJobRunData is returned to worker in answer to postTakeWorkflowJobHandler

type WorkflowNodeJobRunInfo

type WorkflowNodeJobRunInfo struct {
	ID                   int64       `json:"id"`
	WorkflowNodeJobRunID int64       `json:"workflow_node_job_run_id,omitempty"`
	WorkflowNodeRunID    int64       `json:"workflow_node_run_id,omitempty"`
	SpawnInfos           []SpawnInfo `json:"info"`
	Created              time.Time   `json:"created"`
}

WorkflowNodeJobRunInfo represents info on a job

type WorkflowNodeJobRunSummary

type WorkflowNodeJobRunSummary struct {
	ID                int64              `json:"id"`
	WorkflowNodeRunID int64              `json:"workflow_node_run_id,omitempty"`
	Status            string             `json:"status"`
	Queued            int64              `json:"queued,omitempty"`
	Start             int64              `json:"start,omitempty"`
	Done              int64              `json:"done,omitempty"`
	Job               ExecutedJobSummary `json:"job_summary,omitempty"`
	SpawnInfos        []SpawnInfo        `json:"spawninfos"`
	HatcheryName      string             `json:"hatchery_name,omitempty"`
	WorkerName        string             `json:"worker_name,omitempty"`
	WorkerModelName   string             `json:"worker_model_name,omitempty"`
}

WorkflowNodeJobRunSummary is a light representation of WorkflowNodeJobRun for CDS event

type WorkflowNodeOutgoingHookRunCallback

type WorkflowNodeOutgoingHookRunCallback struct {
	NodeHookID        int64     `json:"workflow_node_outgoing_hook_id"`
	Start             time.Time `json:"start"`
	Done              time.Time `json:"done"`
	Status            string    `json:"status"`
	Log               string    `json:"log"`
	WorkflowRunNumber *int64    `json:"workflow_run_number"`
}

WorkflowNodeOutgoingHookRunCallback is the callback coming from hooks uservice avec an outgoing hook execution

type WorkflowNodeRun

type WorkflowNodeRun struct {
	WorkflowRunID          int64                                `json:"workflow_run_id"`
	WorkflowID             int64                                `json:"workflow_id"`
	ApplicationID          int64                                `json:"application_id"`
	ID                     int64                                `json:"id"`
	WorkflowNodeID         int64                                `json:"workflow_node_id"`
	WorkflowNodeName       string                               `json:"workflow_node_name"`
	Number                 int64                                `json:"num"`
	SubNumber              int64                                `json:"subnumber"`
	Status                 string                               `json:"status"`
	Stages                 []Stage                              `json:"stages,omitempty"`
	Start                  time.Time                            `json:"start"`
	LastModified           time.Time                            `json:"last_modified"`
	Done                   time.Time                            `json:"done"`
	HookEvent              *WorkflowNodeRunHookEvent            `json:"hook_event,omitempty"`
	Manual                 *WorkflowNodeRunManual               `json:"manual,omitempty"`
	SourceNodeRuns         []int64                              `json:"source_node_runs,omitempty"`
	Payload                interface{}                          `json:"payload,omitempty"`
	PipelineParameters     []Parameter                          `json:"pipeline_parameters,omitempty"`
	BuildParameters        []Parameter                          `json:"build_parameters,omitempty"`
	Artifacts              []WorkflowNodeRunArtifact            `json:"artifacts,omitempty"`
	StaticFiles            []StaticFiles                        `json:"static_files,omitempty"`
	Coverage               WorkflowNodeRunCoverage              `json:"coverage,omitempty"`
	VulnerabilitiesReport  WorkflowNodeRunVulnerabilityReport   `json:"vulnerabilities_report,omitempty"`
	Tests                  *venom.Tests                         `json:"tests,omitempty"`
	Commits                []VCSCommit                          `json:"commits,omitempty"`
	TriggersRun            map[int64]WorkflowNodeTriggerRun     `json:"triggers_run,omitempty"`
	VCSRepository          string                               `json:"vcs_repository"`
	VCSTag                 string                               `json:"vcs_tag"`
	VCSBranch              string                               `json:"vcs_branch"`
	VCSHash                string                               `json:"vcs_hash"`
	VCSServer              string                               `json:"vcs_server"`
	CanBeRun               bool                                 `json:"can_be_run"`
	Header                 WorkflowRunHeaders                   `json:"header,omitempty"`
	UUID                   string                               `json:"uuid,omitempty"`
	OutgoingHook           *NodeOutGoingHook                    `json:"outgoinghook,omitempty"`
	HookExecutionTimeStamp int64                                `json:"hook_execution_timestamp,omitempty"`
	HookExecutionID        string                               `json:"execution_id,omitempty"`
	Callback               *WorkflowNodeOutgoingHookRunCallback `json:"callback,omitempty"`
	VCSReport              string                               `json:"vcs_report,omitempty"`
}

WorkflowNodeRun is as execution instance of a node. This type is duplicated for database persistence in the engine/api/workflow package

func (*WorkflowNodeRun) GetStageIndex

func (nodeRun *WorkflowNodeRun) GetStageIndex(job *WorkflowNodeJobRun) int

func (WorkflowNodeRun) Report

func (nr WorkflowNodeRun) Report() (string, error)

func (*WorkflowNodeRun) Translate

func (nr *WorkflowNodeRun) Translate()

Translate translates messages in WorkflowNodeRun

type WorkflowNodeRunArtifact

type WorkflowNodeRunArtifact struct {
	WorkflowID           int64     `json:"workflow_id" db:"workflow_run_id"`
	WorkflowNodeRunID    int64     `json:"workflow_node_run_id" db:"workflow_node_run_id"`
	WorkflowNodeJobRunID int64     `json:"workflow_node_job_run_id" db:"-"`
	ID                   int64     `json:"id" db:"id"`
	Name                 string    `json:"name" db:"name" cli:"name,key"`
	Tag                  string    `json:"tag" db:"tag" cli:"tag"`
	Ref                  string    `json:"ref" db:"ref" cli:"ref"`
	DownloadHash         string    `json:"download_hash" db:"download_hash"`
	Size                 int64     `json:"size,omitempty" db:"size"`
	Perm                 uint32    `json:"perm,omitempty" db:"perm"`
	MD5sum               string    `json:"md5sum,omitempty" db:"md5sum" cli:"-"`
	SHA512sum            string    `json:"sha512sum,omitempty" db:"sha512sum" cli:"sha512sum"`
	ObjectPath           string    `json:"object_path,omitempty" db:"object_path"`
	Created              time.Time `json:"created,omitempty" db:"created"`
	TempURL              string    `json:"temp_url,omitempty" db:"-"`
	TempURLSecretKey     string    `json:"-" db:"-"`
	ProjectIntegrationID *int64    `json:"project_integration_id" db:"project_integration_id"`
}

WorkflowNodeRunArtifact represents tests list

func (WorkflowNodeRunArtifact) Equal

Equal returns true if w WorkflowNodeRunArtifact equals c

func (*WorkflowNodeRunArtifact) GetName

func (w *WorkflowNodeRunArtifact) GetName() string

GetName returns the name the artifact

func (*WorkflowNodeRunArtifact) GetPath

func (w *WorkflowNodeRunArtifact) GetPath() string

GetPath returns the path of the artifact

type WorkflowNodeRunCoverage

type WorkflowNodeRunCoverage struct {
	WorkflowID        int64                         `json:"workflow_id" db:"workflow_id"`
	WorkflowNodeRunID int64                         `json:"workflow_node_run_id" db:"workflow_node_run_id"`
	WorkflowRunID     int64                         `json:"workflow_run_id" db:"workflow_run_id"`
	ApplicationID     int64                         `json:"application_id" db:"application_id"`
	Num               int64                         `json:"run_number" db:"run_number"`
	Repository        string                        `json:"repository" db:"repository"`
	Branch            string                        `json:"branch" db:"branch"`
	Report            coverage.Report               `json:"report" db:"-"`
	Trend             WorkflowNodeRunCoverageTrends `json:"trend" db:"-"`
}

WorkflowNodeRunCoverage represents the code coverage report

type WorkflowNodeRunCoverageTrends

type WorkflowNodeRunCoverageTrends struct {
	CurrentBranch coverage.Report `json:"current_branch_report"`
	DefaultBranch coverage.Report `json:"default_branch_report"`
}

WorkflowNodeRunCoverageTrends represents code coverage trend with current branch and default branch

type WorkflowNodeRunHookEvent

type WorkflowNodeRunHookEvent struct {
	Payload              map[string]string `json:"payload" db:"-"`
	WorkflowNodeHookUUID string            `json:"uuid" db:"-"`
	ParentWorkflow       struct {
		Key       string `json:"key" db:"-"`
		Name      string `json:"name" db:"-"`
		Run       int64  `json:"run" db:"-"`
		HookRunID string `hook_run_id:"uuid" db:"-"`
	} `json:"parent_workflow" db:"-"`
}

WorkflowNodeRunHookEvent is an instanc of event received on a hook

type WorkflowNodeRunManual

type WorkflowNodeRunManual struct {
	Payload            interface{} `json:"payload" db:"-"`
	PipelineParameters []Parameter `json:"pipeline_parameter" db:"-"`
	OnlyFailedJobs     bool        `json:"only_failed_jobs" db:"-"`
	Resync             bool        `json:"resync" db:"-"`
	Username           string      `json:"username" db:"-"`
	Fullname           string      `json:"fullname" db:"-"`
	Email              string      `json:"email" db:"-"`
}

WorkflowNodeRunManual is an instanc of event received on a hook

type WorkflowNodeRunRelease

type WorkflowNodeRunRelease struct {
	TagName        string   `json:"tag_name"`
	ReleaseTitle   string   `json:"release_title"`
	ReleaseContent string   `json:"release_content"`
	Artifacts      []string `json:"artifacts,omitempty"`
}

WorkflowNodeRunRelease represents the request struct use by release builtin action for workflow

type WorkflowNodeRunVulnerability

type WorkflowNodeRunVulnerability struct {
	Vulnerabilities      []Vulnerability  `json:"vulnerabilities"`
	Summary              map[string]int64 `json:"summary"`
	DefaultBranchSummary map[string]int64 `json:"default_branch_summary"`
	PreviousRunSummary   map[string]int64 `json:"previous_run_summary"`
}

WorkflowNodeRunVulnerability content of the workflow node run vulnerability report

type WorkflowNodeRunVulnerabilityReport

type WorkflowNodeRunVulnerabilityReport struct {
	ID                int64                        `json:"id" db:"id"`
	ApplicationID     int64                        `json:"application_id" db:"application_id"`
	WorkflowID        int64                        `json:"workflow_id" db:"workflow_id"`
	WorkflowRunID     int64                        `json:"workflow_run_id" db:"workflow_run_id"`
	WorkflowNodeRunID int64                        `json:"workflow_node_run_id" db:"workflow_node_run_id"`
	Num               int64                        `json:"num" db:"workflow_number"`
	Branch            string                       `json:"branch" db:"branch"`
	Report            WorkflowNodeRunVulnerability `json:"report" db:"-"`
}

WorkflowNodeRunVulnerabilityReport represents vulnerabilities report for the current node run

type WorkflowNodeTriggerRun

type WorkflowNodeTriggerRun struct {
	WorkflowDestNodeID int64  `json:"workflow_dest_node_id" db:"-"`
	Status             string `json:"status" db:"-"`
}

WorkflowNodeTriggerRun Represent the state of a trigger

type WorkflowNodeTriggerRuns

type WorkflowNodeTriggerRuns map[int64]WorkflowNodeTriggerRun

func (*WorkflowNodeTriggerRuns) Scan

func (a *WorkflowNodeTriggerRuns) Scan(src interface{}) error

func (WorkflowNodeTriggerRuns) Value

type WorkflowNotification

type WorkflowNotification struct {
	ID             int64                    `json:"id,omitempty" db:"id"`
	WorkflowID     int64                    `json:"workflow_id,omitempty" db:"workflow_id"`
	SourceNodeRefs []string                 `json:"source_node_ref,omitempty" db:"-"`
	NodeIDs        []int64                  `json:"node_id,omitempty" db:"-"`
	Type           string                   `json:"type" db:"type"`
	Settings       UserNotificationSettings `json:"settings" db:"-"`
	Integration    string                   `json:"integration,omitempty" db:"-"`
}

WorkflowNotification represents notifications on a workflow

type WorkflowProjectIntegration

type WorkflowProjectIntegration struct {
	ID                   int64              `json:"id" db:"id"`
	WorkflowID           int64              `json:"workflow_id" db:"workflow_id"`
	ProjectIntegrationID int64              `json:"project_integration_id" db:"project_integration_id"`
	ProjectIntegration   ProjectIntegration `json:"project_integration" db:"-"`
	Config               IntegrationConfig  `json:"config" db:"config"`
}

func (*WorkflowProjectIntegration) MergeWithModel

func (wpi *WorkflowProjectIntegration) MergeWithModel(model IntegrationModel)

type WorkflowQueue

type WorkflowQueue []WorkflowNodeJobRun

func (WorkflowQueue) Sort

func (q WorkflowQueue) Sort()

type WorkflowRun

type WorkflowRun struct {
	ID               int64                         `json:"id" db:"id"`
	Number           int64                         `json:"num" db:"num" cli:"num,key"`
	Version          *string                       `json:"version,omitempty" db:"version" cli:"version"`
	ProjectID        int64                         `json:"project_id,omitempty" db:"project_id"`
	WorkflowID       int64                         `json:"workflow_id" db:"workflow_id"`
	Status           string                        `json:"status" db:"status" cli:"status"`
	Workflow         Workflow                      `json:"workflow" db:"workflow"`
	Start            time.Time                     `json:"start" db:"start" cli:"start"`
	LastModified     time.Time                     `json:"last_modified" db:"last_modified"`
	WorkflowNodeRuns map[int64][]WorkflowNodeRun   `json:"nodes,omitempty" db:"-"`
	Infos            WorkflowRunInfos              `json:"infos,omitempty" db:"infos"`
	Tags             []WorkflowRunTag              `json:"tags,omitempty" db:"-" cli:"tags"`
	LastSubNumber    int64                         `json:"last_subnumber" db:"last_sub_num"`
	LastExecution    time.Time                     `json:"last_execution" db:"last_execution" cli:"last_execution"`
	ToDelete         bool                          `json:"to_delete" db:"to_delete" cli:"-"`
	JoinTriggersRun  WorkflowNodeTriggerRuns       `json:"join_triggers_run,omitempty" db:"join_triggers_run"`
	Header           WorkflowRunHeaders            `json:"header,omitempty" db:"header"`
	URLs             URL                           `json:"urls" yaml:"-" db:"-" cli:"-"`
	ReadOnly         bool                          `json:"read_only" yaml:"-" db:"read_only" cli:"-"`
	ToCraft          bool                          `json:"-" yaml:"-" db:"to_craft" cli:"-"`
	ToCraftOpts      *WorkflowRunPostHandlerOption `json:"-" yaml:"-" db:"to_craft_opts" cli:"-"`
}

WorkflowRun is an execution instance of a run

func (*WorkflowRun) GetOutgoingHookRun

func (r *WorkflowRun) GetOutgoingHookRun(uuid string) *WorkflowNodeRun

func (*WorkflowRun) HasParentWorkflow

func (r *WorkflowRun) HasParentWorkflow() bool

func (*WorkflowRun) PendingOutgoingHook

func (r *WorkflowRun) PendingOutgoingHook() map[string]*WorkflowNodeRun

func (*WorkflowRun) RootRun

func (r *WorkflowRun) RootRun() *WorkflowNodeRun

func (*WorkflowRun) Tag

func (r *WorkflowRun) Tag(tag, value string) bool

Tag push a new Tag in WorkflowRunTag and return if a tag was added or no

func (*WorkflowRun) TagExists

func (r *WorkflowRun) TagExists(tag string) bool

TagExists returns true if tag already exists

func (*WorkflowRun) Translate

func (r *WorkflowRun) Translate()

Translate translates messages in WorkflowNodeRun

type WorkflowRunHeaders

type WorkflowRunHeaders map[string]string

func (*WorkflowRunHeaders) Get

func (h *WorkflowRunHeaders) Get(k string) (string, bool)

func (*WorkflowRunHeaders) Scan

func (h *WorkflowRunHeaders) Scan(src interface{}) error

func (*WorkflowRunHeaders) Set

func (h *WorkflowRunHeaders) Set(k, v string)

func (WorkflowRunHeaders) Value

func (h WorkflowRunHeaders) Value() (driver.Value, error)

type WorkflowRunInfo

type WorkflowRunInfo struct {
	APITime time.Time `json:"api_time,omitempty" db:"-"`
	Message SpawnMsg  `json:"message,omitempty" db:"-"`
	// UserMessage contains msg translated for end user
	UserMessage string `json:"user_message,omitempty" db:"-"`
	SubNumber   int64  `json:"sub_number,omitempty" db:"-"`
	Type        string `json:"type" db:"-"`
}

WorkflowRunInfo is an info on workflow run

type WorkflowRunInfos

type WorkflowRunInfos []WorkflowRunInfo

func (*WorkflowRunInfos) Scan

func (a *WorkflowRunInfos) Scan(src interface{}) error

func (WorkflowRunInfos) Value

func (a WorkflowRunInfos) Value() (driver.Value, error)

type WorkflowRunNumber

type WorkflowRunNumber struct {
	Num int64 `json:"num" cli:"run-number"`
}

WorkflowRunNumber contains a workflow run number

type WorkflowRunPostHandlerOption

type WorkflowRunPostHandlerOption struct {
	Hook           *WorkflowNodeRunHookEvent `json:"hook,omitempty"`
	Manual         *WorkflowNodeRunManual    `json:"manual,omitempty"`
	Number         *int64                    `json:"number,omitempty"`
	FromNodeIDs    []int64                   `json:"from_nodes,omitempty"`
	AuthConsumerID string                    `json:"auth_consumer,omitempty"`
}

WorkflowRunPostHandlerOption contains the body content for launch a workflow

func (*WorkflowRunPostHandlerOption) Scan

func (a *WorkflowRunPostHandlerOption) Scan(src interface{}) error

Scan WorkflowRunPostHandlerOption.

func (*WorkflowRunPostHandlerOption) Value

Value returns driver.Value from WorkflowRunPostHandlerOption.

type WorkflowRunResult

type WorkflowRunResult struct {
	ID                string                `json:"id" db:"id"`
	Created           time.Time             `json:"created" db:"created"`
	WorkflowRunID     int64                 `json:"workflow_run_id" db:"workflow_run_id"`
	WorkflowNodeRunID int64                 `json:"workflow_node_run_id" db:"workflow_node_run_id"`
	WorkflowRunJobID  int64                 `json:"workflow_run_job_id" db:"workflow_run_job_id"`
	SubNum            int64                 `json:"sub_num" db:"sub_num"`
	Type              WorkflowRunResultType `json:"type" db:"type"`
	DataRaw           json.RawMessage       `json:"data" db:"data"`
}

func (*WorkflowRunResult) GetArtifact

func (*WorkflowRunResult) GetArtifactManager

func (r *WorkflowRunResult) GetArtifactManager() (WorkflowRunResultArtifactManager, error)

func (*WorkflowRunResult) GetCoverage

func (*WorkflowRunResult) GetStaticFile

func (r *WorkflowRunResult) GetStaticFile() (WorkflowRunResultStaticFile, error)

type WorkflowRunResultArtifact

type WorkflowRunResultArtifact struct {
	Name       string `json:"name"`
	Size       int64  `json:"size"`
	MD5        string `json:"md5"`
	CDNRefHash string `json:"cdn_hash"`
	Perm       uint32 `json:"perm"`
}

func (*WorkflowRunResultArtifact) IsValid

func (a *WorkflowRunResultArtifact) IsValid() error

type WorkflowRunResultArtifactManager

type WorkflowRunResultArtifactManager struct {
	Name     string `json:"name"`
	Size     int64  `json:"size"`
	MD5      string `json:"md5"`
	Path     string `json:"path"`
	Perm     uint32 `json:"perm"`
	RepoName string `json:"repository_name"`
	RepoType string `json:"repository_type"`
}

func (*WorkflowRunResultArtifactManager) IsValid

type WorkflowRunResultCheck

type WorkflowRunResultCheck struct {
	Name       string                `json:"name"`
	RunID      int64                 `json:"run_id"`
	RunNodeID  int64                 `json:"run_node_id"`
	RunJobID   int64                 `json:"run_job_id"`
	ResultType WorkflowRunResultType `json:"result_type"`
}

type WorkflowRunResultCoverage

type WorkflowRunResultCoverage struct {
	Name       string `json:"name"`
	Size       int64  `json:"size"`
	MD5        string `json:"md5"`
	CDNRefHash string `json:"cdn_hash"`
	Perm       uint32 `json:"perm"`
}

func (*WorkflowRunResultCoverage) IsValid

func (a *WorkflowRunResultCoverage) IsValid() error

type WorkflowRunResultDataKey

type WorkflowRunResultDataKey string

type WorkflowRunResultStaticFile

type WorkflowRunResultStaticFile struct {
	Name      string `json:"name"`
	RemoteURL string `json:"remote_url"`
}

func (*WorkflowRunResultStaticFile) IsValid

func (a *WorkflowRunResultStaticFile) IsValid() error

type WorkflowRunResultType

type WorkflowRunResultType string
const (
	WorkflowRunResultTypeArtifact        WorkflowRunResultType = "artifact"
	WorkflowRunResultTypeCoverage        WorkflowRunResultType = "coverage"
	WorkflowRunResultTypeArtifactManager WorkflowRunResultType = "artifact-manager"
	WorkflowRunResultTypeStaticFile      WorkflowRunResultType = "static-file"
)

type WorkflowRunSecret

type WorkflowRunSecret struct {
	ID            string `json:"-" db:"id"`
	WorkflowRunID int64  `json:"-" db:"workflow_run_id"`
	Type          string `json:"-" db:"type"`
	Context       string `json:"-" db:"context"`
	Name          string `json:"-" db:"name"`
	Value         []byte `json:"-" db:"cypher_value" gorpmapping:"encrypted,ID"`
}

type WorkflowRunSummary

type WorkflowRunSummary struct {
	ID            int64                         `json:"id" db:"id" cli:"-"`
	Version       *string                       `json:"version,omitempty" db:"version" cli:"version"`
	Number        int64                         `json:"num" db:"num" cli:"num,key"`
	Status        string                        `json:"status" db:"status" cli:"status"`
	Start         time.Time                     `json:"start" db:"start" cli:"start"`
	LastModified  time.Time                     `json:"last_modified" db:"last_modified" cli:"-"`
	LastSubNumber int64                         `json:"last_subnumber" db:"last_sub_num" cli:"-"`
	LastExecution time.Time                     `json:"last_execution" db:"last_execution" cli:"last_execution"`
	ToCraftOpts   *WorkflowRunPostHandlerOption `json:"-" yaml:"-" db:"to_craft_opts" cli:"-"`
	Tags          []WorkflowRunTag              `json:"tags,omitempty" db:"-" cli:"tags"`
}

type WorkflowRunTag

type WorkflowRunTag struct {
	WorkflowRunID int64  `json:"-" db:"workflow_run_id"`
	Tag           string `json:"tag,omitempty" db:"tag" cli:"tag"`
	Value         string `json:"value,omitempty" db:"value" cli:"value"`
}

WorkflowRunTag is a tag on workflow run

type WorkflowRunToKeep

type WorkflowRunToKeep struct {
	ID     int64  `json:"id"`
	Status string `json:"status"`
	Num    int64  `json:"num"`
}

type WorkflowRunVersion

type WorkflowRunVersion struct {
	Value string `json:"value"`
}

WorkflowRunVersion contains a workflow run version.

func (WorkflowRunVersion) IsValid

func (w WorkflowRunVersion) IsValid() error

type WorkflowTemplate

type WorkflowTemplate struct {
	ID           int64                      `json:"id" db:"id"`
	GroupID      int64                      `json:"group_id" db:"group_id"`
	Name         string                     `json:"name" db:"name"`
	Slug         string                     `json:"slug" db:"slug"`
	Description  string                     `json:"description" db:"description"`
	Parameters   WorkflowTemplateParameters `json:"parameters" db:"parameters"`
	Workflow     string                     `json:"value" db:"value"`
	Pipelines    PipelineTemplates          `json:"pipelines" db:"pipelines"`
	Applications ApplicationTemplates       `json:"applications" db:"applications"`
	Environments EnvironmentTemplates       `json:"environments" db:"environments"`
	Version      int64                      `json:"version" db:"version"`
	ImportURL    string                     `json:"import_url" db:"import_url"`
	// aggregates
	Group         *Group                 `json:"group,omitempty" db:"-"`
	FirstAudit    *AuditWorkflowTemplate `json:"first_audit,omitempty" db:"-"`
	LastAudit     *AuditWorkflowTemplate `json:"last_audit,omitempty" db:"-"`
	Editable      bool                   `json:"editable,omitempty" db:"-"`
	ChangeMessage string                 `json:"change_message,omitempty" db:"-"`
}

WorkflowTemplate struct.

func (*WorkflowTemplate) CheckParams

CheckParams returns template parameters validity.

func (*WorkflowTemplate) IsValid

func (w *WorkflowTemplate) IsValid() error

IsValid returns workflow template validity.

func (WorkflowTemplate) Path

func (w WorkflowTemplate) Path() string

func (WorkflowTemplate) PathWithVersion

func (w WorkflowTemplate) PathWithVersion() string

func (*WorkflowTemplate) Scan

func (w *WorkflowTemplate) Scan(src interface{}) error

Scan workflow template.

func (*WorkflowTemplate) Update

func (w *WorkflowTemplate) Update(data WorkflowTemplate)

Update workflow template field from new data.

func (WorkflowTemplate) Value

func (w WorkflowTemplate) Value() (driver.Value, error)

Value returns driver.Value from workflow template.

type WorkflowTemplateBulk

type WorkflowTemplateBulk struct {
	ID                 int64                          `json:"id" db:"id"`
	UserID             string                         `json:"user_id" db:"authentified_user_id"`
	WorkflowTemplateID int64                          `json:"workflow_template_id" db:"workflow_template_id"`
	Operations         WorkflowTemplateBulkOperations `json:"operations" db:"operations"`
}

WorkflowTemplateBulk contains info about a template bulk task.

func (WorkflowTemplateBulk) IsDone

func (w WorkflowTemplateBulk) IsDone() bool

IsDone returns true if all operations are complete.

type WorkflowTemplateBulkOperation

type WorkflowTemplateBulkOperation struct {
	Status  OperationStatus         `json:"status"`
	Error   string                  `json:"error,omitempty"`
	Request WorkflowTemplateRequest `json:"request"`
}

WorkflowTemplateBulkOperation contains one operation of a template bulk task.

type WorkflowTemplateBulkOperations

type WorkflowTemplateBulkOperations []WorkflowTemplateBulkOperation

WorkflowTemplateBulkOperations struct.

func (*WorkflowTemplateBulkOperations) Scan

func (w *WorkflowTemplateBulkOperations) Scan(src interface{}) error

Scan pipeline templates.

func (WorkflowTemplateBulkOperations) Value

Value returns driver.Value from workflow template bulk operations.

type WorkflowTemplateError

type WorkflowTemplateError struct {
	Type    string `json:"type"`
	Number  int    `json:"number"`
	Line    int    `json:"line"`
	Message string `json:"message"`
}

WorkflowTemplateError contains info about template parsing error.

func (WorkflowTemplateError) Error

func (w WorkflowTemplateError) Error() string

type WorkflowTemplateInstance

type WorkflowTemplateInstance struct {
	ID                      int64                   `json:"id" db:"id"`
	WorkflowTemplateID      int64                   `json:"workflow_template_id" db:"workflow_template_id"`
	ProjectID               int64                   `json:"project_id" db:"project_id"`
	WorkflowID              *int64                  `json:"workflow_id" db:"workflow_id"`
	WorkflowTemplateVersion int64                   `json:"workflow_template_version" db:"workflow_template_version"`
	Request                 WorkflowTemplateRequest `json:"request" db:"request"`
	WorkflowName            string                  `json:"workflow_name" db:"workflow_name"`
	// aggregates
	FirstAudit *AuditWorkflowTemplateInstance `json:"first_audit,omitempty" db:"-"`
	LastAudit  *AuditWorkflowTemplateInstance `json:"last_audit,omitempty" db:"-"`
	Template   *WorkflowTemplate              `json:"template,omitempty" db:"-"`
	Project    *Project                       `json:"project,omitempty" db:"-"`
	Workflow   *Workflow                      `json:"workflow,omitempty" db:"-"`
}

WorkflowTemplateInstance struct.

type WorkflowTemplateParameter

type WorkflowTemplateParameter struct {
	Key      string                `json:"key"`
	Type     TemplateParameterType `json:"type"`
	Required bool                  `json:"required"`
}

WorkflowTemplateParameter struct.

func (*WorkflowTemplateParameter) IsValid

func (w *WorkflowTemplateParameter) IsValid() error

IsValid returns pipeline template validity.

type WorkflowTemplateParameters

type WorkflowTemplateParameters []WorkflowTemplateParameter

WorkflowTemplateParameters struct.

func (*WorkflowTemplateParameters) Scan

func (w *WorkflowTemplateParameters) Scan(src interface{}) error

Scan workflow template parameters.

func (WorkflowTemplateParameters) Value

Value returns driver.Value from workflow template parameters.

type WorkflowTemplateParsed

type WorkflowTemplateParsed struct {
	Workflow     *template.Template
	Pipelines    []*template.Template
	Applications []*template.Template
	Environments []*template.Template
}

WorkflowTemplateParsed struct.

type WorkflowTemplateRequest

type WorkflowTemplateRequest struct {
	ProjectKey   string            `json:"project_key"`
	WorkflowName string            `json:"workflow_name"`
	Parameters   map[string]string `json:"parameters"`
	Detached     bool              `json:"detached,omitempty"`
}

WorkflowTemplateRequest struct use for execution request.

func (*WorkflowTemplateRequest) Scan

func (w *WorkflowTemplateRequest) Scan(src interface{}) error

Scan workflow template request.

func (WorkflowTemplateRequest) Value

Value returns driver.Value from workflow template request.

type Workflows

type Workflows []Workflow

func (Workflows) Filter

func (workflows Workflows) Filter(f func(w Workflow) bool) Workflows

func (Workflows) IDs

func (workflows Workflows) IDs() []int64

func (Workflows) Names

func (workflows Workflows) Names() []string

Directories

Path Synopsis
mock_cdsclient
Package mock_cdsclient is a generated GoMock package.
Package mock_cdsclient is a generated GoMock package.
v1
v2
mock_hatchery
Package mock_hatchery is a generated GoMock package.
Package mock_hatchery is a generated GoMock package.
interpolate module
izanami module
log
Package namesgenerator original package is https://github.com/moby/moby/tree/master/pkg/namesgenerator Moby is licensed under the Apache License, Version 2.0.
Package namesgenerator original package is https://github.com/moby/moby/tree/master/pkg/namesgenerator Moby is licensed under the Apache License, Version 2.0.
vcs
git

Jump to

Keyboard shortcuts

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