stores

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrJobNotFound   = errors.New("job not found")
	ErrJobInProgress = errors.New("another job is in progress")
)
View Source
var (
	ErrTargetConfigNotFound      = errors.New("target config not found")
	ErrTargetConfigAlreadyExists = errors.New("target config with the same name already exists")
)
View Source
var (
	ErrWorkspaceTemplateNotFound = errors.New("workspace template not found")
	ErrPrebuildNotFound          = errors.New("prebuild not found")
)
View Source
var (
	ErrApiKeyNotFound = errors.New("api key not found")
)
View Source
var (
	ErrBuildNotFound = errors.New("build not found")
)
View Source
var (
	ErrEnvironmentVariableNotFound = errors.New("environment variable not found")
)
View Source
var (
	ErrGitProviderConfigNotFound = errors.New("git provider config not found")
)
View Source
var (
	ErrRunnerMetadataNotFound = errors.New("runner metadata not found")
)
View Source
var (
	ErrRunnerNotFound = errors.New("runner not found")
)
View Source
var (
	ErrTargetMetadataNotFound = errors.New("target metadata not found")
)
View Source
var (
	ErrTargetNotFound = errors.New("target not found")
)
View Source
var (
	ErrWorkspaceMetadataNotFound = errors.New("workspace metadata not found")
)
View Source
var (
	ErrWorkspaceNotFound = errors.New("workspace not found")
)

Functions

func IsApiKeyNotFound

func IsApiKeyNotFound(err error) bool

func IsBuildNotFound

func IsBuildNotFound(err error) bool

func IsEnvironmentVariableNotFound

func IsEnvironmentVariableNotFound(err error) bool

func IsGitProviderNotFound

func IsGitProviderNotFound(err error) bool

func IsJobInProgress

func IsJobInProgress(err error) bool

func IsJobNotFound

func IsJobNotFound(err error) bool

func IsPrebuildNotFound

func IsPrebuildNotFound(err error) bool

func IsRunnerMetadataNotFound

func IsRunnerMetadataNotFound(err error) bool

func IsRunnerNotFound

func IsRunnerNotFound(err error) bool

func IsTargetConfigNotFound

func IsTargetConfigNotFound(err error) bool

func IsTargetMetadataNotFound

func IsTargetMetadataNotFound(err error) bool

func IsTargetNotFound

func IsTargetNotFound(err error) bool

func IsWorkspaceMetadataNotFound

func IsWorkspaceMetadataNotFound(err error) bool

func IsWorkspaceNotFound

func IsWorkspaceNotFound(err error) bool

func IsWorkspaceTemplateNotFound

func IsWorkspaceTemplateNotFound(err error) bool

func RecoverAndRollback

func RecoverAndRollback(ctx context.Context, store IStore)

Types

type ApiKeyStore

type ApiKeyStore interface {
	IStore
	List(ctx context.Context) ([]*models.ApiKey, error)
	Find(ctx context.Context, key string) (*models.ApiKey, error)
	FindByName(ctx context.Context, name string) (*models.ApiKey, error)
	Save(ctx context.Context, apiKey *models.ApiKey) error
	Delete(ctx context.Context, apiKey *models.ApiKey) error
}

type BuildFilter

type BuildFilter struct {
	Id            *string
	PrebuildIds   *[]string
	GetNewest     *bool
	BuildConfig   *models.BuildConfig
	RepositoryUrl *string
	Branch        *string
	EnvVars       *map[string]string
}

func (*BuildFilter) PrebuildIdsToInterface

func (f *BuildFilter) PrebuildIdsToInterface() []interface{}

type BuildStore

type BuildStore interface {
	IStore
	List(ctx context.Context, filter *BuildFilter) ([]*models.Build, error)
	Find(ctx context.Context, filter *BuildFilter) (*models.Build, error)
	Save(ctx context.Context, build *models.Build) error
	Delete(ctx context.Context, id string) error
}

type EnvironmentVariableStore

type EnvironmentVariableStore interface {
	IStore
	List(ctx context.Context) ([]*models.EnvironmentVariable, error)
	Save(ctx context.Context, environmentVariable *models.EnvironmentVariable) error
	Delete(ctx context.Context, key string) error
}

type GitProviderConfigStore

type GitProviderConfigStore interface {
	IStore
	List(ctx context.Context) ([]*models.GitProviderConfig, error)
	Find(ctx context.Context, id string) (*models.GitProviderConfig, error)
	Save(ctx context.Context, gpc *models.GitProviderConfig) error
	Delete(ctx context.Context, gpc *models.GitProviderConfig) error
}

type IStore

type IStore interface {
	BeginTransaction(ctx context.Context) (context.Context, error)
	CommitTransaction(ctx context.Context) error
	// If an error ocurrs while rolling back the transaction, the error should be wrapped and returned,
	// otherwise, the original error is returned
	RollbackTransaction(ctx context.Context, err error) error
}

type JobFilter

type JobFilter struct {
	Id              *string
	ResourceId      *string
	RunnerIdOrIsNil *string
	ResourceType    *models.ResourceType
	States          *[]models.JobState
	Actions         *[]models.JobAction
}

func (*JobFilter) ActionsToInterface

func (f *JobFilter) ActionsToInterface() []interface{}

func (*JobFilter) StatesToInterface

func (f *JobFilter) StatesToInterface() []interface{}

type JobStore

type JobStore interface {
	IStore
	List(ctx context.Context, filter *JobFilter) ([]*models.Job, error)
	Find(ctx context.Context, filter *JobFilter) (*models.Job, error)
	Save(ctx context.Context, job *models.Job) error
	Delete(ctx context.Context, job *models.Job) error
}

type PrebuildFilter

type PrebuildFilter struct {
	WorkspaceTemplateName *string
	Id                    *string
	Branch                *string
	CommitInterval        *int
	TriggerFiles          *[]string
}

type RunnerMetadataStore

type RunnerMetadataStore interface {
	IStore
	List(ctx context.Context) ([]*models.RunnerMetadata, error)
	Find(ctx context.Context, runnerId string) (*models.RunnerMetadata, error)
	Save(ctx context.Context, metadata *models.RunnerMetadata) error
	Delete(ctx context.Context, metadata *models.RunnerMetadata) error
}

type RunnerStore

type RunnerStore interface {
	IStore
	List(ctx context.Context) ([]*models.Runner, error)
	Find(ctx context.Context, idOrName string) (*models.Runner, error)
	Save(ctx context.Context, runner *models.Runner) error
	Delete(ctx context.Context, runner *models.Runner) error
}

type TargetConfigStore

type TargetConfigStore interface {
	IStore
	List(ctx context.Context, allowDeleted bool) ([]*models.TargetConfig, error)
	Find(ctx context.Context, idOrName string, allowDeleted bool) (*models.TargetConfig, error)
	Save(ctx context.Context, targetConfig *models.TargetConfig) error
}

type TargetFilter

type TargetFilter struct {
	IdOrName *string
	Default  *bool
}

type TargetMetadataStore

type TargetMetadataStore interface {
	IStore
	Find(ctx context.Context, targetId string) (*models.TargetMetadata, error)
	Save(ctx context.Context, metadata *models.TargetMetadata) error
	Delete(ctx context.Context, metadata *models.TargetMetadata) error
}

type TargetStore

type TargetStore interface {
	IStore
	List(ctx context.Context, filter *TargetFilter) ([]*models.Target, error)
	Find(ctx context.Context, filter *TargetFilter) (*models.Target, error)
	Save(ctx context.Context, target *models.Target) error
	Delete(ctx context.Context, target *models.Target) error
}

type TransactionKey

type TransactionKey struct{}

type WorkspaceMetadataStore

type WorkspaceMetadataStore interface {
	IStore
	Find(ctx context.Context, workspaceId string) (*models.WorkspaceMetadata, error)
	Save(ctx context.Context, metadata *models.WorkspaceMetadata) error
	Delete(ctx context.Context, metadata *models.WorkspaceMetadata) error
}

type WorkspaceStore

type WorkspaceStore interface {
	IStore
	List(ctx context.Context) ([]*models.Workspace, error)
	Find(ctx context.Context, idOrName string) (*models.Workspace, error)
	Save(ctx context.Context, workspace *models.Workspace) error
	Delete(ctx context.Context, workspace *models.Workspace) error
}

type WorkspaceTemplateFilter

type WorkspaceTemplateFilter struct {
	Name                *string
	Url                 *string
	Default             *bool
	PrebuildId          *string
	GitProviderConfigId *string
}

type WorkspaceTemplateStore

type WorkspaceTemplateStore interface {
	IStore
	List(ctx context.Context, filter *WorkspaceTemplateFilter) ([]*models.WorkspaceTemplate, error)
	Find(ctx context.Context, filter *WorkspaceTemplateFilter) (*models.WorkspaceTemplate, error)
	Save(ctx context.Context, workspaceTemplate *models.WorkspaceTemplate) error
	Delete(ctx context.Context, workspaceTemplate *models.WorkspaceTemplate) error
}

Jump to

Keyboard shortcuts

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