storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package storage contains the data storage interface in which Gofer stores all internal data.

Index

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

This section is empty.

Types

type DB added in v0.3.0

type DB struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

DB is a representation of the datastore

func New added in v0.3.0

func New(path string, maxResultsLimit int) (DB, error)

New creates a new db with given settings

func (*DB) DeleteCommonTaskRegistration added in v0.3.0

func (db *DB) DeleteCommonTaskRegistration(name string) error

func (*DB) DeleteEvent added in v0.3.0

func (db *DB) DeleteEvent(id int64) error

func (*DB) DeleteNamespace added in v0.3.0

func (db *DB) DeleteNamespace(id string) error

func (*DB) DeleteObjectStorePipelineKey added in v0.3.0

func (db *DB) DeleteObjectStorePipelineKey(namespace, pipeline string, key string) error

func (*DB) DeleteObjectStoreRunKey added in v0.3.0

func (db *DB) DeleteObjectStoreRunKey(namespace, pipeline string, run int64, key string) error

func (*DB) DeletePipeline added in v0.3.0

func (db *DB) DeletePipeline(namespace, id string) error

func (*DB) DeleteRun added in v0.3.0

func (db *DB) DeleteRun(namespace, pipeline string, id int64) error

func (*DB) DeleteSecretStoreGlobalKey added in v0.3.0

func (db *DB) DeleteSecretStoreGlobalKey(key string) error

func (*DB) DeleteSecretStorePipelineKey added in v0.3.0

func (db *DB) DeleteSecretStorePipelineKey(namespace, pipeline string, key string) error

func (*DB) DeleteTaskRun added in v0.3.0

func (db *DB) DeleteTaskRun(namespace, pipeline string, run int64, id string) error

func (*DB) DeleteToken added in v0.3.0

func (db *DB) DeleteToken(hash string) error

func (*DB) DeleteTriggerRegistration added in v0.3.0

func (db *DB) DeleteTriggerRegistration(name string) error

func (*DB) DisableToken added in v0.3.0

func (db *DB) DisableToken(hashStr string) error

func (*DB) EnableToken added in v0.3.0

func (db *DB) EnableToken(hashStr string) error

func (*DB) GetCommonTaskRegistration added in v0.3.0

func (db *DB) GetCommonTaskRegistration(name string) (models.CommonTaskRegistration, error)

func (*DB) GetEvent added in v0.3.0

func (db *DB) GetEvent(id int64) (models.Event, error)

func (*DB) GetNamespace added in v0.3.0

func (db *DB) GetNamespace(id string) (models.Namespace, error)

func (*DB) GetPipeline added in v0.3.0

func (db *DB) GetPipeline(conn qb.BaseRunner, namespace, pipeline string) (models.Pipeline, error)

func (*DB) GetRun added in v0.3.0

func (db *DB) GetRun(namespace, pipeline string, run int64) (models.Run, error)

func (*DB) GetSecretStoreGlobalKey added in v0.3.0

func (db *DB) GetSecretStoreGlobalKey(key string) (models.SecretStoreKey, error)

func (*DB) GetSecretStorePipelineKey added in v0.3.0

func (db *DB) GetSecretStorePipelineKey(namespace, pipeline, key string) (models.SecretStoreKey, error)

func (*DB) GetTaskRun added in v0.3.0

func (db *DB) GetTaskRun(namespace, pipeline string, run int64, taskRun string) (models.TaskRun, error)

func (*DB) GetToken added in v0.3.0

func (db *DB) GetToken(hashStr string) (models.Token, error)

func (*DB) GetTriggerRegistration added in v0.3.0

func (db *DB) GetTriggerRegistration(name string) (models.TriggerRegistration, error)

func (*DB) InsertCommonTaskRegistration added in v0.3.0

func (db *DB) InsertCommonTaskRegistration(tr *models.CommonTaskRegistration) error

func (*DB) InsertEvent added in v0.3.0

func (db *DB) InsertEvent(event *models.Event) (int64, error)

func (*DB) InsertNamespace added in v0.3.0

func (db *DB) InsertNamespace(namespace *models.Namespace) error

func (*DB) InsertObjectStorePipelineKey added in v0.3.0

func (db *DB) InsertObjectStorePipelineKey(namespace, pipeline string, objectKey *models.ObjectStoreKey) error

func (*DB) InsertObjectStoreRunKey added in v0.3.0

func (db *DB) InsertObjectStoreRunKey(namespace, pipeline string, run int64, objectKey *models.ObjectStoreKey) error

func (*DB) InsertPipeline added in v0.3.0

func (db *DB) InsertPipeline(pipeline *models.Pipeline) error

func (*DB) InsertRun added in v0.3.0

func (db *DB) InsertRun(run *models.Run) (int64, error)

func (*DB) InsertSecretStoreGlobalKey added in v0.3.0

func (db *DB) InsertSecretStoreGlobalKey(secretKey *models.SecretStoreKey, force bool) error

func (*DB) InsertSecretStorePipelineKey added in v0.3.0

func (db *DB) InsertSecretStorePipelineKey(namespace, pipeline string, secretKey *models.SecretStoreKey, force bool) error

func (*DB) InsertTaskRun added in v0.3.0

func (db *DB) InsertTaskRun(taskRun *models.TaskRun) error

func (*DB) InsertToken added in v0.3.0

func (db *DB) InsertToken(tr *models.Token) error

func (*DB) InsertTriggerRegistration added in v0.3.0

func (db *DB) InsertTriggerRegistration(tr *models.TriggerRegistration) error

func (*DB) ListCommonTaskRegistrations added in v0.3.0

func (db *DB) ListCommonTaskRegistrations(offset, limit int) ([]models.CommonTaskRegistration, error)

func (*DB) ListCommonTaskSettings added in v0.3.0

func (db *DB) ListCommonTaskSettings(conn qb.BaseRunner, namespace, pipeline string) ([]models.PipelineCommonTaskSettings, error)

func (*DB) ListEvents added in v0.3.0

func (db *DB) ListEvents(offset, limit int, reverse bool) ([]models.Event, error)

Return all events; limited to 200 rows in any one response. The reverse parameter allows the sorting the events in reverse chronological order (newest event first).

func (*DB) ListNamespaces added in v0.3.0

func (db *DB) ListNamespaces(offset, limit int) ([]models.Namespace, error)

func (*DB) ListObjectStorePipelineKeys added in v0.3.0

func (db *DB) ListObjectStorePipelineKeys(namespace, pipeline string) ([]models.ObjectStoreKey, error)

func (*DB) ListObjectStoreRunKeys added in v0.3.0

func (db *DB) ListObjectStoreRunKeys(namespace, pipeline string, run int64) ([]models.ObjectStoreKey, error)

func (*DB) ListPipelines added in v0.3.0

func (db *DB) ListPipelines(offset, limit int, namespace string) ([]models.Pipeline, error)

func (*DB) ListRuns added in v0.3.0

func (db *DB) ListRuns(conn qb.BaseRunner, offset, limit int, namespace, pipeline string) ([]models.Run, error)

func (*DB) ListSecretStoreGlobalKeys added in v0.3.0

func (db *DB) ListSecretStoreGlobalKeys() ([]models.SecretStoreKey, error)

func (*DB) ListSecretStorePipelineKeys added in v0.3.0

func (db *DB) ListSecretStorePipelineKeys(namespace, pipeline string) ([]models.SecretStoreKey, error)

func (*DB) ListTaskRuns added in v0.3.0

func (db *DB) ListTaskRuns(offset, limit int, namespace, pipeline string, run int64) ([]models.TaskRun, error)

func (*DB) ListTasks added in v0.3.0

func (db *DB) ListTasks(conn qb.BaseRunner, namespace, pipeline string) ([]models.CustomTask, error)

func (*DB) ListTokens added in v0.3.0

func (db *DB) ListTokens(offset, limit int) ([]models.Token, error)

func (*DB) ListTriggerRegistrations added in v0.3.0

func (db *DB) ListTriggerRegistrations(offset, limit int) ([]models.TriggerRegistration, error)

func (*DB) ListTriggerSettings added in v0.3.0

func (db *DB) ListTriggerSettings(conn qb.BaseRunner, namespace, pipeline string) ([]models.PipelineTriggerSettings, error)

func (*DB) UpdateCommonTaskRegistration added in v0.3.0

func (db *DB) UpdateCommonTaskRegistration(name string, fields UpdatableCommonTaskRegistrationFields) error

func (*DB) UpdateNamespace added in v0.3.0

func (db *DB) UpdateNamespace(id string, fields UpdatableNamespaceFields) error

func (*DB) UpdatePipeline added in v0.3.0

func (db *DB) UpdatePipeline(namespace, id string, fields UpdatablePipelineFields) error

func (*DB) UpdateRun added in v0.3.0

func (db *DB) UpdateRun(namespace, pipeline string, run int64, fields UpdatableRunFields) error

func (*DB) UpdateTaskRun added in v0.3.0

func (db *DB) UpdateTaskRun(taskRun *models.TaskRun, fields UpdatableTaskRunFields) error

func (*DB) UpdateTriggerRegistration added in v0.3.0

func (db *DB) UpdateTriggerRegistration(name string, fields UpdatableTriggerRegistrationFields) error

type UpdatableCommonTaskRegistrationFields added in v0.3.0

type UpdatableCommonTaskRegistrationFields struct {
	Image         *string
	RegistryAuth  *models.RegistryAuth
	Variables     *map[string]string
	Status        *models.CommonTaskStatus
	Documentation *string
}

type UpdatableNamespaceFields added in v0.3.0

type UpdatableNamespaceFields struct {
	Name        *string
	Description *string
	Modified    *int64
}

type UpdatablePipelineFields added in v0.3.0

type UpdatablePipelineFields struct {
	Name        *string
	Description *string
	Parallelism *int64
	Modified    *int64
	State       *models.PipelineState
	Tasks       *map[string]models.CustomTask
	Triggers    *map[string]models.PipelineTriggerSettings
	CommonTasks *map[string]models.PipelineCommonTaskSettings
	Errors      *[]models.PipelineError
}

type UpdatableRunFields added in v0.3.0

type UpdatableRunFields struct {
	Ended               *int64
	State               *models.RunState
	Status              *models.RunStatus
	StatusReason        *models.RunStatusReason
	TaskRuns            *[]string
	Variables           *[]models.Variable
	StoreObjectsExpired *bool
}

type UpdatableTaskRunFields added in v0.3.0

type UpdatableTaskRunFields struct {
	Started      *int64
	Ended        *int64
	ExitCode     *int64
	State        *models.TaskRunState
	Status       *models.TaskRunStatus
	StatusReason *models.TaskRunStatusReason
	LogsExpired  *bool
	LogsRemoved  *bool
	Variables    *[]models.Variable
}

type UpdatableTriggerRegistrationFields added in v0.3.0

type UpdatableTriggerRegistrationFields struct {
	Image        *string
	RegistryAuth *models.RegistryAuth
	Variables    *map[string]string
	Status       *models.TriggerStatus
}

Jump to

Keyboard shortcuts

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