db

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSQLiteConnection

func GetSQLiteConnection(dbPath string) *gorm.DB

func IsRecordNotFound added in v0.18.0

func IsRecordNotFound(err error) bool

func NewApiKeyStore

func NewApiKeyStore(store IStore) (stores.ApiKeyStore, error)

func NewBuildStore added in v0.25.0

func NewBuildStore(store IStore) (stores.BuildStore, error)

func NewEnvironmentVariableStore added in v0.52.0

func NewEnvironmentVariableStore(store IStore) (stores.EnvironmentVariableStore, error)

func NewGitProviderConfigStore

func NewGitProviderConfigStore(store IStore) (stores.GitProviderConfigStore, error)

func NewJobStore added in v0.52.0

func NewJobStore(store IStore) (stores.JobStore, error)

func NewRunnerMetadataStore added in v0.52.0

func NewRunnerMetadataStore(store IStore) (stores.RunnerMetadataStore, error)

func NewRunnerStore added in v0.52.0

func NewRunnerStore(store IStore) (stores.RunnerStore, error)

func NewTargetConfigStore added in v0.52.0

func NewTargetConfigStore(store IStore) (stores.TargetConfigStore, error)

func NewTargetMetadataStore added in v0.52.0

func NewTargetMetadataStore(store IStore) (stores.TargetMetadataStore, error)

func NewTargetStore added in v0.52.0

func NewTargetStore(store IStore) (stores.TargetStore, error)

func NewWorkspaceMetadataStore added in v0.52.0

func NewWorkspaceMetadataStore(store IStore) (stores.WorkspaceMetadataStore, error)

func NewWorkspaceStore

func NewWorkspaceStore(store IStore) (stores.WorkspaceStore, error)

func NewWorkspaceTemplateStore added in v0.52.0

func NewWorkspaceTemplateStore(store IStore) (stores.WorkspaceTemplateStore, error)

Types

type ApiKeyStore

type ApiKeyStore struct {
	IStore
}

func (*ApiKeyStore) Delete

func (a *ApiKeyStore) Delete(ctx context.Context, apiKey *models.ApiKey) error

func (*ApiKeyStore) Find

func (a *ApiKeyStore) Find(ctx context.Context, key string) (*models.ApiKey, error)

func (*ApiKeyStore) FindByName

func (a *ApiKeyStore) FindByName(ctx context.Context, name string) (*models.ApiKey, error)

func (*ApiKeyStore) List

func (a *ApiKeyStore) List(ctx context.Context) ([]*models.ApiKey, error)

func (*ApiKeyStore) Save

func (a *ApiKeyStore) Save(ctx context.Context, apiKey *models.ApiKey) error

type BuildStore added in v0.25.0

type BuildStore struct {
	IStore
	Lock sync.Mutex
}

func (*BuildStore) Delete added in v0.25.0

func (b *BuildStore) Delete(ctx context.Context, id string) error

func (*BuildStore) Find added in v0.25.0

func (b *BuildStore) Find(ctx context.Context, filter *stores.BuildFilter) (*models.Build, error)

func (*BuildStore) List added in v0.25.0

func (b *BuildStore) List(ctx context.Context, filter *stores.BuildFilter) ([]*models.Build, error)

func (*BuildStore) Save added in v0.25.0

func (b *BuildStore) Save(ctx context.Context, build *models.Build) error

type EnvironmentVariableStore added in v0.52.0

type EnvironmentVariableStore struct {
	IStore
}

func (*EnvironmentVariableStore) Delete added in v0.52.0

func (store *EnvironmentVariableStore) Delete(ctx context.Context, key string) error

func (*EnvironmentVariableStore) List added in v0.52.0

func (*EnvironmentVariableStore) Save added in v0.52.0

func (store *EnvironmentVariableStore) Save(ctx context.Context, environmentVariable *models.EnvironmentVariable) error

type GitProviderConfigStore

type GitProviderConfigStore struct {
	IStore
}

func (*GitProviderConfigStore) Delete

func (p *GitProviderConfigStore) Delete(ctx context.Context, gitProvider *models.GitProviderConfig) error

func (*GitProviderConfigStore) Find

func (*GitProviderConfigStore) List

func (*GitProviderConfigStore) Save

type IStore added in v0.52.0

type IStore interface {
	stores.IStore
	AutoMigrate(...interface{}) error
	GetTransaction(ctx context.Context) *gorm.DB
}

func NewStore added in v0.52.0

func NewStore(db *gorm.DB) IStore

type JobStore added in v0.52.0

type JobStore struct {
	IStore
}

func (*JobStore) Delete added in v0.52.0

func (s *JobStore) Delete(ctx context.Context, job *models.Job) error

func (*JobStore) Find added in v0.52.0

func (s *JobStore) Find(ctx context.Context, filter *stores.JobFilter) (*models.Job, error)

func (*JobStore) List added in v0.52.0

func (s *JobStore) List(ctx context.Context, filter *stores.JobFilter) ([]*models.Job, error)

func (*JobStore) Save added in v0.52.0

func (s *JobStore) Save(ctx context.Context, job *models.Job) error

type RunnerMetadataStore added in v0.52.0

type RunnerMetadataStore struct {
	IStore
}

func (*RunnerMetadataStore) Delete added in v0.52.0

func (s *RunnerMetadataStore) Delete(ctx context.Context, runnerMetadata *models.RunnerMetadata) error

func (*RunnerMetadataStore) Find added in v0.52.0

func (*RunnerMetadataStore) List added in v0.52.0

func (*RunnerMetadataStore) Save added in v0.52.0

func (s *RunnerMetadataStore) Save(ctx context.Context, runnerMetadata *models.RunnerMetadata) error

type RunnerStore added in v0.52.0

type RunnerStore struct {
	IStore
}

func (*RunnerStore) Delete added in v0.52.0

func (s *RunnerStore) Delete(ctx context.Context, runner *models.Runner) error

func (*RunnerStore) Find added in v0.52.0

func (s *RunnerStore) Find(ctx context.Context, idOrName string) (*models.Runner, error)

func (*RunnerStore) List added in v0.52.0

func (s *RunnerStore) List(ctx context.Context) ([]*models.Runner, error)

func (*RunnerStore) Save added in v0.52.0

func (s *RunnerStore) Save(ctx context.Context, runner *models.Runner) error

type TargetConfigStore added in v0.52.0

type TargetConfigStore struct {
	IStore
}

func (*TargetConfigStore) Find added in v0.52.0

func (s *TargetConfigStore) Find(ctx context.Context, idOrName string, allowDeleted bool) (*models.TargetConfig, error)

func (*TargetConfigStore) List added in v0.52.0

func (s *TargetConfigStore) List(ctx context.Context, allowDeleted bool) ([]*models.TargetConfig, error)

func (*TargetConfigStore) Save added in v0.52.0

func (s *TargetConfigStore) Save(ctx context.Context, targetConfig *models.TargetConfig) error

type TargetMetadataStore added in v0.52.0

type TargetMetadataStore struct {
	IStore
}

func (*TargetMetadataStore) Delete added in v0.52.0

func (s *TargetMetadataStore) Delete(ctx context.Context, targetMetadata *models.TargetMetadata) error

func (*TargetMetadataStore) Find added in v0.52.0

func (*TargetMetadataStore) Save added in v0.52.0

func (s *TargetMetadataStore) Save(ctx context.Context, targetMetadata *models.TargetMetadata) error

type TargetStore added in v0.52.0

type TargetStore struct {
	IStore
}

func (*TargetStore) Delete added in v0.52.0

func (s *TargetStore) Delete(ctx context.Context, t *models.Target) error

func (*TargetStore) Find added in v0.52.0

func (s *TargetStore) Find(ctx context.Context, filter *stores.TargetFilter) (*models.Target, error)

func (*TargetStore) List added in v0.52.0

func (s *TargetStore) List(ctx context.Context, filter *stores.TargetFilter) ([]*models.Target, error)

func (*TargetStore) Save added in v0.52.0

func (s *TargetStore) Save(ctx context.Context, target *models.Target) error

type WorkspaceMetadataStore added in v0.52.0

type WorkspaceMetadataStore struct {
	IStore
}

func (*WorkspaceMetadataStore) Delete added in v0.52.0

func (s *WorkspaceMetadataStore) Delete(ctx context.Context, workspaceMetadata *models.WorkspaceMetadata) error

func (*WorkspaceMetadataStore) Find added in v0.52.0

func (*WorkspaceMetadataStore) Save added in v0.52.0

func (s *WorkspaceMetadataStore) Save(ctx context.Context, workspaceMetadata *models.WorkspaceMetadata) error

type WorkspaceStore

type WorkspaceStore struct {
	IStore
}

func (*WorkspaceStore) Delete

func (s *WorkspaceStore) Delete(ctx context.Context, workspace *models.Workspace) error

func (*WorkspaceStore) Find

func (s *WorkspaceStore) Find(ctx context.Context, idOrName string) (*models.Workspace, error)

func (*WorkspaceStore) List

func (s *WorkspaceStore) List(ctx context.Context) ([]*models.Workspace, error)

func (*WorkspaceStore) Save

func (s *WorkspaceStore) Save(ctx context.Context, workspace *models.Workspace) error

type WorkspaceTemplateStore added in v0.52.0

type WorkspaceTemplateStore struct {
	IStore
}

func (*WorkspaceTemplateStore) Delete added in v0.52.0

func (s *WorkspaceTemplateStore) Delete(ctx context.Context, workspaceTemplate *models.WorkspaceTemplate) error

func (*WorkspaceTemplateStore) Find added in v0.52.0

func (*WorkspaceTemplateStore) List added in v0.52.0

func (*WorkspaceTemplateStore) Save added in v0.52.0

func (s *WorkspaceTemplateStore) Save(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