gaia: Index | Files | Directories

package store

import ""


Package Files

permission.go pipeline.go settings.go sha_pair.go store.go upgrade.go user.go worker.go

type BoltStore Uses

type BoltStore struct {
    // contains filtered or unexported fields

BoltStore represents the access type for store

func NewBoltStore Uses

func NewBoltStore() *BoltStore

NewBoltStore creates a new instance of Store.

func (*BoltStore) Close Uses

func (s *BoltStore) Close() error

Close closes the active boltdb connection.

func (*BoltStore) CreatePermissionsIfNotExisting Uses

func (s *BoltStore) CreatePermissionsIfNotExisting() error

CreatePermissionsIfNotExisting iterates any existing users and creates default permissions if they don't exist. This is most probably when they have upgraded to the Gaia version where permissions was added.

func (*BoltStore) CreatePipelineGet Uses

func (s *BoltStore) CreatePipelineGet() ([]gaia.CreatePipeline, error)

CreatePipelineGet returns all available create pipeline objects in the store.

func (*BoltStore) CreatePipelinePut Uses

func (s *BoltStore) CreatePipelinePut(p *gaia.CreatePipeline) error

CreatePipelinePut adds a pipeline which is not yet compiled but is about to.

func (*BoltStore) GetSHAPair Uses

func (s *BoltStore) GetSHAPair(pipelineID int) (ok bool, pair gaia.SHAPair, err error)

GetSHAPair returns a pair of shas for this pipeline run.

func (*BoltStore) Init Uses

func (s *BoltStore) Init(dataPath string) error

Init creates the data folder if not exists, generates private key and bolt database. This should be called only once per database because bolt holds a lock on the database file.

func (*BoltStore) PipelineDelete Uses

func (s *BoltStore) PipelineDelete(id int) error

PipelineDelete deletes the pipeline with the given id.

func (*BoltStore) PipelineGet Uses

func (s *BoltStore) PipelineGet(id int) (*gaia.Pipeline, error)

PipelineGet gets a pipeline by given id.

func (*BoltStore) PipelineGetAllRuns Uses

func (s *BoltStore) PipelineGetAllRuns() ([]gaia.PipelineRun, error)

PipelineGetAllRuns loads all existing pipeline runs.

func (*BoltStore) PipelineGetAllRunsByPipelineID Uses

func (s *BoltStore) PipelineGetAllRunsByPipelineID(pipelineID int) ([]gaia.PipelineRun, error)

PipelineGetAllRunsByPipelineID looks for all pipeline runs by the given pipeline id.

func (*BoltStore) PipelineGetByName Uses

func (s *BoltStore) PipelineGetByName(n string) (*gaia.Pipeline, error)

PipelineGetByName looks up a pipeline by the given name. Returns nil if pipeline was not found.

func (*BoltStore) PipelineGetLatestRun Uses

func (s *BoltStore) PipelineGetLatestRun(pipelineID int) (*gaia.PipelineRun, error)

PipelineGetLatestRun returns the latest run by the given pipeline id.

func (*BoltStore) PipelineGetRunByPipelineIDAndID Uses

func (s *BoltStore) PipelineGetRunByPipelineIDAndID(pipelineid int, runid int) (*gaia.PipelineRun, error)

PipelineGetRunByPipelineIDAndID looks for pipeline run by given pipeline id and run id.

func (*BoltStore) PipelineGetRunHighestID Uses

func (s *BoltStore) PipelineGetRunHighestID(p *gaia.Pipeline) (int, error)

PipelineGetRunHighestID looks for the highest public id for the given pipeline.

func (*BoltStore) PipelineGetScheduled Uses

func (s *BoltStore) PipelineGetScheduled(limit int) ([]*gaia.PipelineRun, error)

PipelineGetScheduled returns the scheduled pipelines with a return limit.

func (*BoltStore) PipelinePut Uses

func (s *BoltStore) PipelinePut(p *gaia.Pipeline) error

PipelinePut puts a pipeline into the store. On persist, the pipeline will get a unique id.

func (*BoltStore) PipelinePutRun Uses

func (s *BoltStore) PipelinePutRun(r *gaia.PipelineRun) error

PipelinePutRun takes the given pipeline run and puts it into the store. If a pipeline run already exists in the store it will be overwritten.

func (*BoltStore) PipelineRunDelete Uses

func (s *BoltStore) PipelineRunDelete(uniqueID string) error

PipelineRunDelete deletes the pipeline run with the given id.

func (*BoltStore) SettingsGet Uses

func (s *BoltStore) SettingsGet() (*gaia.StoreConfig, error)

SettingsGet gets a pipeline by given id.

func (*BoltStore) SettingsPut Uses

func (s *BoltStore) SettingsPut(c *gaia.StoreConfig) error

SettingsPut puts settings into the store.

func (*BoltStore) UpsertSHAPair Uses

func (s *BoltStore) UpsertSHAPair(pair gaia.SHAPair) error

UpsertSHAPair creates or updates a record for a SHA pair of the original SHA and the rebuilt Worker SHA for a pipeline.

func (*BoltStore) UserAuth Uses

func (s *BoltStore) UserAuth(u *gaia.User, updateLastLogin bool) (*gaia.User, error)

UserAuth looks up a user by given username. Then it compares passwords and returns user obj if given password is valid. Returns nil if password was wrong or user not found.

func (*BoltStore) UserDelete Uses

func (s *BoltStore) UserDelete(u string) error

UserDelete deletes the given user.

func (*BoltStore) UserGet Uses

func (s *BoltStore) UserGet(username string) (*gaia.User, error)

UserGet looks up a user by given username. Returns nil if user was not found.

func (*BoltStore) UserGetAll Uses

func (s *BoltStore) UserGetAll() ([]gaia.User, error)

UserGetAll returns all stored users.

func (*BoltStore) UserPermissionsDelete Uses

func (s *BoltStore) UserPermissionsDelete(username string) error

UserPermissionsDelete deletes permission data for a given username.

func (*BoltStore) UserPermissionsGet Uses

func (s *BoltStore) UserPermissionsGet(username string) (*gaia.UserPermission, error)

UserPermissionsGet gets the permission data for a given username.

func (*BoltStore) UserPermissionsPut Uses

func (s *BoltStore) UserPermissionsPut(perms *gaia.UserPermission) error

UserPermissionsPut adds or updates user permissions.

func (*BoltStore) UserPut Uses

func (s *BoltStore) UserPut(u *gaia.User, encryptPassword bool) error

UserPut takes the given user and saves it to the bolt database. User will be overwritten if it already exists. It also clears the password field afterwards.

func (*BoltStore) WorkerDelete Uses

func (s *BoltStore) WorkerDelete(id string) error

WorkerDelete deletes a worker by the given identifier.

func (*BoltStore) WorkerDeleteAll Uses

func (s *BoltStore) WorkerDeleteAll() error

WorkerDeleteAll deletes all worker objects in the bucket.

func (*BoltStore) WorkerGet Uses

func (s *BoltStore) WorkerGet(id string) (*gaia.Worker, error)

WorkerGet gets a worker by the given identifier.

func (*BoltStore) WorkerGetAll Uses

func (s *BoltStore) WorkerGetAll() ([]*gaia.Worker, error)

WorkerGetAll returns all existing worker objects from the store. It returns an error when the action failed.

func (*BoltStore) WorkerPut Uses

func (s *BoltStore) WorkerPut(w *gaia.Worker) error

WorkerPut stores the given worker in the bolt database. Worker object will be overwritten in case it already exist.

type GaiaStore Uses

type GaiaStore interface {
    Init(dataPath string) error
    Close() error
    CreatePipelinePut(createPipeline *gaia.CreatePipeline) error
    CreatePipelineGet() (listOfPipelines []gaia.CreatePipeline, err error)
    PipelinePut(pipeline *gaia.Pipeline) error
    PipelineGet(id int) (pipeline *gaia.Pipeline, err error)
    PipelineGetByName(name string) (pipline *gaia.Pipeline, err error)
    PipelineGetRunHighestID(pipeline *gaia.Pipeline) (id int, err error)
    PipelinePutRun(r *gaia.PipelineRun) error
    PipelineGetScheduled(limit int) ([]*gaia.PipelineRun, error)
    PipelineGetRunByPipelineIDAndID(pipelineid int, runid int) (*gaia.PipelineRun, error)
    PipelineGetAllRuns() ([]gaia.PipelineRun, error)
    PipelineGetAllRunsByPipelineID(pipelineID int) ([]gaia.PipelineRun, error)
    PipelineGetLatestRun(pipelineID int) (*gaia.PipelineRun, error)
    PipelineDelete(id int) error
    PipelineRunDelete(uniqueID string) error
    UserPut(u *gaia.User, encryptPassword bool) error
    UserAuth(u *gaia.User, updateLastLogin bool) (*gaia.User, error)
    UserGet(username string) (*gaia.User, error)
    UserGetAll() ([]gaia.User, error)
    UserDelete(u string) error
    UserPermissionsPut(perms *gaia.UserPermission) error
    UserPermissionsGet(username string) (*gaia.UserPermission, error)
    UserPermissionsDelete(username string) error
    SettingsPut(config *gaia.StoreConfig) error
    SettingsGet() (*gaia.StoreConfig, error)
    WorkerPut(w *gaia.Worker) error
    WorkerGetAll() ([]*gaia.Worker, error)
    WorkerDelete(id string) error
    WorkerDeleteAll() error
    WorkerGet(id string) (*gaia.Worker, error)
    UpsertSHAPair(pair gaia.SHAPair) error
    GetSHAPair(pipelineID int) (bool, gaia.SHAPair, error)

GaiaStore is the interface that defines methods needed to store pipeline and user related information.



Package store imports 10 packages (graph) and is imported by 7 packages. Updated 2019-10-30. Refresh now. Tools for package owners.