storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package storage contains the interface in which the storage layer adheres to. It has a fairly tight coupling with the main application(for example providing autogenerated/sequential ids) so it's flexibility with introducing other storage options heavily requires the writer to look into what the original Bolt package is doing.

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

Functions

This section is empty.

Types

type AddEventRequest added in v0.1.0

type AddEventRequest struct {
	Event models.Event
}

type AddNamespaceRequest

type AddNamespaceRequest struct {
	Namespace *models.Namespace
}

type AddPipelineRequest

type AddPipelineRequest struct {
	Pipeline *models.Pipeline
}

type AddRunRequest

type AddRunRequest struct {
	Run *models.Run
}

type AddTaskRunRequest

type AddTaskRunRequest struct {
	TaskRun *models.TaskRun
}

type AddTokenRequest

type AddTokenRequest struct {
	Token *models.Token
}

type DeleteEventRequest added in v0.1.0

type DeleteEventRequest struct {
	ID int64
}

type DeleteRunRequest

type DeleteRunRequest struct {
	NamespaceID string
	PipelineID  string
	ID          int64
}

type DeleteTokenRequest

type DeleteTokenRequest struct {
	Hash string
}

type Engine

type Engine interface {
	GetAllNamespaces(r GetAllNamespacesRequest) ([]*models.Namespace, error)
	AddNamespace(r AddNamespaceRequest) error
	GetNamespace(r GetNamespaceRequest) (*models.Namespace, error)
	UpdateNamespace(r UpdateNamespaceRequest) error

	GetAllTokens(r GetAllTokensRequest) ([]*models.Token, error)
	AddToken(r AddTokenRequest) error
	GetToken(r GetTokenRequest) (*models.Token, error)
	DeleteToken(r DeleteTokenRequest) error

	GetAllPipelines(r GetAllPipelinesRequest) ([]*models.Pipeline, error)
	GetPipeline(r GetPipelineRequest) (*models.Pipeline, error)
	AddPipeline(r AddPipelineRequest) error
	UpdatePipeline(r UpdatePipelineRequest) error

	GetAllRuns(r GetAllRunsRequest) ([]*models.Run, error)
	GetRun(r GetRunRequest) (*models.Run, error)
	AddRun(r AddRunRequest) error
	UpdateRun(r UpdateRunRequest) error

	GetAllTaskRuns(r GetAllTaskRunsRequest) ([]*models.TaskRun, error)
	GetTaskRun(r GetTaskRunRequest) (*models.TaskRun, error)
	AddTaskRun(r AddTaskRunRequest) error
	UpdateTaskRun(r UpdateTaskRunRequest) error

	GetAllEvents(r GetAllEventsRequest) ([]models.Event, error)
	GetEvent(r GetEventRequest) (models.Event, error)
	AddEvent(r AddEventRequest) error
	DeleteEvent(r DeleteEventRequest) error
}

Engine represents backend storage implementations where items can be persisted.

type EngineType

type EngineType string

EngineType type represents the different possible storage engines available

const (
	// StorageEngineBoltDB represents a boltDB storage engine.
	// A file based key-value store.(https://pkg.go.dev/go.etcd.io/bbolt) used through (https://github.com/asdine/storm)
	StorageEngineBoltDB EngineType = "bolt"
)

type GetAllEventsRequest added in v0.1.0

type GetAllEventsRequest struct {
	Offset  int
	Limit   int
	Reverse bool
}

type GetAllNamespacesRequest

type GetAllNamespacesRequest struct {
	Offset int
	Limit  int
}

type GetAllPipelinesRequest

type GetAllPipelinesRequest struct {
	Offset int
	Limit  int

	NamespaceID string
}

type GetAllRunsRequest

type GetAllRunsRequest struct {
	Offset int
	Limit  int

	NamespaceID string
	PipelineID  string
}

type GetAllTaskRunsRequest

type GetAllTaskRunsRequest struct {
	NamespaceID string
	PipelineID  string
	RunID       int64
}

type GetAllTokensRequest

type GetAllTokensRequest struct {
	Offset     int
	Limit      int
	Namespaces []string
}

type GetEventRequest added in v0.1.0

type GetEventRequest struct {
	ID int64
}

type GetNamespaceRequest

type GetNamespaceRequest struct {
	ID string
}

type GetPipelineRequest

type GetPipelineRequest struct {
	NamespaceID string
	ID          string
}

type GetRunRequest

type GetRunRequest struct {
	NamespaceID string
	PipelineID  string
	ID          int64
}

type GetTaskRunRequest

type GetTaskRunRequest struct {
	NamespaceID string
	PipelineID  string
	RunID       int64
	ID          string
}

type GetTokenRequest

type GetTokenRequest struct {
	Hash string
}

type UpdateNamespaceRequest

type UpdateNamespaceRequest struct {
	Namespace *models.Namespace
}

type UpdatePipelineRequest

type UpdatePipelineRequest struct {
	Pipeline *models.Pipeline
}

type UpdateRunRequest

type UpdateRunRequest struct {
	Run *models.Run
}

type UpdateTaskRunRequest

type UpdateTaskRunRequest struct {
	TaskRun *models.TaskRun
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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