cds: github.com/ovh/cds/sdk Index | Files | Directories

package sdk

import "github.com/ovh/cds/sdk"

Index

Package Files

action.go action_script.go application.go application_vulnerability.go artifact.go ascode.go audit.go bitbucket_server.go bitbucket_server_events.go bookmark.go broadcast.go build.go cache.go common.go common_date.go config.go database.go download.go duration.go environment.go error.go event.go event_action.go event_application.go event_ascode.go event_broadcast.go event_environment.go event_operation.go event_pipeline.go event_project.go event_warning.go event_workflow.go event_workflow_template.go favorite.go file.go fs.go goroutine.go group.go hash.go health.go hook.go hooks.go integration.go job.go key.go log.go maintenance.go messages.go metric.go migration.go navbar.go notif.go overview.go parameter.go pipeline.go plugin.go project.go reflect.go repositories_manager.go repositories_operation.go request.go requirement.go result.go schema.go services.go signal_linux.go stage.go static_files.go status.go timeline.go token.go trigger.go usage.go user.go util.go uuid.go variable.go vcs.go version.go warning.go websocket.go worker.go worker_model.go workflow.go workflow_conditions.go workflow_data.go workflow_hook.go workflow_node.go workflow_run.go workflow_template.go

Constants

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

Action type

const (
    ScriptAction              = "Script"
    JUnitAction               = "JUnit"
    CoverageAction            = "Coverage"
    GitCloneAction            = "GitClone"
    GitTagAction              = "GitTag"
    ReleaseAction             = "Release"
    CheckoutApplicationAction = "CheckoutApplication"
    DeployApplicationAction   = "DeployApplication"
    InstallKeyAction          = "InstallKey"

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

Builtin Action

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

Builtin artifact manipulation actions

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

Different type of Audit event

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

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
)
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

const (
    KafkaIntegrationModel         = "Kafka"
    RabbitMQIntegrationModel      = "RabbitMQ"
    OpenstackIntegrationModel     = "Openstack"
    AWSIntegrationModel           = "AWS"
    DefaultStorageIntegrationName = "shared.infra"
)

This is the buitin integration model

const (
    IntegrationTypeEvent      = IntegrationType("event")
    IntegrationTypeCompute    = IntegrationType("compute")
    IntegrationTypeHook       = IntegrationType("hook")
    IntegrationTypeStorage    = IntegrationType("storage")
    IntegrationTypeDeployment = IntegrationType("deployment")
)
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"
)
const (
    MaintenanceAPIKey    string = "cds_maintenance_api"
    MaintenanceQueueName string = "cds_maintenance"
)
const (
    MetricKeyVulnerability = "Vulnerability"
    MetricKeyUnitTest      = "UnitTest"
    MetricKeyCoverage      = "Coverage"
)
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"
)
const (
    EmailUserNotification  = "email"
    JabberUserNotification = "jabber"
    VCSUserNotification    = "vcs"
)

const

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

const

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

const (
    GRPCPluginDeploymentIntegration = "integration-deploy_application"
    GRPCPluginAction                = "action"
)

These are type of plugins

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"
)
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"
)
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"
    // VolumeRequirement set Volume limit on a container
    VolumeRequirement = "volume"
    // 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"
)
const (
    MonitoringStatusAlert = "AL"
    MonitoringStatusWarn  = "WARN"
    MonitoringStatusOK    = "OK"
)

This constants deals with Monitoring statuses

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

User rings.

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

Different type of Variable

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

HTTP Headers

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"
)
const (
    Docker      = "docker"
    HostProcess = "host"
    Openstack   = "openstack"
    VSphere     = "vsphere"
)

Existing worker model type

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

WorkflowData conditions operator

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

Those are icon for hooks

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"
)
const (
    NodeTypePipeline     = "pipeline"
    NodeTypeJoin         = "join"
    NodeTypeOutGoingHook = "outgoinghook"
    NodeTypeFork         = "fork"
)
const (
    RunInfoTypInfo     = "Info"
    RunInfoTypeWarning = "Warning"
    RunInfoTypeError   = "Error"
)
const AuthSigninConsumerTokenDuration time.Duration = time.Minute * 5
const (
    DefaultHistoryLength int64 = 20
)

DefaultHistoryLength is the default history length

const DefaultWorkflowNodeRunReport = "" /* 835 byte string literal not displayed */
const IconFormat = "data:image/"

IconFormat is the format prefix accepted for icon

const MaxIconSize = 120000

MaxIconSize is the maximum size of the icon in octet

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

NamePattern Pattern for project/application/pipeline/group name

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

NamePatternSpace Pattern for stage name

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

This constant deals with pipelines

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

Value of passwords when leaving the API

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

ProjectKeyPattern pattern for project key

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
)
const SharedInfraGroupName = "shared.infra"

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

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

URLGithubIssues contains a link to CDS Issues

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

URLGithubReleases contains a link to CDS Official Releases

const UserContactTypeEmail = "email"
const WorkflowHookModelBuiltin = "builtin"

WorkflowHookModelBuiltin is a constant for the builtin hook models

Variables

var (
    True        = true
    False       = false
    TrueString  = "true"
    FalseString = "false"
)

True of false

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}
    ErrSessionNotFound                               = Error{ID: 54, Status: http.StatusUnauthorized}
    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}
)

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

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

var (
    BuiltinIntegrationModels = []*IntegrationModel{
        &KafkaIntegration,
        &RabbitMQIntegration,
        &OpenstackIntegration,
        &AWSIntegration,
    }
    // 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,
    }
    // 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

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

Supported API language

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}
    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 spawn worker with model %s after %s, err:%s"}, nil, RunInfoTypeError}
    MsgSpawnInfoHatcheryStartsSuccessfully  = &Message{"MsgSpawnInfoHatcheryStartsSuccessfully", trad{FR: "La Hatchery %s a démarré le worker %s avec succès en %s", EN: "Hatchery %s spawn worker %s successfully in %s"}, nil, RunInfoTypInfo}
    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 and took %s to work on the steps"}, 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 was 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: "" /* 137 byte string literal not displayed */, EN: "" /* 135 byte string literal not displayed */}, 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: "" /* 130 byte string literal not displayed */, 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}
)

Message list

var (
    UserNotificationTemplateEmail = UserNotificationTemplate{
        Subject: "{{.cds.project}}/{{.cds.workflow}}#{{.cds.version}} {{.cds.status}}",
        Body:    "" /* 239 byte string literal not displayed */,
    }

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

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

Default template values

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

    // 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"},
    }
)
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",
    }
)
var (
    BitbucketEvents = []string{
        "repo:refs_changed",
        "repo:modified",
        "repo:forked",
        "repo:comment:added",
        "repo:comment:edited",
        "repo:comment:deleted",
        "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,
    }
)
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 = ""
)
var (
    WorkflowRunHeader = "X-Workflow-Run"
    WorkflowHeader    = "X-Workflow"
    ProjectKeyHeader  = "X-Project-Key"
)
var AuthConsumerScopes = []AuthConsumerScope{
    AuthConsumerScopeUser,
    AuthConsumerScopeAccessToken,
    AuthConsumerScopeAction,
    AuthConsumerScopeAdmin,
    AuthConsumerScopeGroup,
    AuthConsumerScopeTemplate,
    AuthConsumerScopeProject,
    AuthConsumerScopeRun,
    AuthConsumerScopeRunExecution,
    AuthConsumerScopeHooks,
    AuthConsumerScopeWorker,
    AuthConsumerScopeWorkerModel,
    AuthConsumerScopeHatchery,
    AuthConsumerScopeService,
}

AuthConsumerScopes list.

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

ColorRegexp represent the regexp for a format to hexadecimal color

var DefaultEnv = Environment{
    ID:   1,
    Name: "NoEnv",
}

DefaultEnv Default environment for pipeline build

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.

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

MapMergeOptions options for mapMerge functions

var MessageAmericanEnglish = map[string]string{
    WarningMissingProjectVariableEnv:               "" /* 140 byte string literal not displayed */,
    WarningMissingProjectVariableApplication:       "" /* 140 byte string literal not displayed */,
    WarningMissingProjectVariablePipelineParameter: "" /* 147 byte string literal not displayed */,
    WarningMissingProjectVariablePipelineJob:       "" /* 197 byte string literal not displayed */,
    WarningMissingProjectVariableWorkflow:          "" /* 173 byte string literal not displayed */,
    WarningUnusedProjectVariable:                   `Unused variable {{index . "VarName"}} on project {{index . "ProjectKey"}}.`,
    WarningMissingProjectPermissionEnv:             "" /* 132 byte string literal not displayed */,
    WarningMissingProjectPermissionWorkflow:        `Group {{index . "GroupName"}} is not on project {{index . "ProjectKey"}} but is used on Workflow {{index . "WorkflowName"}}.`,
    WarningMissingProjectKeyApplication:            "" /* 135 byte string literal not displayed */,
    WarningMissingProjectKeyPipelineParameter:      "" /* 145 byte string literal not displayed */,
    WarningMissingProjectKeyPipelineJob:            "" /* 192 byte string literal not displayed */,
    WarningUnusedProjectKey:                        `Unused key {{index . "KeyName"}} on project {{index . "ProjectKey"}}.`,
    WarningMissingProjectVCSServer:                 "" /* 153 byte string literal not displayed */,
    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:              "" /* 137 byte string literal not displayed */,
    WarningUnusedApplicationVariable:               `Unused variable {{index . "VarName"}} on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
    WarningMissingApplicationKey:                   "" /* 132 byte string literal not displayed */,
    WarningUnusedApplicationKey:                    `Unused key {{index . "KeyName"}} on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
    WarningMissingEnvironmentVariable:              "" /* 137 byte string literal not displayed */,
    WarningUnusedEnvironmentVariable:               `Unused variable {{index . "VarName"}} on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
    WarningMissingEnvironmentKey:                   "" /* 132 byte string literal not displayed */,
    WarningUnusedEnvironmentKey:                    `Unused key {{index . "KeyName"}} on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
    WarningMissingPipelineParameter:                "" /* 134 byte string literal not displayed */,
    WarningUnusedPipelineParameter:                 `Unused parameter {{index . "ParamName"}} on project/pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}.`,
}
var MessageFrench = map[string]string{
    WarningMissingProjectVariableEnv:               "" /* 155 byte string literal not displayed */,
    WarningMissingProjectVariableApplication:       "" /* 155 byte string literal not displayed */,
    WarningMissingProjectVariablePipelineParameter: "" /* 165 byte string literal not displayed */,
    WarningMissingProjectVariablePipelineJob:       "" /* 223 byte string literal not displayed */,
    WarningMissingProjectVariableWorkflow:          "" /* 189 byte string literal not displayed */,
    WarningUnusedProjectVariable:                   `La variable {{index . "VarName"}} est inutilisée dans le projet {{index . "ProjectKey"}}.`,
    WarningMissingProjectPermissionEnv:             "" /* 155 byte string literal not displayed */,
    WarningMissingProjectPermissionWorkflow:        "" /* 150 byte string literal not displayed */,
    WarningMissingProjectKeyApplication:            "" /* 152 byte string literal not displayed */,
    WarningMissingProjectKeyPipelineParameter:      "" /* 148 byte string literal not displayed */,
    WarningMissingProjectKeyPipelineJob:            "" /* 217 byte string literal not displayed */,
    WarningUnusedProjectKey:                        `La clé {{index . "KeyName"}} est inutilisé dans le projet {{index . "ProjectKey"}}.`,
    WarningMissingProjectVCSServer:                 "" /* 174 byte string literal not displayed */,
    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:              "" /* 141 byte string literal not displayed */,
    WarningUnusedApplicationVariable:               `La variable {{index . "VarName"}} est inutilisée dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
    WarningMissingApplicationKey:                   "" /* 137 byte string literal not displayed */,
    WarningUnusedApplicationKey:                    `La clé {{index . "KeyName"}} est inutilisée dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
    WarningMissingEnvironmentVariable:              "" /* 143 byte string literal not displayed */,
    WarningUnusedEnvironmentVariable:               `La variable {{index . "VarName"}} est inutilisée dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
    WarningMissingEnvironmentKey:                   "" /* 139 byte string literal not displayed */,
    WarningUnusedEnvironmentKey:                    `La clé {{index . "KeyName"}} est inutilisée dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
    WarningMissingPipelineParameter:                "" /* 139 byte string literal not displayed */,
    WarningUnusedPipelineParameter:                 `Le paramètre {{index . "ParamName"}} est inutilisé dans le pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}.`,
}
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,
    MsgSpawnInfoHatcheryStarts.ID:              MsgSpawnInfoHatcheryStarts,
    MsgSpawnInfoHatcheryErrorSpawn.ID:          MsgSpawnInfoHatcheryErrorSpawn,
    MsgSpawnInfoHatcheryStartsSuccessfully.ID:  MsgSpawnInfoHatcheryStartsSuccessfully,
    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,
}

Messages contains all sdk Messages

var NamePatternRegex = regexp.MustCompile(NamePattern)

NamePatternRegex Pattern regexp

var NamePatternSpaceRegex = regexp.MustCompile(NamePatternSpace)

NamePatternSpaceRegex Pattern regexp

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

SupportedLanguages on API errors

var UsernameRegex = regexp.MustCompile("[a-z0-9._-]{3,32}")
var (
    WorkflowConditionsOperators = map[string]string{
        WorkflowConditionsOperatorEquals:             "=",
        WorkflowConditionsOperatorNotEquals:          "!=",
        WorkflowConditionsOperatorLessThan:           "<",
        WorkflowConditionsOperatorLessOrEqualThan:    "<=",
        WorkflowConditionsOperatorGreaterThan:        ">",
        WorkflowConditionsOperatorGreaterOrEqualThan: ">=",
        WorkflowConditionsOperatorRegex:              "match",
    }
)

WorkflowData conditions operator

func ActionInfoMarkdown Uses

func ActionInfoMarkdown(a Action, filename string) string

ActionInfoMarkdown returns string formatted with markdown.

func ActionsToGroupIDs Uses

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

ActionsToGroupIDs returns group ids for given actions list.

func ActionsToIDs Uses

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

ActionsToIDs returns ids for given actions list.

func AddParameter Uses

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

AddParameter append a parameter in a parameter array

func AddRequirement Uses

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

AddRequirement append a requirement in a requirement array

func AuthConsumersToAuthentifiedUserIDs Uses

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

AuthConsumersToAuthentifiedUserIDs returns ids of given auth consumers.

func AuthConsumersToIDs Uses

func AuthConsumersToIDs(cs []AuthConsumer) []string

AuthConsumersToIDs returns ids of given auth consumers.

func AuthentifiedUsersToIDs Uses

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

AuthentifiedUsersToIDs returns ids for given authentified user list.

func Cause Uses

func Cause(err error) error

Cause returns recursively the root error from given error.

func CheckContentTypeBinary Uses

func CheckContentTypeBinary(resp *http.Response) error

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

func ComputeWorkerModelPath Uses

func ComputeWorkerModelPath(groupName, modelName string) string

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

func CreateTarFromPaths Uses

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 Uses

func DecodeError(data []byte) error

DecodeError return an Error struct from json

func DefaultIfEmptyStorage Uses

func DefaultIfEmptyStorage(integrationName string) string

DefaultIfEmptyStorage return sdk.DefaultStorageIntegrationName if integrationName is empty

func DeleteEmptyValueFromArray Uses

func DeleteEmptyValueFromArray(array []string) []string

DeleteEmptyValueFromArray deletes empty value from an array of string

func DirectoryExists Uses

func DirectoryExists(path string) (bool, error)

DirectoryExists checks if the directory exists

func EnvVartoENV Uses

func EnvVartoENV(p Parameter) []string

func ErrorIs Uses

func ErrorIs(err error, target Error) bool

ErrorIs returns true if error match the target error.

func ErrorIsUnknown Uses

func ErrorIsUnknown(err error) bool

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

func ErrorWithFallback Uses

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 Uses

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

Exit func display an error message on stderr and exit 1

func FileMd5sum Uses

func FileMd5sum(filePath string) (string, error)

FileMd5sum returns the md5sum ofr a file

func FileSHA512sum Uses

func FileSHA512sum(filePath string) (string, error)

FileSHA512sum returns the sha512sum of a file

func FormatDateRFC5322 Uses

func FormatDateRFC5322(date time.Time) string

FormatDateRFC5322 format an RFC 5322 date string.

func GenerateHash Uses

func GenerateHash() (string, error)

func GenerateProjectDefaultKeyName Uses

func GenerateProjectDefaultKeyName(projectKey string, t KeyType) string

func GetArtifactFilename Uses

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

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

func GetContentType Uses

func GetContentType(resp *http.Response) string

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

func GoRoutine Uses

func GoRoutine(c context.Context, name string, fn func(ctx context.Context), writerFactories ...func(s string) (io.WriteCloser, error))

GoRoutine runs the function within a goroutine with a panic recovery

func GoroutineID Uses

func GoroutineID() uint64

func GroupPointersToIDs Uses

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

GroupPointersToIDs returns ids of given groups.

func IntMapToSlice Uses

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

IntMapToSlice converts a map struct to a slice for int64 keys

func InterfaceSlice Uses

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 IsErrorWithStack Uses

func IsErrorWithStack(err error) bool

IsErrorWithStack returns true if given error is an errorWithStack.

func IsGz Uses

func IsGz(buf []byte) bool

IsGz returns true if the content is gzipped

func IsInArray Uses

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

IsInArray checks if the element is in the array

func IsInInt64Array Uses

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

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

func IsTar Uses

func IsTar(buf []byte) bool

IsTar returns true if the content is a tar

func IsURL Uses

func IsURL(path string) bool

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

func IsValidEmail Uses

func IsValidEmail(email string) bool

IsValidEmail Check if user email address is ok

func IsValidPermissionValue Uses

func IsValidPermissionValue(v int) bool

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

func IsValidUUID Uses

func IsValidUUID(uu string) bool

func JSONWithoutHTMLEncode Uses

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

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

func ListGoroutines Uses

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

func LookPath Uses

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 Uses

func MessagesToError(messages []Message) error

MessagesToError returns a translated slices of messages as an error

func ModelsToGroupIDs Uses

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

ModelsToGroupIDs returns group ids of given worker models.

func NeedPlaceholder Uses

func NeedPlaceholder(t string) bool

NeedPlaceholder returns true if variable type is either secret or key

func NewError Uses

func NewError(httpError Error, err error) error

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

func NewErrorFrom Uses

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

NewErrorFrom returns the given error with given from details.

func NewErrorWithStack Uses

func NewErrorWithStack(root error, err error) error

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

func ParameterAddOrSetValue Uses

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

ParameterAddOrSetValue add a new parameter or update a value

func ParameterValue Uses

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 Uses

func ParametersFromApplicationKeys(app Application) map[string]string

ParametersFromApplicationVariables returns a map from application key

func ParametersFromApplicationVariables Uses

func ParametersFromApplicationVariables(app Application) map[string]string

ParametersFromApplicationVariables returns a map from a slice of parameters

func ParametersFromEnvironmentKeys Uses

func ParametersFromEnvironmentKeys(env Environment) map[string]string

ParametersFromEnvironmentKeys returns a map from environment key

func ParametersFromEnvironmentVariables Uses

func ParametersFromEnvironmentVariables(env Environment) map[string]string

ParametersFromEnvironmentVariables returns a map from a slice of parameters

func ParametersFromIntegration Uses

func ParametersFromIntegration(ppf IntegrationConfig) map[string]string

ParametersFromIntegration returns a map of variables from a ProjectIntegration

func ParametersFromPipelineParameters Uses

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

ParametersFromPipelineParameters returns a map from a slice of parameters

func ParametersFromProjectKeys Uses

func ParametersFromProjectKeys(proj Project) map[string]string

func ParametersFromProjectVariables Uses

func ParametersFromProjectVariables(proj Project) map[string]string

ParametersFromProjectVariables returns a map from a slice of parameters

func ParametersMapMerge Uses

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

ParametersMapMerge merges two maps of parameters preserving all git values

func ParametersToMap Uses

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

ParametersToMap returns a map from a slice of parameters

func ParseDateRFC5322 Uses

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

ParseDateRFC5322 parses an RFC 5322 date string.

func ParseGoRoutineStacks Uses

func ParseGoRoutineStacks(r io.Reader, w io.Writer) ([]*panicparsestack.Goroutine, error)

func PathIsAbs Uses

func PathIsAbs(s string) bool

func ProjectsToIDs Uses

func ProjectsToIDs(ps []Project) []int64

ProjectsToIDs returns ids of given projects.

func RandomString Uses

func RandomString(strlen int) string

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

func ReflectFieldByTag Uses

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 Uses

func RemoveNotPrintableChar(in string) string

func Round Uses

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 Uses

func SHA512sum(s string) (string, error)

func StatusIsTerminated Uses

func StatusIsTerminated(status string) bool

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

func StatusValidate Uses

func StatusValidate(status ...string) bool

StatusValidate returns if given strings are valid status.

func TemplateEnvs Uses

func TemplateEnvs(args WorkerArgs, envs map[string]string) (map[string]string, error)

TemplateEnvs return envs interpolated with worker arguments

func ToVulnerabilitySeverity Uses

func ToVulnerabilitySeverity(s string) string

ToVulnerabilitySeverity converts string to good severity name

func UUID Uses

func UUID() string

UUID returns a UUID v4

func Untar Uses

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 Uses

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 Uses

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

VCSCommitStatusDescription return a node formated status description

func ValidAndNotEmpty Uses

func ValidAndNotEmpty(v reflect.Value) bool

func ValueFromInterface Uses

func ValueFromInterface(i interface{}) reflect.Value

func VersionString Uses

func VersionString() string

VersionString returns a string contains all about current version

func WithData Uses

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

WithData returns an error with data from given error.

func WithStack Uses

func WithStack(err error) error

WithStack returns an error with stack from given error.

func WorkerModelValidate Uses

func WorkerModelValidate(modelType string) bool

WorkerModelValidate returns if given strings are valid worker model type.

func WorkflowCheckConditions Uses

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

WorkflowCheckConditions checks conditions given a list of parameters

func WorkflowTemplateInstancesToIDs Uses

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

WorkflowTemplateInstancesToIDs returns ids of given workflow template instances.

func WorkflowTemplateInstancesToWorkflowIDs Uses

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

WorkflowTemplateInstancesToWorkflowIDs returns workflow ids of given workflow template instances.

func WorkflowTemplateInstancesToWorkflowTemplateIDs Uses

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

WorkflowTemplateInstancesToWorkflowTemplateIDs returns workflow template ids of given workflow template instances.

func WorkflowTemplatesToGroupIDs Uses

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

WorkflowTemplatesToGroupIDs returns group ids of given workflow templates.

func WorkflowTemplatesToIDs Uses

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

WorkflowTemplatesToIDs returns ids of given workflow templates.

func WorkflowToIDs Uses

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

WorkflowToIDs returns ids of given workflows.

func WrapError Uses

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

WrapError returns an error with stack and message.

func WriteGoroutineStacks Uses

func WriteGoroutineStacks(w io.Writer) error

type Action Uses

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 Uses

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

ActionsFilterNotTypes returns a list of actions filtered by types.

func NewAction Uses

func NewAction(name string) *Action

NewAction instantiate a new Action

func (*Action) Add Uses

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

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

func (*Action) FlattenRequirements Uses

func (a *Action) FlattenRequirements() RequirementList

FlattenRequirements returns all requirements for an action and its children.

func (Action) IsValid Uses

func (a Action) IsValid() error

IsValid returns error if the action is not valid.

func (Action) IsValidDefault Uses

func (a Action) IsValidDefault() error

IsValidDefault returns default action validity.

func (*Action) Parameter Uses

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

Parameter add given parameter to Action

func (*Action) Requirement Uses

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

Requirement add given requirement to Action

func (*Action) Scan Uses

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

Scan action.

func (Action) ToSummary Uses

func (a Action) ToSummary() ActionSummary

ToSummary returns an ActionSummary from an Action

func (Action) ToUniqueChildrenIDs Uses

func (a Action) ToUniqueChildrenIDs() []int64

ToUniqueChildrenIDs returns distinct children ids for given action.

func (Action) Value Uses

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

Value returns driver.Value from action.

type ActionSummary Uses

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 Uses

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

ActionUsages for action.

type Application Uses

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 Uses

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

GetKey return a key by name

func (Application) GetSSHKey Uses

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

GetSSHKey return a key by name

func (Application) IsValid Uses

func (app Application) IsValid() error

IsValid returns error if the application is not valid.

func (Application) PGPKeys Uses

func (app Application) PGPKeys() []ApplicationKey

PGPKeys returns the slice of pgp key for an application

func (Application) SSHKeys Uses

func (app Application) SSHKeys() []ApplicationKey

SSHKeys returns the slice of ssh key for an application

type ApplicationKey Uses

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 Uses

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

ApplicationOverview represents the overview of an application

type ApplicationOverviewGraph Uses

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

ApplicationOverviewGraph represents data pushed by CDS for metrics

type ApplicationTemplate Uses

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

ApplicationTemplate struct.

func (*ApplicationTemplate) IsValid Uses

func (a *ApplicationTemplate) IsValid() error

IsValid returns application template validity.

type ApplicationTemplates Uses

type ApplicationTemplates []ApplicationTemplate

ApplicationTemplates struct.

func (*ApplicationTemplates) Scan Uses

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

Scan application templates.

func (ApplicationTemplates) Value Uses

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

Value returns driver.Value from workflow template applications.

type ApplicationVariable Uses

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 Uses

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 Uses

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

ArtifactsStore represents

type AsCodeEvent Uses

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 Uses

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

func (*AsCodeEventData) Scan Uses

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

Scan consumer data.

func (AsCodeEventData) Value Uses

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

Value returns driver.Value from consumer data.

type AsCodeEventDataValue Uses

type AsCodeEventDataValue map[int64]string

type Audit Uses

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

Audit represents audit interface.

type AuditAction Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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"`
    IssuedAt           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"`
    // aggregates
    AuthentifiedUser *AuthentifiedUser `json:"user,omitempty" db:"-"`
    Groups           Groups            `json:"groups,omitempty" db:"-"`
    Service          *Service          `json:"-" db:"-"`
    Worker           *Worker           `json:"-" db:"-"`
}

AuthConsumer issues session linked to an authentified user.

func (AuthConsumer) Admin Uses

func (c AuthConsumer) Admin() bool

func (AuthConsumer) GetEmail Uses

func (c AuthConsumer) GetEmail() string

func (AuthConsumer) GetFullname Uses

func (c AuthConsumer) GetFullname() string

func (AuthConsumer) GetGroupIDs Uses

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 Uses

func (c AuthConsumer) GetUsername() string

func (AuthConsumer) IsValid Uses

func (c AuthConsumer) IsValid(scopeDetails AuthConsumerScopeDetails) error

IsValid returns validity for auth consumer.

func (AuthConsumer) Maintainer Uses

func (c AuthConsumer) Maintainer() bool

type AuthConsumerCreateResponse Uses

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

AuthConsumerCreateResponse response for a auth consumer creation.

type AuthConsumerData Uses

type AuthConsumerData map[string]string

AuthConsumerData contains specific information from the auth driver.

func (*AuthConsumerData) Scan Uses

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

Scan consumer data.

func (AuthConsumerData) Value Uses

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

Value returns driver.Value from consumer data.

type AuthConsumerRegenRequest Uses

type AuthConsumerRegenRequest struct {
    RevokeSessions bool `json:"revoke_sessions"`
}

AuthConsumerRegenRequest struct.

type AuthConsumerScope Uses

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 Uses

func (s AuthConsumerScope) IsValid() bool

IsValid returns validity for scope.

type AuthConsumerScopeDetail Uses

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

AuthConsumerScopeDetail contains all endpoints for a scope.

type AuthConsumerScopeDetails Uses

type AuthConsumerScopeDetails []AuthConsumerScopeDetail

AuthConsumerScopeDetails type used for database json storage.

func NewAuthConsumerScopeDetails Uses

func NewAuthConsumerScopeDetails(scopes ...AuthConsumerScope) AuthConsumerScopeDetails

func (AuthConsumerScopeDetails) IsValid Uses

func (s AuthConsumerScopeDetails) IsValid() error

IsValid returns an error if current details are invalids.

func (*AuthConsumerScopeDetails) Scan Uses

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

Scan scope detail slice.

func (AuthConsumerScopeDetails) ToEndpointsMap Uses

func (s AuthConsumerScopeDetails) ToEndpointsMap() map[AuthConsumerScope]AuthConsumerScopeEndpoints

func (AuthConsumerScopeDetails) Value Uses

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

Value returns driver.Value from scope detail slice.

type AuthConsumerScopeEndpoint Uses

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

type AuthConsumerScopeEndpoints Uses

type AuthConsumerScopeEndpoints []AuthConsumerScopeEndpoint

func (AuthConsumerScopeEndpoints) FindEndpoint Uses

func (e AuthConsumerScopeEndpoints) FindEndpoint(route string) (bool, AuthConsumerScopeEndpoint)

type AuthConsumerScopeSlice Uses

type AuthConsumerScopeSlice []AuthConsumerScope

AuthConsumerScopeSlice type used for database json storage.

func (*AuthConsumerScopeSlice) Scan Uses

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

Scan scope slice.

func (AuthConsumerScopeSlice) Value Uses

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

Value returns driver.Value from scope slice.

type AuthConsumerSigninRequest Uses

type AuthConsumerSigninRequest map[string]string

AuthConsumerSigninRequest struct for auth consumer signin request.

type AuthConsumerSigninResponse Uses

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 Uses

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"
    ConsumerTest         AuthConsumerType = "futurama"
    ConsumerTest2        AuthConsumerType = "planet-express"
)

Consumer types.

func (AuthConsumerType) IsValid Uses

func (t AuthConsumerType) IsValid() bool

IsValid returns validity of given auth consumer type.

func (AuthConsumerType) IsValidExternal Uses

func (t AuthConsumerType) IsValidExternal() bool

IsValidExternal returns validity of given auth consumer type.

type AuthConsumerWarning Uses

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 Uses

func NewConsumerWarningGroupInvalid(groupID int64, groupName string) AuthConsumerWarning

NewConsumerWarningGroupInvalid returns a new warning for given group info.

func NewConsumerWarningGroupRemoved Uses

func NewConsumerWarningGroupRemoved(groupID int64, groupName string) AuthConsumerWarning

NewConsumerWarningGroupRemoved returns a new warning for given group info.

func NewConsumerWarningLastGroupRemoved Uses

func NewConsumerWarningLastGroupRemoved() AuthConsumerWarning

NewConsumerWarningLastGroupRemoved returns a new warning.

type AuthConsumerWarningType Uses

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 Uses

type AuthConsumerWarnings []AuthConsumerWarning

AuthConsumerWarnings contains specific information from the auth driver.

func (*AuthConsumerWarnings) Scan Uses

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

Scan consumer data.

func (AuthConsumerWarnings) Value Uses

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

Value returns driver.Value from consumer warnings.

type AuthConsumers Uses

type AuthConsumers []AuthConsumer

AuthConsumers gives functions for auth consumer slice.

type AuthCurrentConsumerResponse Uses

type AuthCurrentConsumerResponse struct {
    Consumer AuthConsumer `json:"consumer"`
    Session  AuthSession  `json:"session"`
}

AuthCurrentConsumerResponse describe the current consumer and the current session

type AuthDriver Uses

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

AuthDriver interface.

type AuthDriverManifest Uses

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

AuthDriverManifest struct describe a auth driver.

type AuthDriverManifests Uses

type AuthDriverManifests []AuthDriverManifest

AuthDriverManifests gives functions on driver manifest slice.

func (AuthDriverManifests) ExistsConsumerType Uses

func (a AuthDriverManifests) ExistsConsumerType(consumerType AuthConsumerType) bool

ExistsConsumerType returns if a driver exists for given consumer type.

func (AuthDriverManifests) FindByConsumerType Uses

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

FindByConsumerType returns a manifest for given consumer type if exists.

type AuthDriverResponse Uses

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 Uses

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

type AuthDriverUserInfo Uses

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

AuthDriverUserInfo struct discribed a user returns by a auth driver.

type AuthDriverWithRedirect Uses

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

type AuthDriverWithSigninStateToken Uses

type AuthDriverWithSigninStateToken interface {
    AuthDriver
    CheckSigninStateToken(AuthConsumerSigninRequest) error
}

type AuthSession Uses

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:"-"`
}

AuthSession struct.

type AuthSessionJWTClaims Uses

type AuthSessionJWTClaims struct {
    ID  string
    jwt.StandardClaims
}

AuthSessionJWTClaims is the specific claims format for JWT session.

type AuthSessions Uses

type AuthSessions []AuthSession

AuthSessions gives functions for auth session slice.

type AuthSigninConsumerToken Uses

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 Uses

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:"-"`
}

AuthentifiedUser struct contains all information about a cds user.

func (AuthentifiedUser) GetEmail Uses

func (u AuthentifiedUser) GetEmail() string

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

func (AuthentifiedUser) GetFullname Uses

func (u AuthentifiedUser) GetFullname() string

func (AuthentifiedUser) GetGroupIDs Uses

func (u AuthentifiedUser) GetGroupIDs() []int64

GetGroupIDs returns groups ids for user

func (AuthentifiedUser) GetUsername Uses

func (u AuthentifiedUser) GetUsername() string

func (AuthentifiedUser) IsValid Uses

func (u AuthentifiedUser) IsValid() error

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

func (*AuthentifiedUser) Scan Uses

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

Scan workflow template request.

func (AuthentifiedUser) Value Uses

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

Value returns driver.Value from workflow template request.

type AuthentifiedUsers Uses

type AuthentifiedUsers []AuthentifiedUser

AuthentifiedUsers provides func for authentified user list.

func (AuthentifiedUsers) IDs Uses

func (a AuthentifiedUsers) IDs() []string

func (AuthentifiedUsers) ToMapByID Uses

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

ToMapByID returns a map of authentified users indexed by ids.

type Author Uses

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 Uses

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

Scan author.

func (Author) Value Uses

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

Value returns driver.Value from author.

type BitbucketServerActor Uses

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 Uses

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

type BitbucketServerChange Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

type BitbucketServerPullRequest Uses

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"`
    Links        struct {
        Self []struct {
            Href string `json:"href"`
        } `json:"self"`
    }   `json:"links"`
}

type BitbucketServerRef Uses

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

type BitbucketServerRepository Uses

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 Uses

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 Bookmark Uses

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 Uses

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 Uses

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 BuildState Uses

type BuildState struct {
    Stages   []Stage `json:"stages,omitempty"`
    Logs     []Log   `json:"logs,omitempty"`
    StepLogs Log     `json:"step_logs,omitempty"`
    Status   string  `json:"status,omitempty"`
}

BuildState define struct returned when looking for build state informations

type Cache Uses

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 Uses

func (c *Cache) GetName() string

GetName returns the name the artifact

func (*Cache) GetPath Uses

func (c *Cache) GetPath() string

GetPath returns the path of the artifact

type CanonicalFormUsage Uses

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

type CanonicalFormUsageResume Uses

type CanonicalFormUsageResume map[string][]CanonicalFormUsage

type CanonicalService Uses

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 Uses

type CheckFunc func(string) bool

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

type ConfigUser Uses

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

ConfigUser struct.

type DatabaseMigrationStatus Uses

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"`
}

DatabaseMigrationStatus represents on migration script status

type DefaultValues Uses

type DefaultValues struct {
    DefaultGroupName string
}

DefaultValues contains default user values for init DB

type DownloadableResource Uses

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 Uses

func AllDownloadableResources() []DownloadableResource

func AllDownloadableResourcesWithAvailability Uses

func AllDownloadableResourcesWithAvailability(directoriesDownload string) []DownloadableResource

AllDownloadableResourcesWithAvailability set flag Available on downloads list

type EncryptFunc Uses

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

EncryptFunc is a common type

type EntitiesPermissions Uses

type EntitiesPermissions map[string]Permissions

func (EntitiesPermissions) Level Uses

func (e EntitiesPermissions) Level(s string) int

func (EntitiesPermissions) Permissions Uses

func (e EntitiesPermissions) Permissions(s string) Permissions

type Environment Uses

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

Environment represent a deployment environment

func NewEnvironment Uses

func NewEnvironment(name string) *Environment

NewEnvironment instantiate a new Environment

func (Environment) GetKey Uses

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

GetKey return a key by name

func (Environment) GetSSHKey Uses

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

GetSSHKey return a key by name

func (Environment) PGPKeys Uses

func (e Environment) PGPKeys() []EnvironmentKey

PGPKeys returns the slice of pgp key for an environment

func (Environment) SSHKeys Uses

func (e Environment) SSHKeys() []EnvironmentKey

SSHKeys returns the slice of ssh key for an environment

func (*Environment) UnmarshalJSON Uses

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

UnmarshalJSON custom for last modified.

type EnvironmentKey Uses

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 Uses

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

EnvironmentTemplate struct.

func (*EnvironmentTemplate) IsValid Uses

func (e *EnvironmentTemplate) IsValid() error

IsValid returns environment template validity.

type EnvironmentTemplates Uses

type EnvironmentTemplates []EnvironmentTemplate

EnvironmentTemplates struct.

func (*EnvironmentTemplates) Scan Uses

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

Scan environment templates.

func (EnvironmentTemplates) Value Uses

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

Value returns driver.Value from workflow template applications.

type EnvironmentVariable Uses

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 Uses

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 Uses

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 Uses

func ExtractHTTPError(source error, al string) Error

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

func (Error) Error Uses

func (e Error) Error() string

func (Error) Translate Uses

func (e Error) Translate(al string) string

type Event Uses

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 Uses

type EventActionAdd struct {
    Action Action
}

EventActionAdd represents the event when adding an action.

type EventActionUpdate Uses

type EventActionUpdate struct {
    OldAction Action
    NewAction Action
}

EventActionUpdate represents the event when updating an action.

type EventApplicationAdd Uses

type EventApplicationAdd struct {
    Application
}

EventApplicationAdd represents the event when adding an application

type EventApplicationDelete Uses

type EventApplicationDelete struct {
}

EventApplicationDelete represents the event when deleting an application

type EventApplicationKeyAdd Uses

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

EventApplicationKeyAdd represents the event when adding an application key

type EventApplicationKeyDelete Uses

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

EventApplicationKeyDelete represents the event when deleting an application key

type EventApplicationPermissionAdd Uses

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

EventApplicationPermissionAdd represents the event when adding an application permission

type EventApplicationPermissionDelete Uses

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

EventApplicationPermissionDelete represents the event when deleting an application permission

type EventApplicationPermissionUpdate Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

EventApplicationVariableAdd represents the event when adding an application variable

type EventApplicationVariableDelete Uses

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

EventApplicationVariableDelete represents the event when deleting an application variable

type EventApplicationVariableUpdate Uses

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

EventApplicationVariableUpdate represents the event when updating an application variable

type EventApplicationVulnerabilityUpdate Uses

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

EventApplicationVulnerabilityUpdate represents the event when updating a vulnerability

type EventAsCodeEvent Uses

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

EventAsCodeEvent represents the event when add/update a workflow event

type EventBroadcastAdd Uses

type EventBroadcastAdd struct {
    Broadcast
}

EventBroadcastAdd represents the event when adding a broadcast

type EventBroadcastDelete Uses

type EventBroadcastDelete struct {
    BroadcastID int64
}

EventBroadcastDelete represents the event when deleting a broadcast

type EventBroadcastUpdate Uses

type EventBroadcastUpdate struct {
    OldBroadcast Broadcast
    NewBroadcast Broadcast
}

EventBroadcastUpdate represents the event when updating a broadcast

type EventEngine Uses

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

EventEngine contains event data for engine

type EventEnvironmentAdd Uses

type EventEnvironmentAdd struct {
    Environment
}

EventEnvironmentAdd represents the event when adding an environment

type EventEnvironmentDelete Uses

type EventEnvironmentDelete struct {
}

EventEnvironmentDelete represents the event when deleting an environment

type EventEnvironmentKeyAdd Uses

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

EventEnvironmentKeyAdd represents the event when adding an environment key

type EventEnvironmentKeyDelete Uses

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

EventEnvironmentKeyDelete represents the event when deleting an environment key

type EventEnvironmentPermissionAdd Uses

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

EventEnvironmentPermissionAdd represents the event when adding an environment permission

type EventEnvironmentPermissionDelete Uses

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

EventEnvironmentPermissionDelete represents the event when deleting an environment permission

type EventEnvironmentPermissionUpdate Uses

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 Uses

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

EventEnvironmentUpdate represents the event when updating an environment

type EventEnvironmentVariableAdd Uses

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

EventEnvironmentVariableAdd represents the event when adding an environment variable

type EventEnvironmentVariableDelete Uses

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

EventEnvironmentVariableDelete represents the event when deleting an environment variable

type EventEnvironmentVariableUpdate Uses

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

EventEnvironmentVariableUpdate represents the event when updating an environment variable

type EventFilter Uses

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

EventFilter represents filters when getting events

type EventMaintenance Uses

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

EventMaintenance contains event data for maintenance event

type EventNotif Uses

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 Uses

type EventOperation struct {
    Operation
}

type EventPipelineAdd Uses

type EventPipelineAdd struct {
    Pipeline
}

EventPipelineAdd represents the event when adding a pipeline

type EventPipelineDelete Uses

type EventPipelineDelete struct {
}

EventPipelineDelete represents the event when deleting a pipeline

type EventPipelineJobAdd Uses

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 Uses

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 Uses

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 Uses

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

EventPipelineParameterAdd represents the event when adding a pipeline parameter

type EventPipelineParameterDelete Uses

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

EventPipelineParameterDelete represents the event when deleting a pipeline parameter

type EventPipelineParameterUpdate Uses

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

EventPipelineParameterUpdate represents the event when updating a pipeline parameter

type EventPipelinePermissionAdd Uses

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

EventPipelinePermissionAdd represents the event when adding a pipeline permission

type EventPipelinePermissionDelete Uses

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

EventPipelinePermissionDelete represents the event when deleting a pipeline permission

type EventPipelinePermissionUpdate Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

EventPipelineUpdate represents the event when updating a pipeline

type EventProjectAdd Uses

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 Uses

type EventProjectDelete struct {
}

EventProjectDelete represents the event when deleting a project

type EventProjectIntegrationAdd Uses

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

EventProjectIntegrationAdd represents the event when adding a project integration

type EventProjectIntegrationDelete Uses

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

EventProjectIntegrationDelete represents the event when deleting a project integration

type EventProjectIntegrationUpdate Uses

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

EventProjectIntegrationUpdate represents the event when updating a project integration

type EventProjectKeyAdd Uses

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

EventProjectKeyAdd represents the event when adding a project key

type EventProjectKeyDelete Uses

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

EventProjectKeyDelete represents the event when deleting a project key

type EventProjectPermissionAdd Uses

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

EventProjectPermissionAdd represents the event when adding a project permission

type EventProjectPermissionDelete Uses

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

EventProjectPermissionDelete represents the event when deleting a project permission

type EventProjectPermissionUpdate Uses

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 Uses

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 Uses

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

EventProjectVCSServerAdd represents the event when adding a project vcs server

type EventProjectVCSServerDelete Uses

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

EventProjectVCSServerDelete represents the event when deleting a project vcs server

type EventProjectVariableAdd Uses

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

EventProjectVariableAdd represents the event when adding a project variable

type EventProjectVariableDelete Uses

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

EventProjectVariableDelete represents the event when deleting a project variable

type EventProjectVariableUpdate Uses

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

EventProjectVariableUpdate represents the event when updating a project variable

type EventRunWorkflow Uses

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"`
}

EventRunWorkflow contains event data for a workflow run

type EventRunWorkflowJob Uses

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 Uses

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 Uses

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 Uses

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 Uses

type EventWarningAdd struct {
    Warning
}

EventWarningAdd represents the event when adding a warning

type EventWarningDelete Uses

type EventWarningDelete struct {
    Type    string
    Element string
}

EventWarningDelete represents the event when deleting a warning

type EventWarningUpdate Uses

type EventWarningUpdate struct {
    Warning
}

EventWarningUpdate represents the event when updating a warning

type EventWorkflowAdd Uses

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

EventWorkflowAdd represents the event when adding a workflow

type EventWorkflowDelete Uses

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

EventWorkflowDelete represents the event when deleting a workflow

type EventWorkflowPermissionAdd Uses

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

EventWorkflowPermissionAdd represents the event when adding a workflow permission

type EventWorkflowPermissionDelete Uses

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

EventWorkflowPermissionDelete represents the event when deleting a workflow permission

type EventWorkflowPermissionUpdate Uses

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 Uses

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

EventWorkflowTemplateAdd represents the event when adding a workflow template.

type EventWorkflowTemplateInstanceAdd Uses

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

EventWorkflowTemplateInstanceAdd represents the event when adding a workflow template instance.

type EventWorkflowTemplateInstanceUpdate Uses

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 Uses

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 Uses

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

EventWorkflowUpdate represents the event when updating a workflow

type ExecutedJob Uses

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 Uses

func (j ExecutedJob) ToSummary() ExecutedJobSummary

ToSummary transforms an ExecutedJob to an ExecutedJobSummary

type ExecutedJobSummary Uses

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 Uses

type Expiration int

Expiration defines how worker key should expire

type Favorite Uses

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 Uses

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 GRPCPlugin Uses

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           []GRPCPluginBinary `json:"binaries" yaml:"binaries" cli:"-" db:"-"`
    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 Uses

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

GetBinary returns the binary for a specific os and arch

type GRPCPluginBinary Uses

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 Uses

func (b GRPCPluginBinary) GetName() string

GetName is a part of the objectstore.Object interface implementation

func (GRPCPluginBinary) GetPath Uses

func (b GRPCPluginBinary) GetPath() string

GetPath is a part of the objectstore.Object interface implementation

type GerritChangeEvent Uses

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 Uses

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

GerritEventExecution contains specific data for a gerrit event execution

type Group Uses

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:"-"`
}

Group represent a group of user.

func (Group) IsAdmin Uses

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 Uses

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

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

func (Group) IsValid Uses

func (g Group) IsValid() error

IsValid returns an error if given group is not valid.

type GroupMember Uses

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"`
}

GroupMember struct.

type GroupMembers Uses

type GroupMembers []GroupMember

func (GroupMembers) UserIDs Uses

func (members GroupMembers) UserIDs() []string

type GroupPermission Uses

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

GroupPermission represent a group and his role in the project

func (GroupPermission) IsValid Uses

func (g GroupPermission) IsValid() error

IsValid returns an error if group permission is not valid.

type Groups Uses

type Groups []Group

Groups type provides useful func on group list.

func (Groups) HasOneOf Uses

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

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

func (Groups) ToIDs Uses

func (g Groups) ToIDs() []int64

ToIDs returns ids for groups.

func (Groups) ToMap Uses

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

ToMap returns a map of groups by ids.

type IDName Uses

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 Uses

type IDNames []IDName

func (IDNames) IDs Uses

func (idNames IDNames) IDs() []int64

func (IDNames) Names Uses

func (idNames IDNames) Names() []string

type Identifiable Uses

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

type Int64Slice Uses

type Int64Slice []int64

Int64Slice type used for database json storage.

func (*Int64Slice) Contains Uses

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

Contains return true if given value is in the slice.

func (*Int64Slice) Remove Uses

func (s *Int64Slice) Remove(v int64)

Remove all occurrences of given value from the slice.

func (*Int64Slice) Scan Uses

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

Scan int64 slice.

func (Int64Slice) Value Uses

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

Value returns driver.Value from int64 slice.

type IntegrationConfig Uses

type IntegrationConfig map[string]IntegrationConfigValue

IntegrationConfig represent the configuration of an integration

func (IntegrationConfig) Blur Uses

func (config IntegrationConfig) Blur()

func (IntegrationConfig) Clone Uses

func (config IntegrationConfig) Clone() IntegrationConfig

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

func (IntegrationConfig) DecryptSecrets Uses

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

DecryptSecrets decrypt secrets given a cypher func

func (IntegrationConfig) EncryptSecrets Uses

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

EncryptSecrets encrypt secrets given a cypher func

func (*IntegrationConfig) HideSecrets Uses

func (config *IntegrationConfig) HideSecrets()

HideSecrets replaces password with a placeholder

func (IntegrationConfig) MergeWith Uses

func (config IntegrationConfig) MergeWith(cfg IntegrationConfig)

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

func (*IntegrationConfig) Scan Uses

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

Scan IntegrationConfig.

func (IntegrationConfig) Value Uses

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

Value returns driver.Value from IntegrationConfig.

type IntegrationConfigMap Uses

type IntegrationConfigMap map[string]IntegrationConfig

func (IntegrationConfigMap) Blur Uses

func (config IntegrationConfigMap) Blur()

func (IntegrationConfigMap) Clone Uses

func (config IntegrationConfigMap) Clone() IntegrationConfigMap

func (*IntegrationConfigMap) Scan Uses

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

Scan IntegrationConfig.

func (IntegrationConfigMap) Value Uses

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

Value returns driver.Value from IntegrationConfig.

type IntegrationConfigValue Uses

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

IntegrationConfigValue represent a configuration value for a integration

type IntegrationModel Uses

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"`
    DeploymentDefaultConfig IntegrationConfig    `json:"deployment_default_config" db:"deployment_default_config" yaml:"deployment_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"`
    Public                  bool                 `json:"public,omitempty" db:"public" yaml:"public,omitempty"`
}

IntegrationModel represent a integration model with its default configuration

func (*IntegrationModel) Blur Uses

func (p *IntegrationModel) Blur()

func (IntegrationModel) IsBuiltin Uses

func (p IntegrationModel) IsBuiltin() bool

IsBuiltin checks is the model is builtin or not

type IntegrationType Uses

type IntegrationType string

IntegrationType represents all different type of integrations

type Job Uses

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 Uses

func (j Job) IsValid() error

IsValid returns job's validity.

type KafkaTaskExecution Uses

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

KafkaTaskExecution contains specific data for a kafka hook

type Key Uses

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 Uses

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

Those are types if key managed in CDS

func (KeyType) String Uses

func (k KeyType) String() string

type Label Uses

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 Uses

func (label *Label) IsValid() error

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

type Labels Uses

type Labels []Label

Labels slice.

func (Labels) IsValid Uses

func (l Labels) IsValid() error

IsValid returns an error if a label is not valid.

type LastModification Uses

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 Log Uses

type Log struct {
    ID           int64      `json:"id,omitempty" db:"id"`
    JobID        int64      `json:"workflow_node_run_job_id,omitempty" db:"workflow_node_run_job_id"`
    NodeRunID    int64      `json:"workflow_node_run_id,omitempty" db:"workflow_node_run_id"`
    Start        *time.Time `json:"start,omitempty" db:"start"`
    LastModified *time.Time `json:"lastModified,omitempty" db:"last_modified"`
    Done         *time.Time `json:"done,omitempty" db:"done"`
    StepOrder    int64      `json:"stepOrder,omitempty" db:"step_order"`
    Val          string     `json:"val,omitempty" db:"value"`
}

func NewLog Uses

func NewLog(JobID, NodeRunID int64, value string, stepOrder int) *Log

NewLog returns a log struct

type Message Uses

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

Message represent a struc format translated messages

func ErrorToMessage Uses

func ErrorToMessage(err error) (Message, bool)

ErrorToMessage returns message from an error if possible

func NewMessage Uses

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

NewMessage instanciantes a new message

func (*Message) String Uses

func (m *Message) String(al string) string

String returns formated string for the specified language

type Metadata Uses

type Metadata map[string]string

Metadata represents metadata

func (*Metadata) Scan Uses

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

Scan Metadata.

func (Metadata) Value Uses

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

Value returns driver.Value from Metadata.

type Metric Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (m Model) IsValid() error

IsValid returns error if the model is not valid.

func (Model) IsValidType Uses

func (m Model) IsValidType() error

func (Model) Path Uses

func (m Model) Path() string

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

func (*Model) Update Uses

func (m *Model) Update(data Model)

Update workflow template field from new data.

type ModelCmds Uses

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 Uses

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

Scan model cmds.

func (ModelCmds) Value Uses

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

Value returns driver.Value from model cmds.

type ModelDocker Uses

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 Uses

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

Scan model docker.

func (ModelDocker) Value Uses

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

Value returns driver.Value from model docker.

type ModelPattern Uses

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 Uses

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"`
}

ModelVirtualMachine for openstack or vsphere.

func (*ModelVirtualMachine) Scan Uses

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

Scan model virtual machine.

func (ModelVirtualMachine) Value Uses

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

Value returns driver.Value from model virtual machine.

type Models Uses

type Models []Model

type MonDBMigrate Uses

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 Uses

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

MonitoringStatus contains status of CDS Component

func (MonitoringStatus) HTTPStatusCode Uses

func (m MonitoringStatus) HTTPStatusCode() int

HTTPStatusCode return the http status code

func (*MonitoringStatus) Scan Uses

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

Scan workflow template request.

func (MonitoringStatus) Value Uses

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

Value returns driver.Value from workflow template request.

type MonitoringStatusLine Uses

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"`
}

MonitoringStatusLine represents a CDS Component Status

func (MonitoringStatusLine) String Uses

func (m MonitoringStatusLine) String() string

type MultiError Uses

type MultiError []error

MultiError is just an array of error

func (*MultiError) Append Uses

func (e *MultiError) Append(err error)

Append appends an error to a MultiError

func (*MultiError) Error Uses

func (e *MultiError) Error() string

func (*MultiError) IsEmpty Uses

func (e *MultiError) IsEmpty() bool

IsEmpty return true if MultiError is empty, false otherwise

func (*MultiError) Join Uses

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 Uses

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 Uses

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 Uses

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

func (Node) CheckApplicationDeploymentStrategies Uses

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

CheckApplicationDeploymentStrategies checks application deployment strategies

func (*Node) FilterHooksConfig Uses

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

FilterHooksConfig filter all hooks configuration and remove somme configuration key

func (Node) GetHook Uses

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

func (*Node) IsLinkedToRepo Uses

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 Uses

func (n *Node) Sort()

Sort sorts the workflow node

func (*Node) VisitNode Uses

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 Uses

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:"-" db:"-"`
    ApplicationID             int64                  `json:"application_id" db:"application_id"`
    ApplicationName           string                 `json:"-" db:"-"`
    EnvironmentID             int64                  `json:"environment_id" db:"environment_id"`
    EnvironmentName           string                 `json:"-" db:"-"`
    ProjectIntegrationID      int64                  `json:"project_integration_id" db:"project_integration_id"`
    ProjectIntegrationName    string                 `json:"-" 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 Uses

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

func (*NodeContext) HasDefaultPayload Uses

func (c *NodeContext) HasDefaultPayload() bool

type NodeHook Uses

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 Uses

func (h NodeHook) ConfigValueContainsEventsDefault() bool

func (NodeHook) Equals Uses

func (h NodeHook) Equals(h1 NodeHook) bool

Equals checks functional equality between two hooks

func (NodeHook) GetConfigValue Uses

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

func (NodeHook) IsRepositoryWebHook Uses

func (h NodeHook) IsRepositoryWebHook() bool

func (NodeHook) Ref Uses

func (h NodeHook) Ref() string

type NodeJoin Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func ToOperationError(err error) *OperationError

func (*OperationError) ToError Uses

func (opError *OperationError) ToError() error

type OperationLoadFiles Uses

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 Uses

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 Uses

type OperationRepo struct {
    Basedir            string
    URL                string
    RepositoryStrategy RepositoryStrategy
}

OperationRepo is an operation

func (OperationRepo) ID Uses

func (r OperationRepo) ID() string

ID returns a generated ID for a Operation

type OperationRepositoryInfo Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

func EnvironmentVariablesToParameters Uses

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

func NewStringParameter Uses

func NewStringParameter(s string) (Parameter, error)

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

func ParameterFind Uses

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

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

func ParametersFromMap Uses

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

ParametersFromMap returns an array of parameters from a map

func ParametersMerge Uses

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

ParametersMerge merges two slices of parameters

func ProjectVariablesToParameters Uses

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

func VariablesToParameters Uses

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

func (Parameter) IsValid Uses

func (p Parameter) IsValid() error

IsValid returns error if the parameter is not valid.

type Permissions Uses

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

func (Permissions) IsMaxLevel Uses

func (p Permissions) IsMaxLevel() bool

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

func (Permissions) Level Uses

func (p Permissions) Level() int

type Pipeline Uses

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 Uses

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 Uses

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 Uses

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

PipelineBuildWarning Struct for display warnings about build

type PipelineTemplate Uses

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

PipelineTemplate struct.

func (*PipelineTemplate) IsValid Uses

func (p *PipelineTemplate) IsValid() error

IsValid returns pipeline template validity.

type PipelineTemplates Uses

type PipelineTemplates []PipelineTemplate

PipelineTemplates struct.

func (*PipelineTemplates) Scan Uses

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

Scan pipeline templates.

func (PipelineTemplates) Value Uses

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

Value returns driver.Value from workflow template pipelines.

type Prerequisite Uses

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

Prerequisite defines a expected value to one triggering pipeline parameter

type Project Uses

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    []GroupPermission      `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:"-"`
}

Project represent a team with group of users and pipelines

func (Project) GetIntegration Uses

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

GetIntegration returns the ProjectIntegration given a name

func (Project) GetIntegrationByID Uses

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

GetIntegrationByID returns the ProjectIntegration given a name

func (Project) GetSSHKey Uses

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

GetSSHKey returns a ssh key given his name

func (Project) IsValid Uses

func (proj Project) IsValid() error

IsValid returns error if the project is not valid.

func (Project) PGPKeys Uses

func (proj Project) PGPKeys() []ProjectKey

PGPKeys returns the slice of pgp key for a project

func (Project) SSHKeys Uses

func (proj Project) SSHKeys() []ProjectKey

SSHKeys returns the slice of ssh key for an application

func (*Project) SetApplication Uses

func (proj *Project) SetApplication(app Application)

SetApplication data on project

func (*Project) SetEnvironment Uses

func (proj *Project) SetEnvironment(env Environment)

SetEnvironment data on project

func (*Project) SetPipeline Uses

func (proj *Project) SetPipeline(pip Pipeline)

SetPipeline data on project

type ProjectFilter Uses

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

ProjectFilter represents filter on a project

type ProjectGroup Uses

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

ProjectGroup represent a link with a project

type ProjectIntegration Uses

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 Uses

func (pf *ProjectIntegration) Blur()

Blur replaces password with a placeholder

type ProjectKey Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

func (*ProjectVCSServerLink) Set Uses

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

type ProjectVCSServerLinkData Uses

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 Uses

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 Uses

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 Uses

type Projects []Project

func (Projects) Keys Uses

func (projects Projects) Keys() []string

type PurgeTags Uses

type PurgeTags []string

func (*PurgeTags) Scan Uses

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

Scan PurgeTags.

func (PurgeTags) Value Uses

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

Value returns driver.Value from PurgeTags.

type RabbitMQTaskExecution Uses

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

RabbitMQTaskExecution contains specific data for a kafka hook

type Repository Uses

type Repository struct {
    URL  string
    Hook bool
}

Repository structs contains all needed information about a single repository

type RepositoryEvents Uses

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 Uses

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 RepositoryStrategy Uses

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 Uses

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 Uses

type RequirementList []Requirement

RequirementList is a list of requirement

func RequirementListDeduplicate Uses

func RequirementListDeduplicate(l RequirementList) RequirementList

RequirementListDeduplicate returns requirements list without duplicate values.

func (RequirementList) IsValid Uses

func (l RequirementList) IsValid() error

IsValid returns requirement list validity.

func (RequirementList) Values Uses

func (l RequirementList) Values() []string

Values returns all Requirement.Value

type Result Uses

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 Uses

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

ScheduledTaskExecution contains specific data for a scheduled task execution

type SchemaResponse Uses

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 Service Uses

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

Service is a µService registered on CDS API.

func (*Service) Update Uses

func (s *Service) Update(data Service)

Update service field from new data.

type ServiceConfig Uses

type ServiceConfig map[string]interface{}

func (*ServiceConfig) Scan Uses

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

Scan workflow template request.

func (ServiceConfig) Value Uses

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

Value returns driver.Value from workflow template request.

type ServiceConfiguration Uses

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 ServiceLog Uses

type ServiceLog struct {
    ID                     int64      `json:"id,omitempty" db:"id"`
    WorkflowNodeJobRunID   int64      `json:"workflow_node_run_job_id" db:"workflow_node_run_job_id"`
    WorkflowNodeRunID      int64      `json:"workflow_node_run_id" db:"workflow_node_run_id"`
    Start                  *time.Time `json:"start" db:"start"`
    LastModified           *time.Time `json:"last_modified" db:"last_modified"`
    ServiceRequirementID   int64      `json:"requirement_id" db:"-"`
    ServiceRequirementName string     `json:"requirement_service_name" db:"requirement_service_name"`
    Val                    string     `json:"val,omitempty" db:"value"`
    WorkerName             string     `json:"worker_name" db:"-"`
}

type SpawnErrorForm Uses

type SpawnErrorForm struct {
    Error string
    Logs  []byte
}

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

type SpawnInfo Uses

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 Uses

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 (SpawnMsg) DefaultUserMessage Uses

func (s SpawnMsg) DefaultUserMessage() string

type Stage Uses

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  int64                  `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 Uses

func NewStage(name string) *Stage

NewStage instantiate a new Stage

func (*Stage) PlainConditions Uses

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

Conditions returns stage prerequisites as a set of WorkflowTriggerCondition regex

func (Stage) ToSummary Uses

func (s Stage) ToSummary() StageSummary

ToSummary transforms a Stage into a StageSummary

type StageSummary Uses

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 Uses

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 Uses

func (staticfile StaticFiles) Equal(currStaticfile StaticFiles) bool

Equal returns true if StaticFiles are equal to another one

func (*StaticFiles) GetName Uses

func (staticfile *StaticFiles) GetName() string

GetName returns the name the artifact

func (*StaticFiles) GetPath Uses

func (staticfile *StaticFiles) GetPath() string

GetPath returns the path of the artifact

type StepStatus Uses

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 Uses

func (ss StepStatus) ToSummary() StepStatusSummary

ToSummary transform a StepStatus into a StepStatusSummary

type StepStatusSummary Uses

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 Uses

type StringSlice []string

StringSlice type used for database json storage.

func (StringSlice) Contains Uses

func (s StringSlice) Contains(value string) bool

func (*StringSlice) Scan Uses

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

Scan string slice.

func (StringSlice) Value Uses

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

Value returns driver.Value from string slice.

type TCPServer Uses

type TCPServer struct {
    Addr string `toml:"addr" default:"" commented:"true" comment:"Listen address without port, example: 127.0.0.1" json:"addr"`
    Port int    `toml:"port" default:"8089" json:"port"`
}

type TarOptions Uses

type TarOptions struct {
    TrimDirName string
}

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

type Task Uses

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 Uses

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 Uses

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 Uses

func (t TemplateParameterType) IsValid() bool

IsValid returns parameter type validity.

type TimelineFilter Uses

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

TimelineFilter represents a user filter for the cds timeline

type Token Uses

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 Uses

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

type Usage Uses

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 Uses

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 Uses

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 Uses

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 Uses

type UserContacts []UserContact

func (UserContacts) Filter Uses

func (u UserContacts) Filter(t string) UserContacts

func (UserContacts) Find Uses

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

func (UserContacts) Primary Uses

func (u UserContacts) Primary() *UserContact

type UserLoginRequest Uses

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

UserLoginRequest login request

type UserNotification Uses

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 Uses

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 Uses

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

Scan UserNotificationSettings.

func (UserNotificationSettings) Value Uses

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

Value returns driver.Value from Metadata.

type UserNotificationTemplate Uses

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 Uses

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 Uses

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

type UserResponse Uses

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

type UserTimelineFilter Uses

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

UserTimelineFilter represents user_timeline table

type VCSAuthor Uses

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 Uses

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

type VCSAuthorizedClientCommon Uses

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

    //Branches
    Branches(context.Context, string) ([]VCSBranch, error)
    Branch(ctx context.Context, repo string, branch string) (*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 int) (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.ReadCloser) 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 Uses

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

type VCSBranch Uses

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 Uses

func GetDefaultBranch(branches []VCSBranch) VCSBranch

GetDefaultBranch return the default branch

type VCSCommit Uses

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 Uses

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 Uses

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 Uses

type VCSCreateEvent VCSPushEvent

VCSCreateEvent represents a push events for polling

type VCSDeleteEvent Uses

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

VCSDeleteEvent represents a push events for polling

type VCSHook Uses

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 Uses

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"`
}

VCSPullRequest represents a pull request

type VCSPullRequestCommentRequest Uses

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

type VCSPullRequestEvent Uses

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 Uses

type VCSPullRequestOptions struct {
    State VCSPullRequestState
}

type VCSPullRequestState Uses

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

func (VCSPullRequestState) IsValid Uses

func (s VCSPullRequestState) IsValid() bool

type VCSPushEvent Uses

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 Uses

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

VCSRelease represents data about release on github, etc..

type VCSRemote Uses

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

VCSRemote represents remotes known by the repositories manager

type VCSRepo Uses

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 Uses

type VCSRequestModifier func(r *http.Request)

func VCSRequestModifierWithState Uses

func VCSRequestModifierWithState(state VCSPullRequestState) VCSRequestModifier

type VCSServer Uses

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 Uses

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

type VCSServerService Uses

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

type VCSTag Uses

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 Uses

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 Uses

func FromAplicationVariables(appVars []ApplicationVariable) []Variable

func FromEnvironmentVariables Uses

func FromEnvironmentVariables(envVars []EnvironmentVariable) []Variable

func FromProjectVariables Uses

func FromProjectVariables(appVars []ProjectVariable) []Variable

func VariableFind Uses

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

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

func VariablesFilter Uses

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

VariablesFilter return a slice of variables filtered by type

func VariablesPrefix Uses

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

VariablesPrefix add a prefix on all the variable in the slice

func (*Variable) ToApplicationVariable Uses

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

func (Variable) ToParameter Uses

func (v Variable) ToParameter(prefix string) Parameter

type VariableAudit Uses

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 Uses

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 Uses

func VersionCurrent() Version

VersionCurrent returns the current version

type Vulnerability Uses

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 Uses

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

VulnerabilityWorkerReport represent a vulnerability report

type Warning Uses

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 Uses

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

type WebHookExecution Uses

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 Uses

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

type WebsocketFilter Uses

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 Uses

func (f WebsocketFilter) IsValid() error

IsValid return an error if given filter is not valid.

func (WebsocketFilter) Key Uses

func (f WebsocketFilter) Key() string

Key generates the unique key associated to given filter.

type WebsocketFilterType Uses

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"
)

func (WebsocketFilterType) IsValid Uses

func (f WebsocketFilterType) IsValid() bool

type WebsocketFilters Uses

type WebsocketFilters []WebsocketFilter

type Worker Uses

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:"-" cli:"-" db:"cypher_private_key" gorpmapping:"encrypted,ID,Name,JobRunID"`
}

Worker represents instances of CDS workers living to serve.

type WorkerArgs Uses

type WorkerArgs struct {
    API             string `json:"api"`
    Token           string `json:"token"`
    Name            string `json:"name"`
    BaseDir         string `json:"base_dir"`
    HTTPInsecure    bool   `json:"http_insecure"`
    Model           string `json:"model"`
    HatcheryName    string `json:"hatchery_name"`
    WorkflowJobID   int64  `json:"workflow_job_id"`
    TTL             int    `json:"ttl"`
    FromWorkerImage bool   `json:"from_worker_image"`
    //Graylog params
    GraylogHost       string `json:"graylog_host"`
    GraylogPort       int    `json:"graylog_port"`
    GraylogExtraKey   string `json:"graylog_extra_key"`
    GraylogExtraValue string `json:"graylog_extra_value"`
    WorkerBinary      string
}

WorkerArgs is all the args needed to run a worker

type WorkerModelSecret Uses

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 Uses

type WorkerModelSecrets []WorkerModelSecret

func (WorkerModelSecrets) ToMap Uses

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

type WorkerRegistrationForm Uses

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

WorkerRegistrationForm represents the arguments needed to register a worker

type Workflow Uses

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                  []GroupPermission            `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:"-"`
    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:"-"`
    Favorite                bool                         `json:"favorite" db:"-" cli:"favorite"`
    WorkflowData            WorkflowData                 `json:"workflow_data" db:"workflow_data" cli:"-"`
    EventIntegrations       []ProjectIntegration         `json:"event_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:"-"`
}

Workflow represents a pipeline based workflow

func (*Workflow) AddTrigger Uses

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 Uses

func (w *Workflow) AssignEmptyType()

AssignEmptyType fill node type field

func (*Workflow) FilterHooksConfig Uses

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

FilterHooksConfig filter all hooks configuration and remove some configuration key

func (*Workflow) GetApplication Uses

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

GetApplication retrieve application from workflow

func (*Workflow) GetRepositories Uses

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

GetRepositories returns the list of repositories from applications

func (*Workflow) InitMaps Uses

func (w *Workflow) InitMaps()

func (*Workflow) Normalize Uses

func (w *Workflow) Normalize()

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

func (*Workflow) ResetIDs Uses

func (w *Workflow) ResetIDs()

ResetIDs resets all nodes and joins ids

func (*Workflow) SortNode Uses

func (w *Workflow) SortNode()

Sort sorts the workflow

func (*Workflow) ValidateType Uses

func (w *Workflow) ValidateType() error

ValidateType check if nodes have a correct nodeType

func (*Workflow) VisitNode Uses

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

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

type WorkflowData Uses

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

func (*WorkflowData) AncestorsNames Uses

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

func (*WorkflowData) Array Uses

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

func (*WorkflowData) GetHooks Uses

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

GetHooks returns the list of all hooks in the workflow tree

func (*WorkflowData) GetHooksMapRef Uses

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

GetHooksMapRef returns the list of all hooks in the workflow tree

func (*WorkflowData) Maps Uses

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

func (*WorkflowData) NodeByID Uses

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

func (*WorkflowData) NodeByName Uses

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

func (*WorkflowData) NodeByRef Uses

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

func (*WorkflowData) Scan Uses

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

Scan WorkflowData.

func (WorkflowData) Value Uses

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

Value returns driver.Value from WorkflowData.

type WorkflowGroup Uses

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

WorkflowGroup represents the permission to a workflow

type WorkflowHookModel Uses

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 Uses

func GetBuiltinHookModelByName(name string) *WorkflowHookModel

GetBuiltinHookModelByName retrieve the hook model

func GetBuiltinOutgoingHookModelByName Uses

func GetBuiltinOutgoingHookModelByName(name string) *WorkflowHookModel

GetBuiltinOutgoingHookModelByName retrieve the outgoing hook model

func GetDefaultHookModel Uses

func GetDefaultHookModel(modelName string) WorkflowHookModel

GetDefaultHookModel return the workflow hook model by its name

type WorkflowName Uses

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:&