Documentation ¶
Overview ¶
Package storage contains the data storage interface in which Gofer stores all internal data.
Index ¶
- Variables
- func InsideTx(db *sqlx.DB, fn func(*sqlx.Tx) error) error
- type DB
- func (db *DB) DeleteEvent(conn Queryable, id int64) error
- func (db *DB) DeleteGlobalExtensionRegistration(conn Queryable, name string) error
- func (db *DB) DeleteNamespace(conn Queryable, id string) error
- func (db *DB) DeleteObjectStorePipelineKey(conn Queryable, namespace, pipeline, key string) error
- func (db *DB) DeleteObjectStoreRunKey(conn Queryable, namespace, pipeline string, run int64, key string) error
- func (db *DB) DeletePipelineConfig(conn Queryable, namespace, pipeline string, version int64) error
- func (db *DB) DeletePipelineDeployment(conn Queryable, namespace, pipeline string, id int64) error
- func (db *DB) DeletePipelineExtensionSubscription(conn Queryable, namespace, pipeline, name, label string) error
- func (db *DB) DeletePipelineMetadata(conn Queryable, namespace, id string) error
- func (db *DB) DeletePipelineRun(conn Queryable, namespace, pipeline string, id int64) error
- func (db *DB) DeletePipelineTaskRun(conn Queryable, namespace, pipeline string, run int64, id string) error
- func (db *DB) DeleteSecretStoreGlobalKey(conn Queryable, key string) error
- func (db *DB) DeleteSecretStorePipelineKey(conn Queryable, namespace, pipeline, key string) error
- func (db *DB) DeleteTokenByHash(conn Queryable, hash string) error
- func (db *DB) DeleteTokenByID(conn Queryable, id int64) error
- func (db *DB) DisableToken(conn Queryable, hashStr string) error
- func (db *DB) EnableToken(conn Queryable, hashStr string) error
- func (db *DB) GetEvent(conn Queryable, id int64) (Event, error)
- func (db *DB) GetGlobalExtensionRegistration(conn Queryable, name string) (GlobalExtensionRegistration, error)
- func (db *DB) GetLatestLivePipelineConfig(conn Queryable, namespace, pipeline string) (PipelineConfig, error)
- func (db *DB) GetLatestPipelineConfig(conn Queryable, namespace, pipeline string) (PipelineConfig, error)
- func (db *DB) GetLatestPipelineRun(conn Queryable, namespace, pipeline string) (PipelineRun, error)
- func (db *DB) GetNamespace(conn Queryable, id string) (Namespace, error)
- func (db *DB) GetPipelineConfig(conn Queryable, namespace, pipeline string, version int64) (PipelineConfig, error)
- func (db *DB) GetPipelineDeployment(conn Queryable, namespace, pipeline string, id int64) (PipelineDeployment, error)
- func (db *DB) GetPipelineExtensionSubscription(conn Queryable, namespace, pipeline, name, label string) (PipelineExtensionSubscription, error)
- func (db *DB) GetPipelineMetadata(conn Queryable, namespace, id string) (PipelineMetadata, error)
- func (db *DB) GetPipelineRun(conn Queryable, namespace, pipeline string, id int64) (PipelineRun, error)
- func (db *DB) GetPipelineTask(conn Queryable, namespace, pipeline string, version int64, id string) (PipelineTask, error)
- func (db *DB) GetPipelineTaskRun(conn Queryable, namespace, pipeline string, run int64, id string) (PipelineTaskRun, error)
- func (db *DB) GetSecretStoreGlobalKey(conn Queryable, key string) (SecretStoreGlobalKey, error)
- func (db *DB) GetSecretStorePipelineKey(conn Queryable, namespace, pipeline, key string) (SecretStorePipelineKey, error)
- func (db *DB) GetTokenByHash(conn Queryable, hashStr string) (Token, error)
- func (db *DB) GetTokenByID(conn Queryable, id int64) (Token, error)
- func (db *DB) InsertEvent(conn Queryable, event *Event) (int64, error)
- func (db *DB) InsertGlobalExtensionRegistration(conn Queryable, tr *GlobalExtensionRegistration) error
- func (db *DB) InsertNamespace(conn Queryable, namespace *Namespace) error
- func (db *DB) InsertObjectStorePipelineKey(conn Queryable, objectKey *ObjectStorePipelineKey) error
- func (db *DB) InsertObjectStoreRunKey(conn Queryable, objectKey *ObjectStoreRunKey) error
- func (db *DB) InsertPipelineConfig(conn Queryable, config *PipelineConfig) error
- func (db *DB) InsertPipelineDeployment(conn Queryable, deployment *PipelineDeployment) error
- func (db *DB) InsertPipelineExtensionSubscription(conn Queryable, sub *PipelineExtensionSubscription) error
- func (db *DB) InsertPipelineMetadata(conn Queryable, metadata *PipelineMetadata) error
- func (db *DB) InsertPipelineRun(conn Queryable, run *PipelineRun) error
- func (db *DB) InsertPipelineTask(conn Queryable, task *PipelineTask) error
- func (db *DB) InsertPipelineTaskRun(conn Queryable, taskRun *PipelineTaskRun) error
- func (db *DB) InsertSecretStoreGlobalKey(conn Queryable, secretKey *SecretStoreGlobalKey, force bool) error
- func (db *DB) InsertSecretStorePipelineKey(conn Queryable, secretKey *SecretStorePipelineKey, force bool) error
- func (db *DB) InsertToken(conn Queryable, tr *Token) (int64, error)
- func (db *DB) ListEvents(conn Queryable, offset, limit int, reverse bool) ([]Event, error)
- func (db *DB) ListGlobalExtensionRegistrations(conn Queryable, offset, limit int) ([]GlobalExtensionRegistration, error)
- func (db *DB) ListNamespaces(conn Queryable, offset, limit int) ([]Namespace, error)
- func (db *DB) ListObjectStorePipelineKeys(conn Queryable, namespace, pipeline string) ([]ObjectStorePipelineKey, error)
- func (db *DB) ListObjectStoreRunKeys(conn Queryable, namespace, pipeline string, run int64) ([]ObjectStoreRunKey, error)
- func (db *DB) ListPipelineConfigs(conn Queryable, offset, limit int, namespace, pipeline string) ([]PipelineConfig, error)
- func (db *DB) ListPipelineDeployments(conn Queryable, offset, limit int, namespace, pipeline string) ([]PipelineDeployment, error)
- func (db *DB) ListPipelineExtensionSubscriptions(conn Queryable, namespace, pipeline string) ([]PipelineExtensionSubscription, error)
- func (db *DB) ListPipelineMetadata(conn Queryable, offset, limit int, namespace string) ([]PipelineMetadata, error)
- func (db *DB) ListPipelineRuns(conn Queryable, offset, limit int, namespace, pipeline string) ([]PipelineRun, error)
- func (db *DB) ListPipelineTaskRuns(conn Queryable, offset, limit int, namespace, pipeline string, run int64) ([]PipelineTaskRun, error)
- func (db *DB) ListPipelineTasks(conn Queryable, namespace, pipeline string, version int64) ([]PipelineTask, error)
- func (db *DB) ListRunningPipelineDeployments(conn Queryable, offset, limit int, namespace, pipeline string) ([]PipelineDeployment, error)
- func (db *DB) ListSecretStoreGlobalKeys(conn Queryable) ([]SecretStoreGlobalKey, error)
- func (db *DB) ListSecretStorePipelineKeys(conn Queryable, namespace, pipeline string) ([]SecretStorePipelineKey, error)
- func (db *DB) ListTokens(conn Queryable, offset, limit int) ([]Token, error)
- func (db *DB) UpdateGlobalExtensionRegistration(conn Queryable, name string, fields UpdatableGlobalExtensionRegistrationFields) error
- func (db *DB) UpdateNamespace(conn Queryable, id string, fields UpdatableNamespaceFields) error
- func (db *DB) UpdatePipelineConfig(conn Queryable, namespace, pipeline string, version int64, ...) error
- func (db *DB) UpdatePipelineDeployment(conn Queryable, namespace, pipeline string, id int64, ...) error
- func (db *DB) UpdatePipelineExtensionSubscription(conn Queryable, namespace, pipeline, name, label string, ...) error
- func (db *DB) UpdatePipelineMetadata(conn Queryable, namespace, id string, fields UpdatablePipelineMetadataFields) error
- func (db *DB) UpdatePipelineRun(conn Queryable, namespace, pipeline string, id int64, ...) error
- func (db *DB) UpdatePipelineTaskRun(conn Queryable, namespace, pipeline string, run int64, id string, ...) error
- func (db *DB) UpdateSecretStoreGlobalKey(conn Queryable, key string, fields UpdatableSecretStoreGlobalKeyFields) error
- type Event
- type GlobalExtensionRegistration
- type Namespace
- type ObjectStorePipelineKey
- type ObjectStoreRunKey
- type PipelineConfig
- type PipelineDeployment
- type PipelineExtensionSubscription
- type PipelineMetadata
- type PipelineRun
- type PipelineTask
- type PipelineTaskRun
- type Queryable
- type SecretStoreGlobalKey
- type SecretStorePipelineKey
- type Token
- type UpdatableGlobalExtensionRegistrationFields
- type UpdatableNamespaceFields
- type UpdatablePipelineConfigFields
- type UpdatablePipelineDeploymentFields
- type UpdatablePipelineMetadataFields
- type UpdatablePipelineRunFields
- type UpdatablePipelineTaskRunFields
- type UpdatableSecretStoreGlobalKeyFields
- type UpdateablePipelineExtensionSubscriptionFields
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEntityNotFound is returned when a certain entity could not be located. ErrEntityNotFound = errors.New("storage: entity not found") // ErrEntityExists is returned when a certain entity was located but not meant to be. ErrEntityExists = errors.New("storage: entity already exists") // ErrPreconditionFailure is returned when there was a validation error with the parameters passed. ErrPreconditionFailure = errors.New("storage: parameters did not pass validation") // ErrInternal is returned when there was an unknown internal DB error. ErrInternal = errors.New("storage: unknown db error") )
Functions ¶
Types ¶
type DB ¶ added in v0.3.0
DB is a representation of the datastore
func (*DB) DeleteGlobalExtensionRegistration ¶ added in v0.5.0
func (*DB) DeleteNamespace ¶ added in v0.3.0
func (*DB) DeleteObjectStorePipelineKey ¶ added in v0.3.0
func (*DB) DeleteObjectStoreRunKey ¶ added in v0.3.0
func (*DB) DeletePipelineConfig ¶ added in v0.5.0
func (*DB) DeletePipelineDeployment ¶ added in v0.5.0
func (*DB) DeletePipelineExtensionSubscription ¶ added in v0.5.0
func (*DB) DeletePipelineMetadata ¶ added in v0.5.0
func (*DB) DeletePipelineRun ¶ added in v0.5.0
func (*DB) DeletePipelineTaskRun ¶ added in v0.5.0
func (*DB) DeleteSecretStoreGlobalKey ¶ added in v0.3.0
func (*DB) DeleteSecretStorePipelineKey ¶ added in v0.3.0
func (*DB) DeleteTokenByHash ¶ added in v0.5.0
func (*DB) DeleteTokenByID ¶ added in v0.5.0
func (*DB) DisableToken ¶ added in v0.3.0
func (*DB) EnableToken ¶ added in v0.3.0
func (*DB) GetGlobalExtensionRegistration ¶ added in v0.5.0
func (db *DB) GetGlobalExtensionRegistration(conn Queryable, name string) (GlobalExtensionRegistration, error)
func (*DB) GetLatestLivePipelineConfig ¶ added in v0.5.0
func (db *DB) GetLatestLivePipelineConfig(conn Queryable, namespace, pipeline string) (PipelineConfig, error)
func (*DB) GetLatestPipelineConfig ¶ added in v0.5.0
func (db *DB) GetLatestPipelineConfig(conn Queryable, namespace, pipeline string) (PipelineConfig, error)
func (*DB) GetLatestPipelineRun ¶ added in v0.5.0
func (db *DB) GetLatestPipelineRun(conn Queryable, namespace, pipeline string) (PipelineRun, error)
func (*DB) GetNamespace ¶ added in v0.3.0
func (*DB) GetPipelineConfig ¶ added in v0.5.0
func (*DB) GetPipelineDeployment ¶ added in v0.5.0
func (*DB) GetPipelineExtensionSubscription ¶ added in v0.5.0
func (db *DB) GetPipelineExtensionSubscription(conn Queryable, namespace, pipeline, name, label string) ( PipelineExtensionSubscription, error, )
func (*DB) GetPipelineMetadata ¶ added in v0.5.0
func (db *DB) GetPipelineMetadata(conn Queryable, namespace, id string) (PipelineMetadata, error)
func (*DB) GetPipelineRun ¶ added in v0.5.0
func (*DB) GetPipelineTask ¶ added in v0.5.0
func (*DB) GetPipelineTaskRun ¶ added in v0.5.0
func (*DB) GetSecretStoreGlobalKey ¶ added in v0.3.0
func (db *DB) GetSecretStoreGlobalKey(conn Queryable, key string) (SecretStoreGlobalKey, error)
func (*DB) GetSecretStorePipelineKey ¶ added in v0.3.0
func (db *DB) GetSecretStorePipelineKey(conn Queryable, namespace, pipeline, key string) (SecretStorePipelineKey, error)
func (*DB) GetTokenByHash ¶ added in v0.5.0
func (*DB) GetTokenByID ¶ added in v0.5.0
func (*DB) InsertEvent ¶ added in v0.3.0
func (*DB) InsertGlobalExtensionRegistration ¶ added in v0.5.0
func (db *DB) InsertGlobalExtensionRegistration(conn Queryable, tr *GlobalExtensionRegistration) error
func (*DB) InsertNamespace ¶ added in v0.3.0
func (*DB) InsertObjectStorePipelineKey ¶ added in v0.3.0
func (db *DB) InsertObjectStorePipelineKey(conn Queryable, objectKey *ObjectStorePipelineKey) error
func (*DB) InsertObjectStoreRunKey ¶ added in v0.3.0
func (db *DB) InsertObjectStoreRunKey(conn Queryable, objectKey *ObjectStoreRunKey) error
func (*DB) InsertPipelineConfig ¶ added in v0.5.0
func (db *DB) InsertPipelineConfig(conn Queryable, config *PipelineConfig) error
func (*DB) InsertPipelineDeployment ¶ added in v0.5.0
func (db *DB) InsertPipelineDeployment(conn Queryable, deployment *PipelineDeployment) error
func (*DB) InsertPipelineExtensionSubscription ¶ added in v0.5.0
func (db *DB) InsertPipelineExtensionSubscription(conn Queryable, sub *PipelineExtensionSubscription) error
func (*DB) InsertPipelineMetadata ¶ added in v0.5.0
func (db *DB) InsertPipelineMetadata(conn Queryable, metadata *PipelineMetadata) error
func (*DB) InsertPipelineRun ¶ added in v0.5.0
func (db *DB) InsertPipelineRun(conn Queryable, run *PipelineRun) error
func (*DB) InsertPipelineTask ¶ added in v0.5.0
func (db *DB) InsertPipelineTask(conn Queryable, task *PipelineTask) error
func (*DB) InsertPipelineTaskRun ¶ added in v0.5.0
func (db *DB) InsertPipelineTaskRun(conn Queryable, taskRun *PipelineTaskRun) error
func (*DB) InsertSecretStoreGlobalKey ¶ added in v0.3.0
func (db *DB) InsertSecretStoreGlobalKey(conn Queryable, secretKey *SecretStoreGlobalKey, force bool) error
func (*DB) InsertSecretStorePipelineKey ¶ added in v0.3.0
func (db *DB) InsertSecretStorePipelineKey(conn Queryable, secretKey *SecretStorePipelineKey, force bool, ) error
func (*DB) InsertToken ¶ added in v0.3.0
func (*DB) ListEvents ¶ added in v0.3.0
Return all events. The reverse parameter allows the sorting the events in reverse chronological order (newest event first).
func (*DB) ListGlobalExtensionRegistrations ¶ added in v0.5.0
func (db *DB) ListGlobalExtensionRegistrations(conn Queryable, offset, limit int) ([]GlobalExtensionRegistration, error)
func (*DB) ListNamespaces ¶ added in v0.3.0
func (*DB) ListObjectStorePipelineKeys ¶ added in v0.3.0
func (db *DB) ListObjectStorePipelineKeys(conn Queryable, namespace, pipeline string) ([]ObjectStorePipelineKey, error)
func (*DB) ListObjectStoreRunKeys ¶ added in v0.3.0
func (*DB) ListPipelineConfigs ¶ added in v0.5.0
func (*DB) ListPipelineDeployments ¶ added in v0.5.0
func (*DB) ListPipelineExtensionSubscriptions ¶ added in v0.5.0
func (db *DB) ListPipelineExtensionSubscriptions(conn Queryable, namespace, pipeline string) ([]PipelineExtensionSubscription, error)
func (*DB) ListPipelineMetadata ¶ added in v0.5.0
func (db *DB) ListPipelineMetadata(conn Queryable, offset, limit int, namespace string) ([]PipelineMetadata, error)
Returns pipelines ordered by id.
func (*DB) ListPipelineRuns ¶ added in v0.5.0
func (*DB) ListPipelineTaskRuns ¶ added in v0.5.0
func (*DB) ListPipelineTasks ¶ added in v0.5.0
func (*DB) ListRunningPipelineDeployments ¶ added in v0.5.0
func (*DB) ListSecretStoreGlobalKeys ¶ added in v0.3.0
func (db *DB) ListSecretStoreGlobalKeys(conn Queryable) ([]SecretStoreGlobalKey, error)
func (*DB) ListSecretStorePipelineKeys ¶ added in v0.3.0
func (db *DB) ListSecretStorePipelineKeys(conn Queryable, namespace, pipeline string) ([]SecretStorePipelineKey, error)
func (*DB) ListTokens ¶ added in v0.3.0
func (*DB) UpdateGlobalExtensionRegistration ¶ added in v0.5.0
func (db *DB) UpdateGlobalExtensionRegistration(conn Queryable, name string, fields UpdatableGlobalExtensionRegistrationFields) error
func (*DB) UpdateNamespace ¶ added in v0.3.0
func (db *DB) UpdateNamespace(conn Queryable, id string, fields UpdatableNamespaceFields) error
func (*DB) UpdatePipelineConfig ¶ added in v0.5.0
func (*DB) UpdatePipelineDeployment ¶ added in v0.5.0
func (*DB) UpdatePipelineExtensionSubscription ¶ added in v0.5.0
func (db *DB) UpdatePipelineExtensionSubscription(conn Queryable, namespace, pipeline, name, label string, fields UpdateablePipelineExtensionSubscriptionFields) error
func (*DB) UpdatePipelineMetadata ¶ added in v0.5.0
func (db *DB) UpdatePipelineMetadata(conn Queryable, namespace, id string, fields UpdatablePipelineMetadataFields) error
func (*DB) UpdatePipelineRun ¶ added in v0.5.0
func (*DB) UpdatePipelineTaskRun ¶ added in v0.5.0
func (*DB) UpdateSecretStoreGlobalKey ¶ added in v0.5.0
func (db *DB) UpdateSecretStoreGlobalKey(conn Queryable, key string, fields UpdatableSecretStoreGlobalKeyFields) error
type GlobalExtensionRegistration ¶ added in v0.5.0
type ObjectStorePipelineKey ¶ added in v0.5.0
type ObjectStoreRunKey ¶ added in v0.5.0
type PipelineConfig ¶ added in v0.5.0
type PipelineDeployment ¶ added in v0.5.0
type PipelineExtensionSubscription ¶ added in v0.5.0
type PipelineMetadata ¶ added in v0.5.0
type PipelineRun ¶ added in v0.5.0
type PipelineRun struct { Namespace string Pipeline string PipelineConfigVersion int64 `db:"pipeline_config_version"` ID int64 Started int64 Ended int64 State string Status string StatusReason string `db:"status_reason"` Initiator string Variables string StoreObjectsExpired bool `db:"store_objects_expired"` }
type PipelineTask ¶ added in v0.5.0
type PipelineTask struct { Namespace string Pipeline string PipelineConfigVersion int64 `db:"pipeline_config_version"` ID string Description string Image string RegistryAuth string `db:"registry_auth"` DependsOn string `db:"depends_on"` Variables string Entrypoint string Command string InjectAPIToken bool `db:"inject_api_token"` }
type PipelineTaskRun ¶ added in v0.5.0
type PipelineTaskRun struct { Namespace string Pipeline string Run int64 ID string TaskKind string `db:"task_kind"` Task string Created int64 Started int64 Ended int64 ExitCode int64 `db:"exit_code"` LogsExpired bool `db:"logs_expired"` LogsRemoved bool `db:"logs_removed"` State string Status string StatusReason string `db:"status_reason"` Variables string }
type Queryable ¶ added in v0.5.0
type Queryable interface { sqlx.Queryer sqlx.Execer GetContext(context.Context, interface{}, string, ...interface{}) error SelectContext(context.Context, interface{}, string, ...interface{}) error Get(interface{}, string, ...interface{}) error MustExecContext(context.Context, string, ...interface{}) sql.Result PreparexContext(context.Context, string) (*sqlx.Stmt, error) QueryRowContext(context.Context, string, ...interface{}) *sql.Row Select(interface{}, string, ...interface{}) error QueryRow(string, ...interface{}) *sql.Row PrepareNamedContext(context.Context, string) (*sqlx.NamedStmt, error) PrepareNamed(string) (*sqlx.NamedStmt, error) Preparex(string) (*sqlx.Stmt, error) NamedExec(string, interface{}) (sql.Result, error) NamedExecContext(context.Context, string, interface{}) (sql.Result, error) MustExec(string, ...interface{}) sql.Result NamedQuery(string, interface{}) (*sqlx.Rows, error) }
Queryable includes methods shared by sqlx.Tx and sqlx.DB so they can be used interchangeably.
type SecretStoreGlobalKey ¶ added in v0.5.0
type SecretStorePipelineKey ¶ added in v0.5.0
type UpdatableGlobalExtensionRegistrationFields ¶ added in v0.5.0
type UpdatableNamespaceFields ¶ added in v0.3.0
type UpdatablePipelineConfigFields ¶ added in v0.5.0
type UpdatablePipelineDeploymentFields ¶ added in v0.5.0
type UpdatablePipelineMetadataFields ¶ added in v0.5.0
type UpdatablePipelineRunFields ¶ added in v0.5.0
type UpdatablePipelineTaskRunFields ¶ added in v0.5.0
type UpdatableSecretStoreGlobalKeyFields ¶ added in v0.5.0
type UpdatableSecretStoreGlobalKeyFields struct {
Namespaces *string
}
type UpdateablePipelineExtensionSubscriptionFields ¶ added in v0.5.0
Source Files ¶
- events.go
- extensionRegistrations.go
- migrate.go
- namespaces.go
- objectStorePipelineKeys.go
- objectStoreRunKeys.go
- pipelineConfigs.go
- pipelineDeployments.go
- pipelineExtensionSubscriptions.go
- pipelineMetadata.go
- pipelineRuns.go
- pipelineTaskRuns.go
- pipelineTasks.go
- secretStoreGlobalKeys.go
- secretStorePipelineKeys.go
- storage.go
- tokens.go
Click to show internal directories.
Click to hide internal directories.