Documentation ¶
Index ¶
- Constants
- Variables
- func NewNotificationsBus(listener *pq.Listener, conn Conn) *notificationsBus
- func NewPipelineDBFactory(sqldbConnection Conn, bus *notificationsBus, lockFactory lock.LockFactory) *pipelineDBFactory
- type BasicAuth
- type Build
- type BuildInput
- type BuildOutput
- type BuildPreparation
- type BuildPreparationStatus
- type ConfigVersion
- type Conn
- type DB
- type Dashboard
- type DashboardJob
- type EventSource
- type FirstLoggedBuildIDDecreasedError
- type GenericOAuth
- type GitHubAuth
- type GitHubTeam
- type Job
- type MetadataField
- type MissingInputReasons
- type NotificationsBus
- type Notifier
- type Page
- type Pagination
- type Pipe
- type Pipeline
- type PipelineDB
- type PipelineDBFactory
- type PipelinePausedState
- type PipelinesDB
- type Resource
- type ResourceCacheIdentifier
- type ResourceNotFoundError
- type ResourceTypeNotFoundError
- type SQLDB
- func (db *SQLDB) AcquireContainerCreatingLock(logger lager.Logger, containerID int) (lock.Lock, bool, error)
- func (db *SQLDB) AcquireVolumeCreatingLock(logger lager.Logger, volumeID int) (lock.Lock, bool, error)
- func (db *SQLDB) CreateDefaultTeamIfNotExists() error
- func (db *SQLDB) CreatePipe(pipeGUID string, url string, teamName string) error
- func (db *SQLDB) CreateTeam(team Team) (SavedTeam, error)
- func (db *SQLDB) DeleteBuildEventsByBuildIDs(buildIDs []int) error
- func (db *SQLDB) DeleteTeamByName(teamName string) error
- func (db *SQLDB) FindJobIDForBuild(buildID int) (int, bool, error)
- func (db *SQLDB) GetAllPipelines() ([]SavedPipeline, error)
- func (db *SQLDB) GetAllPublicPipelines() ([]SavedPipeline, error)
- func (db *SQLDB) GetAllStartedBuilds() ([]Build, error)
- func (db *SQLDB) GetBuildByID(buildID int) (Build, bool, error)
- func (db *SQLDB) GetPipe(pipeGUID string) (Pipe, error)
- func (db *SQLDB) GetPipelineByID(pipelineID int) (SavedPipeline, error)
- func (db *SQLDB) GetPublicBuilds(page Page) ([]Build, Pagination, error)
- func (db *SQLDB) GetTaskLock(logger lager.Logger, taskName string) (lock.Lock, bool, error)
- func (db *SQLDB) GetTeams() ([]SavedTeam, error)
- type SavedJob
- type SavedPipeline
- type SavedResource
- type SavedResourceType
- type SavedTeam
- type SavedVersionedResource
- type SavedVersionedResources
- type Status
- type Team
- type TeamDB
- type TeamDBFactory
- type Tx
- type UAAAuth
- type Version
- type VersionedResource
Constants ¶
View Source
const ( NoVerionsSatisfiedPassedConstraints string = "no versions satisfy passed constraints" NoVersionsAvailable string = "no versions available" )
Variables ¶
View Source
var ErrBuildEventStreamClosed = errors.New("build event stream closed")
View Source
var ErrConfigComparisonFailed = errors.New("comparison with existing config failed during save")
View Source
var ErrEndOfBuildEventStream = errors.New("end of build event stream")
View Source
var ErrMultipleContainersFound = errors.New("multiple containers found for given identifier")
Functions ¶
func NewNotificationsBus ¶
func NewPipelineDBFactory ¶
func NewPipelineDBFactory( sqldbConnection Conn, bus *notificationsBus, lockFactory lock.LockFactory, ) *pipelineDBFactory
Types ¶
type BasicAuth ¶
type BasicAuth struct { BasicAuthUsername string `json:"basic_auth_username"` BasicAuthPassword string `json:"basic_auth_password"` }
func (*BasicAuth) EncryptedJSON ¶
type Build ¶
type Build interface { ID() int Name() string JobID() int JobName() string PipelineID() int PipelineName() string TeamID() int TeamName() string Engine() string EngineMetadata() string Status() Status StartTime() time.Time EndTime() time.Time ReapTime() time.Time IsOneOff() bool IsScheduled() bool IsRunning() bool IsManuallyTriggered() bool Reload() (bool, error) Events(from uint) (EventSource, error) SaveEvent(event atc.Event) error GetVersionedResources() (SavedVersionedResources, error) GetResources() ([]BuildInput, []BuildOutput, error) Start(string, string) (bool, error) Finish(status Status) error MarkAsFailed(cause error) error Abort() error AbortNotifier() (Notifier, error) AcquireTrackingLock(logger lager.Logger, interval time.Duration) (lock.Lock, bool, error) GetPreparation() (BuildPreparation, bool, error) SaveEngineMetadata(engineMetadata string) error SaveInput(input BuildInput) (SavedVersionedResource, error) SaveOutput(vr VersionedResource, explicit bool) (SavedVersionedResource, error) SaveImageResourceVersion(planID atc.PlanID, identifier ResourceCacheIdentifier) error GetImageResourceCacheIdentifiers() ([]ResourceCacheIdentifier, error) GetConfig() (atc.Config, ConfigVersion, error) GetPipeline() (SavedPipeline, error) }
type BuildInput ¶
type BuildInput struct { Name string VersionedResource FirstOccurrence bool }
type BuildOutput ¶
type BuildOutput struct {
VersionedResource
}
type BuildPreparation ¶
type BuildPreparation struct { BuildID int PausedPipeline BuildPreparationStatus PausedJob BuildPreparationStatus MaxRunningBuilds BuildPreparationStatus Inputs map[string]BuildPreparationStatus InputsSatisfied BuildPreparationStatus MissingInputReasons MissingInputReasons }
type BuildPreparationStatus ¶
type BuildPreparationStatus string
const ( BuildPreparationStatusUnknown BuildPreparationStatus = "unknown" BuildPreparationStatusBlocking BuildPreparationStatus = "blocking" BuildPreparationStatusNotBlocking BuildPreparationStatus = "not_blocking" )
type ConfigVersion ¶
type ConfigVersion int
ConfigVersion is a sequence identifier used for compare-and-swap
type Conn ¶
type Conn interface { Begin() (Tx, error) Close() error Driver() driver.Driver Exec(query string, args ...interface{}) (sql.Result, error) Ping() error Prepare(query string) (*sql.Stmt, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row SetMaxIdleConns(n int) SetMaxOpenConns(n int) }
type DB ¶
type DB interface { GetTeams() ([]SavedTeam, error) CreateTeam(team Team) (SavedTeam, error) CreateDefaultTeamIfNotExists() error DeleteTeamByName(teamName string) error GetAllStartedBuilds() ([]Build, error) GetPublicBuilds(page Page) ([]Build, Pagination, error) FindJobIDForBuild(buildID int) (int, bool, error) CreatePipe(pipeGUID string, url string, teamName string) error GetPipe(pipeGUID string) (Pipe, error) GetTaskLock(logger lager.Logger, taskName string) (lock.Lock, bool, error) DeleteBuildEventsByBuildIDs(buildIDs []int) error }
type Dashboard ¶
type Dashboard []DashboardJob
type DashboardJob ¶
type FirstLoggedBuildIDDecreasedError ¶
func (FirstLoggedBuildIDDecreasedError) Error ¶
func (e FirstLoggedBuildIDDecreasedError) Error() string
type GenericOAuth ¶
type GenericOAuth struct { AuthURL string `json:"auth_url"` AuthURLParams map[string]string `json:"auth_url_params"` TokenURL string `json:"token_url"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` DisplayName string `json:"display_name"` Scope string `json:"scope"` }
type GitHubAuth ¶
type GitHubAuth struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` Organizations []string `json:"organizations"` Teams []GitHubTeam `json:"teams"` Users []string `json:"users"` AuthURL string `json:"auth_url"` TokenURL string `json:"token_url"` APIURL string `json:"api_url"` }
type GitHubTeam ¶
type MetadataField ¶
type MissingInputReasons ¶
func (MissingInputReasons) RegisterNoVersions ¶
func (mir MissingInputReasons) RegisterNoVersions(inputName string)
func (MissingInputReasons) RegisterPassedConstraint ¶
func (mir MissingInputReasons) RegisterPassedConstraint(inputName string)
func (MissingInputReasons) RegisterPinnedVersionUnavailable ¶
func (mir MissingInputReasons) RegisterPinnedVersionUnavailable(inputName string, version string)
type NotificationsBus ¶
type Pagination ¶
type PipelineDB ¶
type PipelineDB interface { Pipeline() SavedPipeline GetPipelineName() string GetPipelineID() int ScopedName(string) string TeamID() int Config() atc.Config ConfigVersion() ConfigVersion Reload() (bool, error) Pause() error Unpause() error IsPaused() (bool, error) IsPublic() bool UpdateName(string) error Destroy() error AcquireSchedulingLock(lager.Logger, time.Duration) (lock.Lock, bool, error) GetResource(resourceName string) (SavedResource, bool, error) GetResources() ([]SavedResource, bool, error) GetResourceType(resourceTypeName string) (SavedResourceType, bool, error) GetResourceVersions(resourceName string, page Page) ([]SavedVersionedResource, Pagination, bool, error) PauseResource(resourceName string) error UnpauseResource(resourceName string) error SaveResourceVersions(atc.ResourceConfig, []atc.Version) error SaveResourceTypeVersion(atc.ResourceType, atc.Version) error GetLatestVersionedResource(resourceName string) (SavedVersionedResource, bool, error) GetLatestEnabledVersionedResource(resourceName string) (SavedVersionedResource, bool, error) EnableVersionedResource(versionedResourceID int) error DisableVersionedResource(versionedResourceID int) error SetResourceCheckError(resource SavedResource, err error) error AcquireResourceTypeCheckingLock(logger lager.Logger, resourceType SavedResourceType, length time.Duration, immediate bool) (lock.Lock, bool, error) GetJobs() ([]SavedJob, error) GetJob(job string) (SavedJob, bool, error) PauseJob(job string) error UnpauseJob(job string) error SetMaxInFlightReached(string, bool) error UpdateFirstLoggedBuildID(job string, newFirstLoggedBuildID int) error GetJobFinishedAndNextBuild(job string) (Build, Build, error) GetJobBuilds(job string, page Page) ([]Build, Pagination, error) GetAllJobBuilds(job string) ([]Build, error) GetJobBuild(job string, build string) (Build, bool, error) CreateJobBuild(job string) (Build, error) EnsurePendingBuildExists(jobName string) error GetPendingBuildsForJob(jobName string) ([]Build, error) GetAllPendingBuilds() (map[string][]Build, error) UseInputsForBuild(buildID int, inputs []BuildInput) error LoadVersionsDB() (*algorithm.VersionsDB, error) GetVersionedResourceByVersion(atcVersion atc.Version, resourceName string) (SavedVersionedResource, bool, error) SaveIndependentInputMapping(inputMapping algorithm.InputMapping, jobName string) error GetIndependentBuildInputs(jobName string) ([]BuildInput, error) SaveNextInputMapping(inputMapping algorithm.InputMapping, jobName string) error GetNextBuildInputs(jobName string) ([]BuildInput, bool, error) DeleteNextInputMapping(jobName string) error GetRunningBuildsBySerialGroup(jobName string, serialGroups []string) ([]Build, error) GetNextPendingBuildBySerialGroup(jobName string, serialGroups []string) (Build, bool, error) UpdateBuildToScheduled(buildID int) (bool, error) SaveInput(buildID int, input BuildInput) (SavedVersionedResource, error) SaveOutput(buildID int, vr VersionedResource, explicit bool) (SavedVersionedResource, error) GetBuildsWithVersionAsInput(versionedResourceID int) ([]Build, error) GetBuildsWithVersionAsOutput(versionedResourceID int) ([]Build, error) GetDashboard() (Dashboard, atc.GroupConfigs, error) Expose() error Hide() error }
type PipelineDBFactory ¶
type PipelineDBFactory interface {
Build(pipeline SavedPipeline) PipelineDB
}
type PipelinePausedState ¶
type PipelinePausedState string
const ( PipelinePaused PipelinePausedState = "paused" PipelineUnpaused PipelinePausedState = "unpaused" PipelineNoChange PipelinePausedState = "nochange" )
func (PipelinePausedState) Bool ¶
func (state PipelinePausedState) Bool() *bool
type PipelinesDB ¶
type PipelinesDB interface {
GetAllPublicPipelines() ([]SavedPipeline, error)
}
type ResourceCacheIdentifier ¶
type ResourceNotFoundError ¶
type ResourceNotFoundError struct {
Name string
}
func (ResourceNotFoundError) Error ¶
func (e ResourceNotFoundError) Error() string
type ResourceTypeNotFoundError ¶
type ResourceTypeNotFoundError struct {
Name string
}
func (ResourceTypeNotFoundError) Error ¶
func (e ResourceTypeNotFoundError) Error() string
type SQLDB ¶
type SQLDB struct {
// contains filtered or unexported fields
}
func NewSQL ¶
func NewSQL( sqldbConnection Conn, bus *notificationsBus, lockFactory lock.LockFactory, ) *SQLDB
func (*SQLDB) AcquireContainerCreatingLock ¶
func (*SQLDB) AcquireVolumeCreatingLock ¶
func (*SQLDB) CreateDefaultTeamIfNotExists ¶
func (*SQLDB) CreatePipe ¶
func (*SQLDB) DeleteBuildEventsByBuildIDs ¶
func (*SQLDB) DeleteTeamByName ¶
func (*SQLDB) FindJobIDForBuild ¶
func (*SQLDB) GetAllPipelines ¶
func (db *SQLDB) GetAllPipelines() ([]SavedPipeline, error)
func (*SQLDB) GetAllPublicPipelines ¶
func (db *SQLDB) GetAllPublicPipelines() ([]SavedPipeline, error)
func (*SQLDB) GetAllStartedBuilds ¶
func (*SQLDB) GetPipelineByID ¶
func (db *SQLDB) GetPipelineByID(pipelineID int) (SavedPipeline, error)
func (*SQLDB) GetPublicBuilds ¶
func (db *SQLDB) GetPublicBuilds(page Page) ([]Build, Pagination, error)
func (*SQLDB) GetTaskLock ¶
type SavedPipeline ¶
type SavedResource ¶
type SavedResource struct { ID int CheckError error Paused bool PipelineName string Config atc.ResourceConfig Resource }
func (SavedResource) FailingToCheck ¶
func (r SavedResource) FailingToCheck() bool
type SavedResourceType ¶
type SavedVersionedResource ¶
type SavedVersionedResources ¶
type SavedVersionedResources []SavedVersionedResource
type Team ¶
type Team struct { Name string Admin bool BasicAuth *BasicAuth `json:"basic_auth"` GitHubAuth *GitHubAuth `json:"github_auth"` UAAAuth *UAAAuth `json:"uaa_auth"` GenericOAuth *GenericOAuth `json:"genericoauth_auth"` }
type TeamDB ¶
type TeamDB interface { GetPipelines() ([]SavedPipeline, error) GetPublicPipelines() ([]SavedPipeline, error) GetPrivateAndAllPublicPipelines() ([]SavedPipeline, error) GetPipelineByName(pipelineName string) (SavedPipeline, bool, error) OrderPipelines([]string) error GetTeam() (SavedTeam, bool, error) UpdateBasicAuth(basicAuth *BasicAuth) (SavedTeam, error) UpdateGitHubAuth(gitHubAuth *GitHubAuth) (SavedTeam, error) UpdateUAAAuth(uaaAuth *UAAAuth) (SavedTeam, error) UpdateGenericOAuth(genericOAuth *GenericOAuth) (SavedTeam, error) GetConfig(pipelineName string) (atc.Config, atc.RawConfig, ConfigVersion, error) SaveConfigToBeDeprecated(string, atc.Config, ConfigVersion, PipelinePausedState) (SavedPipeline, bool, error) CreateOneOffBuild() (Build, error) GetPrivateAndPublicBuilds(page Page) ([]Build, Pagination, error) }
type TeamDBFactory ¶
func NewTeamDBFactory ¶
func NewTeamDBFactory(conn Conn, bus *notificationsBus, lockFactory lock.LockFactory) TeamDBFactory
type VersionedResource ¶
type VersionedResource struct { Resource string Type string Version Version Metadata []MetadataField PipelineID int }
Source Files ¶
- build.go
- build_factory.go
- build_preparation.go
- db.go
- db_log.go
- errors.go
- job.go
- pagination.go
- pipe.go
- pipeline.go
- pipeline_db.go
- pipeline_db_factory.go
- resource.go
- sqldb.go
- sqldb_builds.go
- sqldb_bus.go
- sqldb_eventsource.go
- sqldb_locks.go
- sqldb_pipelines.go
- sqldb_pipes.go
- sqldb_teams.go
- team.go
- team_db.go
- team_db_factory.go
- volume.go
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |
lockfakes
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |
migrationsfakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.