Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteDisabledWorker(ctx context.Context, store cache.Store, db *gorp.DbMap, workerID string, ...) error
- func DeleteDisabledWorkers(ctx context.Context, store cache.Store, DBFunc func() *gorp.DbMap)
- func DisableDeadWorker(ctx context.Context, store cache.Store, db *gorp.DbMap, workerID string, ...) error
- func DisableWorker(ctx context.Context, db *gorp.DbMap, store cache.Store, workerID string, ...) error
- func DisabledDeadWorkers(ctx context.Context, store cache.Store, DBFunc func() *gorp.DbMap)
- func FormString(r *http.Request, s string) string
- func InitRouterMetrics(ctx context.Context, s service.NamedService) error
- func Lint[T sdk.Lintable](api *API, o T) []error
- func LoadWorkflowHooksWithModelUpdate(ctx context.Context, db gorp.SqlExecutor, ...) ([]sdk.V2WorkflowHook, error)
- func LoadWorkflowHooksWithRepositoryWebHooks(ctx context.Context, db gorp.SqlExecutor, ...) ([]sdk.V2WorkflowHook, error)
- func LoadWorkflowHooksWithWorkflowUpdate(ctx context.Context, db gorp.SqlExecutor, ...) ([]sdk.V2WorkflowHook, error)
- func MaintenanceAware() service.HandlerConfigParam
- func NewEventJobSummary(wr sdk.WorkflowRun, noderun sdk.WorkflowNodeRun, jobrun sdk.WorkflowNodeJobRun) sdk.EventJobSummary
- func QueryBool(r *http.Request, s string) bool
- func QuerySort(r *http.Request) (map[string]SortOrder, error)
- func QueryString(r *http.Request, s string) string
- func QueryStrings(r *http.Request, key string) ([]string, error)
- func ReadEntityFile[T sdk.Lintable](api *API, directory, fileName string, content []byte, out *[]T, t string, ...) ([]sdk.EntityWithObject, []error)
- func SetTracker(resp http.ResponseWriter, k log.Field, v interface{})
- func SortCompareInt(i, j int, o SortOrder) bool
- func TracingMiddlewareFunc(s service.Service, db gorp.SqlExecutor, store cache.Store) service.Middleware
- type API
- func (a *API) ApplyConfiguration(config interface{}) error
- func (api *API) CancelAbandonnedRunResults(ctx context.Context)
- func (a *API) CheckConfiguration(config interface{}) error
- func (api *API) EnqueueWorkflowRun(ctx context.Context, runID string, userID string, workflowName string, ...)
- func (*API) Init(i interface{}) (cdsclient.ServiceConfig, error)
- func (api *API) InitRouter()
- func (api *API) ReEnqueueScheduledJobs(ctx context.Context)
- func (a *API) Serve(ctx context.Context) error
- func (*API) Service() sdk.Service
- func (a *API) SetCookie(w http.ResponseWriter, name, value string, expires time.Time, httpOnly bool)
- func (a *API) SetCookieSession(w http.ResponseWriter, name, value string)
- func (api *API) Status(ctx context.Context) *sdk.MonitoringStatus
- func (api *API) StopDeadJobs(ctx context.Context)
- func (api *API) TriggerBlockedWorkflowRuns(ctx context.Context)
- func (a *API) UnsetCookie(w http.ResponseWriter, name string, httpOnly bool)
- func (api *API) V2WorkflowRunCraft(ctx context.Context, tick time.Duration)
- func (api *API) V2WorkflowRunEngineChan(ctx context.Context)
- func (api *API) V2WorkflowRunEngineDequeue(ctx context.Context)
- func (api *API) WorkflowRunCraft(ctx context.Context, tick time.Duration)
- func (api *API) WorkflowRunJobDeletion(ctx context.Context, tick time.Duration, limit int)
- func (api *API) WorkflowSendEvent(ctx context.Context, proj sdk.Project, report *workflow.ProcessorReport)
- func (api *API) WorkflowTemplateBulk(ctx context.Context, tick time.Duration, ...)
- func (api *API) WorkflowTemplateBulkOperation(ctx context.Context, chanOperation chan WorkflowTemplateBulkOperation)
- type ArtifactSignature
- type CheckWorkflowPermissionsOpts
- type Configuration
- type DefaultValues
- type EntitiesCleaner
- type GPGKey
- type HandlerConfigFunc
- type HandlerScope
- type PermCheckFunc
- type RBACLoader
- type Router
- func (r *Router) DELETE(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) DELETEv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) GET(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) GETv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) GetRoute(method string, handler service.HandlerFunc, vars map[string]string) string
- func (r *Router) GetRouteV2(method string, handler service.HandlerFuncV2, vars map[string]string) string
- func (r *Router) Handle(uri string, scope HandlerScope, handlers ...*service.HandlerConfig)
- func (r *Router) HandlePrefix(uri string, scope HandlerScope, handlers ...*service.HandlerConfig)
- func (r *Router) NotFoundHandler(w http.ResponseWriter, req *http.Request)
- func (r *Router) POST(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) POSTEXECUTE(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) POSTv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) PUT(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) PUTv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
- func (r *Router) StatusPanic() sdk.MonitoringStatusLine
- type SortOrder
- type StartupConfig
- type StartupConfigConsumer
- type StartupConfigConsumerType
- type WorkflowRunEntityFinder
- type WorkflowTemplateBulkOperation
- type WorkflowTemplateBulkOperations
Constants ¶
const (
JobRunHatcheryTakeKey = "workflow:jobrun:hatchery:take"
)
Variables ¶
var ( Errors *stats.Int64Measure Hits *stats.Int64Measure WebSocketClients *stats.Int64Measure WebSocketHatcheryClients *stats.Int64Measure WebSocketEvents *stats.Int64Measure ServerRequestCount *stats.Int64Measure ServerRequestBytes *stats.Int64Measure ServerResponseBytes *stats.Int64Measure ServerLatency *stats.Float64Measure )
var DEPRECATED = func(rc *service.HandlerConfig) { rc.IsDeprecated = true }
DEPRECATED marks the handler as deprecated
var (
ScopeNone = func() HandlerScope { return nil }
)
Functions ¶
func DeleteDisabledWorker ¶ added in v0.53.1
func DeleteDisabledWorkers ¶ added in v0.53.1
func DisableDeadWorker ¶ added in v0.53.1
func DisableWorker ¶
func DisableWorker(ctx context.Context, db *gorp.DbMap, store cache.Store, workerID string, maxLogSize int64) error
DisableWorker disable a worker
func DisabledDeadWorkers ¶ added in v0.53.1
func InitRouterMetrics ¶
func InitRouterMetrics(ctx context.Context, s service.NamedService) error
InitRouterMetrics initialize prometheus metrics
func LoadWorkflowHooksWithModelUpdate ¶ added in v0.53.1
func LoadWorkflowHooksWithModelUpdate(ctx context.Context, db gorp.SqlExecutor, hookRequest sdk.HookListWorkflowRequest) ([]sdk.V2WorkflowHook, error)
LoadWorkflowHooksWithModelUpdate hookRequest contains all updated model from analysis
func LoadWorkflowHooksWithRepositoryWebHooks ¶ added in v0.53.1
func LoadWorkflowHooksWithRepositoryWebHooks(ctx context.Context, db gorp.SqlExecutor, hookRequest sdk.HookListWorkflowRequest) ([]sdk.V2WorkflowHook, error)
LoadWorkflowHooksWithRepositoryWebHooks If event && workflow declaration are on the same repo : get only the hook defined on the current branch Else get all ( analyse process insert only 1 hook for the default branch
func LoadWorkflowHooksWithWorkflowUpdate ¶ added in v0.53.1
func LoadWorkflowHooksWithWorkflowUpdate(ctx context.Context, db gorp.SqlExecutor, hookRequest sdk.HookListWorkflowRequest) ([]sdk.V2WorkflowHook, error)
LoadWorkflowHooksWithWorkflowUpdate hookRequest contains all updated workflow from analysis
func MaintenanceAware ¶
func MaintenanceAware() service.HandlerConfigParam
MaintenanceAware route need CDS maintenance off
func NewEventJobSummary ¶ added in v0.52.0
func NewEventJobSummary(wr sdk.WorkflowRun, noderun sdk.WorkflowNodeRun, jobrun sdk.WorkflowNodeJobRun) sdk.EventJobSummary
func QuerySort ¶
QuerySort returns the a of key found in sort query param or nil if sort param not found.
func QueryString ¶
QueryString return a string from a query parameter
func QueryStrings ¶
QueryStrings returns the list of values for given query param key or nil if key no values.
func ReadEntityFile ¶ added in v0.53.1
func SetTracker ¶
func SetTracker(resp http.ResponseWriter, k log.Field, v interface{})
func SortCompareInt ¶
SortCompareInt returns the result of the right compare equation depending of given sort order.
func TracingMiddlewareFunc ¶
func TracingMiddlewareFunc(s service.Service, db gorp.SqlExecutor, store cache.Store) service.Middleware
Types ¶
type API ¶
type API struct { service.Common Router *Router Config Configuration DBConnectionFactory *database.DBConnectionFactory StartupTime time.Time Maintenance bool WSBroker *websocket.Broker WSServer *websocketServer WSHatcheryBroker *websocket.Broker WSHatcheryServer *websocketHatcheryServer Cache cache.Store Metrics struct { WorkflowRunFailed *stats.Int64Measure WorkflowRunStarted *stats.Int64Measure Sessions *stats.Int64Measure WorkflowRunsMarkToDelete *stats.Int64Measure WorkflowRunsDeleted *stats.Int64Measure DatabaseConns *stats.Int64Measure RunResultToSynchronized *stats.Int64Measure RunResultSynchronized *stats.Int64Measure RunResultSynchronizedError *stats.Int64Measure // contains filtered or unexported fields } AuthenticationDrivers map[sdk.AuthConsumerType]sdk.AuthDriver LinkDrivers map[sdk.AuthConsumerType]link.LinkDriver WorkerModelDockerImageWhiteList []regexp.Regexp // contains filtered or unexported fields }
API is a struct containing the configuration, the router, the database connection factory and so on
func (*API) ApplyConfiguration ¶
ApplyConfiguration apply an object of type api.Configuration after checking it
func (*API) CancelAbandonnedRunResults ¶ added in v0.53.1
func (*API) CheckConfiguration ¶
CheckConfiguration checks the validity of the configuration object
func (*API) EnqueueWorkflowRun ¶ added in v0.53.0
func (*API) InitRouter ¶
func (api *API) InitRouter()
InitRouter initializes the router and all the routes
func (*API) ReEnqueueScheduledJobs ¶ added in v0.53.0
func (*API) SetCookie ¶
func (a *API) SetCookie(w http.ResponseWriter, name, value string, expires time.Time, httpOnly bool)
SetCookie on given response writter, automatically add domain and path based on api config.
func (*API) SetCookieSession ¶
func (a *API) SetCookieSession(w http.ResponseWriter, name, value string)
SetCookieSession on given response writter, automatically add domain and path based on api config. This will returns a cookie with no expiration date that should be dropped by browser when closed.
func (*API) Status ¶
func (api *API) Status(ctx context.Context) *sdk.MonitoringStatus
Status returns status, implements interface service.Service
func (*API) StopDeadJobs ¶ added in v0.53.0
func (*API) TriggerBlockedWorkflowRuns ¶ added in v0.53.1
func (*API) UnsetCookie ¶
func (a *API) UnsetCookie(w http.ResponseWriter, name string, httpOnly bool)
UnsetCookie on given response writter, automatically add domain and path based on api config.
func (*API) V2WorkflowRunCraft ¶ added in v0.53.0
func (*API) V2WorkflowRunEngineChan ¶ added in v0.53.0
func (*API) V2WorkflowRunEngineDequeue ¶ added in v0.53.0
func (*API) WorkflowRunCraft ¶
func (*API) WorkflowRunJobDeletion ¶ added in v0.53.1
func (*API) WorkflowSendEvent ¶
func (api *API) WorkflowSendEvent(ctx context.Context, proj sdk.Project, report *workflow.ProcessorReport)
WorkflowSendEvent Send event on workflow run
func (*API) WorkflowTemplateBulk ¶ added in v0.53.0
func (*API) WorkflowTemplateBulkOperation ¶ added in v0.53.0
func (api *API) WorkflowTemplateBulkOperation(ctx context.Context, chanOperation chan WorkflowTemplateBulkOperation)
type ArtifactSignature ¶ added in v0.53.1
type CheckWorkflowPermissionsOpts ¶ added in v0.52.0
type Configuration ¶
type Configuration struct { Name string `toml:"name" comment:"Name of this CDS API Service\n Enter a name to enable this service" json:"name"` URL struct { API string `toml:"api" default:"http://localhost:8081" json:"api"` UI string `toml:"ui" default:"http://localhost:8080" json:"ui"` } `toml:"url" comment:"#####################\n CDS URLs Settings \n####################" json:"url"` HTTP service.HTTPRouterConfiguration `toml:"http" json:"http"` Secrets struct { SkipProjectSecretsOnRegion []string `` /* 167-byte string literal not displayed */ SnapshotRetentionDelay int64 `` /* 255-byte string literal not displayed */ SnapshotCleanInterval int64 `` /* 128-byte string literal not displayed */ SnapshotCleanBatchSize int64 `toml:"snapshotCleanBatchSize" json:"snapshotCleanBatchSize" comment:"Batch size for secret snapshot clean, default: 100"` } `toml:"secrets" json:"secrets"` Database database.DBConfiguration `` /* 139-byte string literal not displayed */ Cache struct { TTL int `toml:"ttl" default:"60" json:"ttl"` Redis struct { Host string `` /* 192-byte string literal not displayed */ Password string `toml:"password" json:"-"` DbIndex int `toml:"dbindex" default:"0" json:"dbindex"` } `` /* 134-byte string literal not displayed */ } `toml:"cache" comment:"######################\n CDS Cache Settings \n#####################" json:"cache"` Download struct { Directory string `` /* 256-byte string literal not displayed */ SupportedOSArch []string `` /* 271-byte string literal not displayed */ DownloadFromGitHub bool `toml:"downloadFromGitHub" default:"true" json:"downloadFromGitHub" comment:"allow downloading binaries from GitHub"` Artifactory struct { URL string `toml:"url" default:"https://your-artifactory/artifactory" json:"url" comment:"URL of your artifactory" commented:"true"` Path string `` /* 177-byte string literal not displayed */ Repository string `toml:"repository" default:"artifactoryRepository" json:"repository" comment:"artifactory repository"` Token string `toml:"token" default:"artifactoryToken" json:"-" comment:"token used to get binaries"` } `toml:"artifactory" default:"true" json:"artifactory" comment:"Artifactory Configuration (optional)." commented:"true"` } `toml:"download" json:"download"` InternalServiceMesh struct { RequestSecondsTimeout int `toml:"requestSecondsTimeout" json:"requestSecondsTimeout" default:"60"` InsecureSkipVerifyTLS bool `toml:"insecureSkipVerifyTLS" json:"insecureSkipVerifyTLS" default:"false"` } `toml:"internalServiceMesh" json:"internalServiceMesh"` Auth struct { TokenDefaultDuration int64 `toml:"tokenDefaultDuration" default:"30" comment:"The default duration of a token (in days)" json:"tokenDefaultDuration"` TokenOverlapDefaultDuration string `` /* 144-byte string literal not displayed */ DefaultGroup string `` /* 141-byte string literal not displayed */ DisableAddUserInDefaultGroup bool `` /* 157-byte string literal not displayed */ RSAPrivateKey string `` /* 148-byte string literal not displayed */ RSAPrivateKeys []authentication.KeyConfig `` /* 176-byte string literal not displayed */ AllowedOrganizations sdk.StringSlice `` /* 156-byte string literal not displayed */ LDAP struct { SigninEnabled bool `toml:"signinEnabled" default:"false" json:"SigninEnabled"` } `toml:"ldap" json:"ldap"` Local struct { SignupAllowedDomains string `` /* 196-byte string literal not displayed */ SignupDisabled bool `toml:"signupDisabled" default:"false" json:"signupDisabled"` SigninEnabled bool `toml:"signinEnabled" default:"true" json:"SigninEnabled"` Organization string `` /* 129-byte string literal not displayed */ } `toml:"local" json:"local"` CorporateSSO struct { SigninEnabled bool `toml:"signinEnabled" default:"false" json:"SigninEnabled"` } `json:"corporate_sso" toml:"corporateSSO"` Github struct { SigninEnabled bool `toml:"signinEnabled" default:"false" json:"SigninEnabled"` Organization string `` /* 130-byte string literal not displayed */ } `` /* 168-byte string literal not displayed */ Gitlab struct { SigninEnabled bool `toml:"signinEnabled" default:"false" json:"SigninEnabled"` Organization string `` /* 130-byte string literal not displayed */ } `` /* 168-byte string literal not displayed */ OIDC struct { SigninEnabled bool `toml:"signinEnabled" default:"false" json:"signinEnabled"` Organization string `` /* 130-byte string literal not displayed */ } `` /* 159-byte string literal not displayed */ } `` /* 127-byte string literal not displayed */ Drivers struct { LDAP struct { Host string `toml:"host" json:"host"` Port int `toml:"port" default:"636" json:"port"` SSL bool `toml:"ssl" default:"true" json:"ssl"` RootDN string `toml:"rootDN" default:"dc=myorganization,dc=com" json:"rootDN"` UserSearchBase string `toml:"userSearchBase" default:"ou=people" json:"userSearchBase"` UserSearch string `toml:"userSearch" default:"uid={0}" json:"userSearch"` UserFullname string `toml:"userFullname" default:"{{.givenName}} {{.sn}}" json:"userFullname"` ManagerDN string `` /* 136-byte string literal not displayed */ ManagerPassword string `toml:"managerPassword" default:"SECRET_PASSWORD_MANAGER" comment:"Define it if ldapsearch need to be authenticated" json:"-"` } `toml:"ldap" json:"ldap"` CorporateSSO struct { MFASupportEnabled bool `json:"mfa_support_enabled" default:"false" toml:"mfaSupportEnabled"` RedirectMethod string `json:"redirect_method" toml:"redirectMethod"` RedirectURL string `json:"redirect_url" toml:"redirectURL"` Keys struct { RequestSigningKey string `json:"-" toml:"requestSigningKey"` TokenSigningKey string `json:"-" toml:"tokenSigningKey"` TokenKeySigningKey struct { KeySigningKey string `json:"public_signing_key" toml:"keySigningKey"` SigningKeyClaim string `json:"signing_key_claim" toml:"signingKeyClaim"` } `json:"-" toml:"tokenKeySigningKey"` } `json:"-" toml:"keys"` } `json:"corporate_sso" toml:"corporateSSO"` Github struct { URL string `toml:"url" json:"url" default:"https://github.com" comment:"GitHub URL"` APIURL string `toml:"apiUrl" json:"apiUrl" default:"https://api.github.com" comment:"GitHub API URL"` ClientID string `toml:"clientId" json:"-" comment:"GitHub OAuth Client ID"` ClientSecret string `toml:"clientSecret" json:"-" comment:"GitHub OAuth Client Secret"` } `` /* 168-byte string literal not displayed */ Gitlab struct { URL string `toml:"url" json:"url" default:"https://gitlab.com" comment:"GitLab URL"` ApplicationID string `toml:"applicationID" json:"-" comment:"GitLab OAuth Application ID"` Secret string `toml:"secret" json:"-" comment:"GitLab OAuth Application Secret"` } `` /* 168-byte string literal not displayed */ OIDC struct { URL string `toml:"url" json:"url" default:"" comment:"Open ID connect config URL"` ClientID string `toml:"clientId" json:"-" comment:"OIDC Client ID"` ClientSecret string `toml:"clientSecret" json:"-" comment:"OIDC Client Secret"` } `` /* 159-byte string literal not displayed */ } `` /* 133-byte string literal not displayed */ Link struct { Github struct { Enabled bool `toml:"enabled" default:"false" json:"enabled"` } `toml:"github" json:"github" comment:"#######\n GithubLink allows you to link your github user to your cds user \n######"` } `toml:"link" comment:"##############################\n CDS Link Settings.# \n#############################" json:"link"` SMTP struct { Disable bool `` /* 154-byte string literal not displayed */ Host string `toml:"host" json:"host" comment:"smtp host"` Port string `toml:"port" json:"port" comment:"smtp port"` ModeTLS string `toml:"modeTLS" json:"modeTLS" default:"" comment:"possible values: empty, tls, starttls"` InsecureSkipVerifyTLS bool `` /* 130-byte string literal not displayed */ User string `toml:"user" json:"user" comment:"smtp username"` Password string `toml:"password" json:"-" comment:"smtp password"` From string `toml:"from" default:"no-reply@cds.local" json:"from" comment:"smtp from"` } `toml:"smtp" comment:"#####################\n# CDS SMTP Settings \n####################" json:"smtp"` Artifact struct { Mode string `toml:"mode" default:"local" comment:"swift, awss3 or local" json:"mode"` Local struct { BaseDirectory string `toml:"baseDirectory" default:"/var/lib/cds-engine/artifacts" json:"baseDirectory"` } `toml:"local"` Openstack struct { URL string `toml:"url" comment:"Authentication Endpoint, generally value of $OS_AUTH_URL" json:"url"` Username string `toml:"username" comment:"Openstack Username, generally value of $OS_USERNAME" json:"username"` Password string `toml:"password" comment:"Openstack Password, generally value of $OS_PASSWORD" json:"-"` Tenant string `toml:"tenant" comment:"Openstack Tenant, generally value of $OS_TENANT_NAME, v2 auth only" json:"tenant"` Domain string `toml:"domain" comment:"Openstack Domain, generally value of $OS_DOMAIN_NAME, v3 auth only" json:"domain"` Region string `toml:"region" comment:"Region, generally value of $OS_REGION_NAME" json:"region"` ContainerPrefix string `toml:"containerPrefix" comment:"Use if your want to prefix containers for CDS Artifacts" json:"containerPrefix"` DisableTempURL bool `` /* 143-byte string literal not displayed */ } `toml:"openstack" json:"openstack"` AWSS3 struct { BucketName string `toml:"bucketName" json:"bucketName" comment:"Name of the S3 bucket to use when storing artifacts"` Region string `toml:"region" json:"region" default:"us-east-1" comment:"The AWS region"` Prefix string `` /* 135-byte string literal not displayed */ AuthFromEnvironment bool `` /* 146-byte string literal not displayed */ SharedCredsFile string `toml:"sharedCredsFile" json:"sharedCredsFile" comment:"The path for the AWS credential file, used with profile"` Profile string `toml:"profile" json:"profile" comment:"The profile within the AWS credentials file to use"` AccessKeyID string `toml:"accessKeyId" json:"accessKeyId" comment:"A static AWS Secret Key ID"` SecretAccessKey string `toml:"secretAccessKey" json:"-" comment:"A static AWS Secret Access Key"` SessionToken string `toml:"sessionToken" json:"-" comment:"A static AWS session token"` Endpoint string `toml:"endpoint" json:"endpoint" comment:"S3 API Endpoint (optional)" commented:"true"` //optional DisableSSL bool `toml:"disableSSL" json:"disableSSL" commented:"true"` //optional ForcePathStyle bool `toml:"forcePathStyle" json:"forcePathStyle" commented:"true"` //optional } `toml:"awss3" json:"awss3"` } `toml:"artifact" comment:"Either filesystem local storage or Openstack Swift Storage are supported" json:"artifact"` DefaultOS string `` /* 209-byte string literal not displayed */ DefaultArch string `` /* 196-byte string literal not displayed */ Log struct { StepMaxSize int64 `toml:"stepMaxSize" default:"15728640" comment:"Max step logs size in bytes (default: 15MB)" json:"stepMaxSize"` ServiceMaxSize int64 `toml:"serviceMaxSize" default:"15728640" comment:"Max service logs size in bytes (default: 15MB)" json:"serviceMaxSize"` } `toml:"log" json:"log" comment:"###########################\n Log settings.\n##########################"` Help struct { Content string `` /* 138-byte string literal not displayed */ Error string `` /* 158-byte string literal not displayed */ } `toml:"help" comment:"######################\n 'Help' informations \n######################" json:"help"` Workflow struct { MaxRuns int64 `toml:"maxRuns" comment:"Maximum of runs by workflow" json:"maxRuns" default:"255"` DefaultRetentionPolicy string `` /* 269-byte string literal not displayed */ DisablePurgeDeletion bool `` /* 177-byte string literal not displayed */ TemplateBulkRunnerCount int64 `` /* 160-byte string literal not displayed */ JobDefaultRegion string `` /* 133-byte string literal not displayed */ JobDefaultBookDelay int64 `` /* 132-byte string literal not displayed */ CustomServiceJobBookDelay map[string]int64 `` /* 154-byte string literal not displayed */ WorkerModelDockerImageWhiteList []string `` /* 146-byte string literal not displayed */ } `toml:"workflow" comment:"######################\n 'Workflow' global configuration \n######################" json:"workflow"` WorkflowV2 struct { JobSchedulingTimeout int64 `toml:"jobSchedulingTimeout" comment:"Timeout delay for job scheduling (in seconds)" json:"jobSchedulingTimeout" default:"600"` } `` /* 130-byte string literal not displayed */ Entity struct { Retention string `toml:"retention" comment:"Retention (in hours) of ascode entity for on non head commit" json:"retention" default:"24h"` } `toml:"entity" comment:"######################\n 'Entity' global configuration \n######################" json:"entity"` Project struct { CreationDisabled bool `` /* 140-byte string literal not displayed */ InfoCreationDisabled string `` /* 154-byte string literal not displayed */ VCSManagementDisabled bool `` /* 159-byte string literal not displayed */ GPGKeyEmailAddressTemplate string `` /* 197-byte string literal not displayed */ } `toml:"project" comment:"######################\n 'Project' global configuration \n######################" json:"project"` EventBus event.Config `` /* 133-byte string literal not displayed */ VCS struct { GPGKeys map[string][]GPGKey `toml:"gpgKeys" comment:"map of public gpg keys from vcs server" json:"gpgKeys"` } `toml:"vcs" json:"vcs"` }
Configuration is the configuration structure for CDS API
type DefaultValues ¶
type DefaultValues struct { ServerSecretsKey string // For LDAP Client LDAPBase string GivenName string SN string BindDN string BindPwd string }
DefaultValues is the struc for API Default configuration default values
type EntitiesCleaner ¶ added in v0.53.0
type EntitiesCleaner struct {
// contains filtered or unexported fields
}
type HandlerConfigFunc ¶
type HandlerConfigFunc func(service.Handler, ...service.HandlerConfigParam) *service.HandlerConfig
HandlerConfigFunc is a type used in the router configuration fonction "Handle"
type HandlerScope ¶
type HandlerScope []sdk.AuthConsumerScope
func Scopes ¶ added in v0.52.0
func Scopes(s ...sdk.AuthConsumerScope) HandlerScope
Scopes set for handler. One should match consumer scopes.
type PermCheckFunc ¶
type PermCheckFunc func(ctx context.Context, w http.ResponseWriter, key string, perm int, routeVars map[string]string) error
PermCheckFunc defines func call to check permission
type RBACLoader ¶ added in v0.53.0
type RBACLoader struct {
// contains filtered or unexported fields
}
func NewRBACLoader ¶ added in v0.53.0
func NewRBACLoader(db gorp.SqlExecutor) *RBACLoader
func (*RBACLoader) FillRBACWithIDs ¶ added in v0.53.0
func (*RBACLoader) FillRBACWithNames ¶ added in v0.53.0
type Router ¶
type Router struct { Background context.Context Mux *mux.Router SetHeaderFunc func() map[string]string Prefix string URL string Middlewares []service.Middleware DefaultAuthMiddleware service.Middleware PostAuthMiddlewares []service.Middleware PostMiddlewares []service.Middleware Config service.HTTPRouterConfiguration // contains filtered or unexported fields }
Router is a wrapper around mux.Router
func (*Router) DELETE ¶
func (r *Router) DELETE(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
DELETE will set given handler only for DELETE request
func (*Router) DELETEv2 ¶ added in v0.52.0
func (r *Router) DELETEv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
func (*Router) GET ¶
func (r *Router) GET(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
GET will set given handler only for GET request
func (*Router) GETv2 ¶ added in v0.52.0
func (r *Router) GETv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
func (*Router) GetRoute ¶
func (r *Router) GetRoute(method string, handler service.HandlerFunc, vars map[string]string) string
GetRoute returns the routes given a handler
func (*Router) GetRouteV2 ¶ added in v0.52.0
func (*Router) Handle ¶
func (r *Router) Handle(uri string, scope HandlerScope, handlers ...*service.HandlerConfig)
Handle adds all handler for their specific verb in gorilla router for given uri
func (*Router) HandlePrefix ¶
func (r *Router) HandlePrefix(uri string, scope HandlerScope, handlers ...*service.HandlerConfig)
func (*Router) NotFoundHandler ¶
func (r *Router) NotFoundHandler(w http.ResponseWriter, req *http.Request)
NotFoundHandler is called by default by Mux is any matching handler has been found
func (*Router) POST ¶
func (r *Router) POST(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
POST will set given handler only for POST request
func (*Router) POSTEXECUTE ¶
func (r *Router) POSTEXECUTE(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
POSTEXECUTE will set given handler only for POST request and add a flag for execution permission
func (*Router) POSTv2 ¶ added in v0.52.0
func (r *Router) POSTv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
func (*Router) PUT ¶
func (r *Router) PUT(h service.HandlerFunc, cfg ...service.HandlerConfigParam) *service.HandlerConfig
PUT will set given handler only for PUT request
func (*Router) PUTv2 ¶ added in v0.52.0
func (r *Router) PUTv2(h service.HandlerFuncV2, cfg ...service.HandlerConfigParam) *service.HandlerConfig
func (*Router) StatusPanic ¶
func (r *Router) StatusPanic() sdk.MonitoringStatusLine
StatusPanic returns router status. If nbPanic > 30 -> Alert, if nbPanic > 0 -> Warn
type StartupConfig ¶
type StartupConfig struct { Consumers []StartupConfigConsumer `json:"consumers"` IAT int64 `json:"iat"` }
type StartupConfigConsumer ¶
type StartupConfigConsumer struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Type StartupConfigConsumerType `json:"type"` }
type StartupConfigConsumerType ¶
type StartupConfigConsumerType string
const ( StartupConfigConsumerTypeUI StartupConfigConsumerType = "ui" StartupConfigConsumerTypeHatchery StartupConfigConsumerType = "hatchery" StartupConfigConsumerTypeHooks StartupConfigConsumerType = "hooks" StartupConfigConsumerTypeRepositories StartupConfigConsumerType = "repositories" StartupConfigConsumerTypeDBMigrate StartupConfigConsumerType = "db-migrate" StartupConfigConsumerTypeVCS StartupConfigConsumerType = "vcs" StartupConfigConsumerTypeCDN StartupConfigConsumerType = "cdn" StartupConfigConsumerTypeCDNStorageCDS StartupConfigConsumerType = "cdn-storage-cds" StartupConfigConsumerTypeElasticsearch StartupConfigConsumerType = "elasticsearch" )
type WorkflowRunEntityFinder ¶ added in v0.53.0
type WorkflowRunEntityFinder struct {
// contains filtered or unexported fields
}
type WorkflowTemplateBulkOperation ¶ added in v0.53.0
type WorkflowTemplateBulkOperation struct { BulkID int64 AuthConsumerID string WorkflowTemplateID int64 Operation sdk.WorkflowTemplateBulkOperation // contains filtered or unexported fields }
type WorkflowTemplateBulkOperations ¶ added in v0.53.0
type WorkflowTemplateBulkOperations []WorkflowTemplateBulkOperation
func (*WorkflowTemplateBulkOperations) Pop ¶ added in v0.53.0
func (o *WorkflowTemplateBulkOperations) Pop() WorkflowTemplateBulkOperation
func (*WorkflowTemplateBulkOperations) Push ¶ added in v0.53.0
func (o *WorkflowTemplateBulkOperations) Push(op WorkflowTemplateBulkOperation)
Source Files ¶
- action.go
- admin.go
- api.go
- api_helper.go
- api_routes.go
- application.go
- application_deployment.go
- application_export.go
- application_import.go
- application_key.go
- application_metric.go
- application_variable.go
- ascode.go
- audit.go
- auth.go
- auth_builtin.go
- auth_consumer.go
- auth_hatchery.go
- auth_local.go
- bookmark.go
- clean_worker.go
- config.go
- debug.go
- download.go
- environment.go
- environment_export.go
- environment_import.go
- environment_key.go
- environment_variable.go
- feature.go
- group.go
- grpc_plugin.go
- help.go
- hook.go
- integration.go
- link.go
- maintenance.go
- migration.go
- mon_db.go
- notification.go
- parameter.go
- pipeline.go
- pipeline_export.go
- pipeline_import.go
- pipeline_job.go
- pipeline_parameter.go
- project.go
- project_group.go
- project_integration.go
- project_integration_worker_hook.go
- project_key.go
- project_notif.go
- project_variable.go
- repositories_manager.go
- requirements.go
- router.go
- router_auth.go
- router_context.go
- router_metrics.go
- router_middleware.go
- router_middleware_auth.go
- router_middleware_auth_permission.go
- router_middleware_rbac.go
- router_middleware_tracing.go
- router_rbac_rule_global.go
- router_rbac_rule_hatchery.go
- router_rbac_rule_hooks.go
- router_rbac_rule_plugin.go
- router_rbac_rule_project.go
- router_rbac_rule_queue.go
- router_rbac_rule_region.go
- router_rbac_rule_user.go
- router_rbac_rule_worker.go
- router_rbac_rule_workermodel.go
- router_rbac_rule_workflow.go
- router_response_tracker.go
- router_util.go
- services.go
- stage.go
- status.go
- suggest.go
- templates.go
- timeline.go
- ui.go
- user.go
- user_bookmark.go
- user_contacts.go
- user_gpgkey.go
- user_groups.go
- user_link.go
- user_schema.go
- user_timeline.go
- v2_action.go
- v2_config.go
- v2_entities.go
- v2_hatchery.go
- v2_hatchery_ws.go
- v2_hooks.go
- v2_jsonschema.go
- v2_organization.go
- v2_plugin.go
- v2_project_clean_ascode.go
- v2_project_notification.go
- v2_project_repository.go
- v2_project_variable.go
- v2_project_variable_item.go
- v2_project_vcs.go
- v2_queue.go
- v2_queue_worker.go
- v2_rbac.go
- v2_rbac_check.go
- v2_region.go
- v2_repository_analyze.go
- v2_worker.go
- v2_worker_model.go
- v2_workflow_run.go
- v2_workflow_run_craft.go
- v2_workflow_run_engine.go
- v2_workflow_run_engine_context.go
- v2_workflow_run_job_routines.go
- websocket.go
- worker.go
- worker_model.go
- worker_model_export.go
- worker_model_hatchery.go
- worker_model_import.go
- worker_model_pattern.go
- workflow.go
- workflow_application.go
- workflow_ascode.go
- workflow_event.go
- workflow_export.go
- workflow_group.go
- workflow_hook.go
- workflow_import.go
- workflow_queue.go
- workflow_run.go
- workflow_run_artifact.go
- workflow_run_craft.go
- workflow_run_log.go
- workflow_run_secrets.go
- workflow_template_bulk.go
- workflow_trigger.go
- workflowv3.go
Directories ¶
Path | Synopsis |
---|---|
database
|
|
driver
|
|
mock_services
Package mock_services is a generated GoMock package.
|
Package mock_services is a generated GoMock package. |