Documentation ¶
Index ¶
- type GaiaMemDB
- type MemDB
- func (m *MemDB) DeleteDockerWorker(workerID string) error
- func (m *MemDB) DeletePipelineRun(runID string) error
- func (m *MemDB) DeleteWorker(id string, persist bool) error
- func (m *MemDB) GetAllDockerWorker() ([]*docker.Worker, error)
- func (m *MemDB) GetAllWorker() []*gaia.Worker
- func (m *MemDB) GetDockerWorker(workerID string) (*docker.Worker, error)
- func (m *MemDB) GetWorker(id string) (*gaia.Worker, error)
- func (m *MemDB) InsertDockerWorker(w *docker.Worker) error
- func (m *MemDB) InsertPipelineRun(p *gaia.PipelineRun) error
- func (m *MemDB) PopPipelineRun(tags []string) (*gaia.PipelineRun, error)
- func (m *MemDB) SyncStore() error
- func (m *MemDB) UpsertWorker(w *gaia.Worker, persist bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GaiaMemDB ¶
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) // DeletePipelineRun deletes the given pipeline run from the memdb. DeletePipelineRun(runID string) error // InsertDockerWorker inserts a docker worker into the memdb. InsertDockerWorker(w *docker.Worker) error // GetDockerWorker gets the docker worker by the given worker id. GetDockerWorker(workerID string) (*docker.Worker, error) // DeleteDockerWorker deletes the docker worker by then given worker id. DeleteDockerWorker(workerID string) error // GetAllDockerWorker gets all docker worker. GetAllDockerWorker() ([]*docker.Worker, error) }
GaiaMemDB is the interface used to talk to the MemDB implementation.
type MemDB ¶
type MemDB struct {
// contains filtered or unexported fields
}
MemDB represents the implementation of the MemDB interface.
func (*MemDB) DeleteDockerWorker ¶
DeleteDockerWorker deletes the docker worker by then given worker id.
func (*MemDB) DeletePipelineRun ¶
DeletePipelineRun deletes the given pipeline run from the memdb.
func (*MemDB) DeleteWorker ¶
DeleteWorker deletes a worker from the memdb. If persist is true, the worker will also be deleted from the store.
func (*MemDB) GetAllDockerWorker ¶
GetAllDockerWorker gets all docker worker.
func (*MemDB) GetAllWorker ¶
GetAllWorker returns all worker.
func (*MemDB) GetDockerWorker ¶
GetDockerWorker returns the docker worker by the given worker id.
func (*MemDB) InsertDockerWorker ¶
InsertDockerWorker inserts a docker worker into the memdb.
func (*MemDB) InsertPipelineRun ¶
func (m *MemDB) InsertPipelineRun(p *gaia.PipelineRun) error
InsertPipelineRun inserts a pipeline run into the memdb.
func (*MemDB) PopPipelineRun ¶
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.