gaia: github.com/gaia-pipeline/gaia/store/memdb Index | Files

package memdb

import "github.com/gaia-pipeline/gaia/store/memdb"

Index

Package Files

memdb.go memdb_schema.go

type GaiaMemDB Uses

type GaiaMemDB interface {
    // SyncStore syncs the memdb with the store.
    SyncStore() error

    // GetAllWorker returns all worker.
    GetAllWorker() []*gaia.Worker

    // UpsertWorker inserts or updates the given worker in the memdb.
    // If persist is true, the given worker will be persisted in the store.
    UpsertWorker(w *gaia.Worker, persist bool) error

    // GetWorker returns a worker by the given identifier.
    GetWorker(id string) (*gaia.Worker, error)

    // DeleteWorker deletes a worker by the given identifier.
    // If persist is true, the worker will also be deleted from the store.
    DeleteWorker(id string, persist bool) error

    // InsertPipelineRun inserts a pipeline run in the memdb.
    InsertPipelineRun(p *gaia.PipelineRun) error

    // PopPipelineRun gets the oldest pipeline run by tags and removes it immediately
    // from the memdb.
    PopPipelineRun(tags []string) (*gaia.PipelineRun, error)
}

GaiaMemDB is the interface used to talk to the MemDB implementation.

func InitMemDB Uses

func InitMemDB(s store.GaiaStore) (GaiaMemDB, error)

InitMemDB initiates a new memdb db.

type MemDB Uses

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

MemDB represents the implementation of the MemDB interface.

func (*MemDB) DeleteWorker Uses

func (m *MemDB) DeleteWorker(id string, persist bool) error

DeleteWorker deletes a worker from the memdb. If persist is true, the worker will also be deleted from the store.

func (*MemDB) GetAllWorker Uses

func (m *MemDB) GetAllWorker() []*gaia.Worker

GetAllWorker returns all worker.

func (*MemDB) GetWorker Uses

func (m *MemDB) GetWorker(id string) (*gaia.Worker, error)

GetWorker returns a worker by the given identifier.

func (*MemDB) InsertPipelineRun Uses

func (m *MemDB) InsertPipelineRun(p *gaia.PipelineRun) error

InsertPipelineRun inserts a pipeline run into the memdb.

func (*MemDB) PopPipelineRun Uses

func (m *MemDB) PopPipelineRun(tags []string) (*gaia.PipelineRun, error)

PopPipelineRun gets the oldest pipeline run filtered by tags and removes it immediately from the memdb.

func (*MemDB) SyncStore Uses

func (m *MemDB) SyncStore() error

SyncStore syncs the memdb with the store.

func (*MemDB) UpsertWorker Uses

func (m *MemDB) UpsertWorker(w *gaia.Worker, persist bool) error

UpsertWorker inserts or updates the given worker in the memdb. If persist is true, the given worker will be persisted in the store.

Package memdb imports 6 packages (graph) and is imported by 2 packages. Updated 2019-08-23. Refresh now. Tools for package owners.