db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB() *DB

func (*DB) AttachInstanceToJob

func (db *DB) AttachInstanceToJob(job *types.Job, instance types.Instance)

func (*DB) CreateInstance

func (db *DB) CreateInstance(instance *types.Instance) (*types.Instance, error)

func (*DB) CreateJob

func (db *DB) CreateJob(jobFile *types.JobFile) *types.Job

func (*DB) CreateMockInstance added in v0.2.8

func (db *DB) CreateMockInstance(id string) *types.Instance

func (*DB) CreateMockJob added in v1.0.0

func (db *DB) CreateMockJob(job *types.Job)

func (*DB) DeleteInstance

func (db *DB) DeleteInstance(instance *types.Instance) error

we implement gorm.Model in the instance struct, so these are soft deletes!

func (*DB) DeleteInstanceByProviderID

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

func (*DB) GetAllInstances

func (db *DB) GetAllInstances() []types.Instance

func (*DB) GetAllInstancesByProvider

func (db *DB) GetAllInstancesByProvider(provider string) []types.Instance

func (*DB) GetAllJobs

func (db *DB) GetAllJobs() []types.Job

func (*DB) GetAllRunningInstances

func (db *DB) GetAllRunningInstances() []types.Instance

func (*DB) GetInstanceByCedanaID

func (db *DB) GetInstanceByCedanaID(cid string) types.Instance

func (*DB) GetInstanceByProviderId

func (db *DB) GetInstanceByProviderId(id string) *types.Instance

func (*DB) GetInstancesByCondition

func (db *DB) GetInstancesByCondition(field string, query string) []types.Instance

func (*DB) GetInstancesByProvider

func (db *DB) GetInstancesByProvider(provider string) []types.Instance

func (*DB) GetInstancesByState

func (db *DB) GetInstancesByState(state string) []types.Instance

get conditionally

func (*DB) GetJob

func (db *DB) GetJob(id string) *types.Job

func (*DB) GetJobByFileName

func (db *DB) GetJobByFileName(name string) *types.Job

func (*DB) PurgeJobs

func (db *DB) PurgeJobs() error

func (*DB) UpdateInstance

func (db *DB) UpdateInstance(instance *types.Instance) error

func (*DB) UpdateInstanceByID

func (db *DB) UpdateInstanceByID(instance *types.Instance, id uint) error

func (*DB) UpdateJob

func (db *DB) UpdateJob(job *types.Job) error

func (*DB) UpdateJobState

func (db *DB) UpdateJobState(job *types.Job, state core.Flag) error

Jump to

Keyboard shortcuts

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