github.com/bigcommerce/nomad@v0.9.3-bc/client/state/noopdb.go (about) 1 package state 2 3 import ( 4 "github.com/hashicorp/nomad/client/allocrunner/taskrunner/state" 5 dmstate "github.com/hashicorp/nomad/client/devicemanager/state" 6 driverstate "github.com/hashicorp/nomad/client/pluginmanager/drivermanager/state" 7 "github.com/hashicorp/nomad/nomad/structs" 8 ) 9 10 // NoopDB implements a StateDB that does not persist any data. 11 type NoopDB struct{} 12 13 func (n NoopDB) Name() string { 14 return "noopdb" 15 } 16 17 func (n NoopDB) Upgrade() error { 18 return nil 19 } 20 21 func (n NoopDB) GetAllAllocations() ([]*structs.Allocation, map[string]error, error) { 22 return nil, nil, nil 23 } 24 25 func (n NoopDB) PutAllocation(*structs.Allocation) error { 26 return nil 27 } 28 29 func (n NoopDB) GetDeploymentStatus(allocID string) (*structs.AllocDeploymentStatus, error) { 30 return nil, nil 31 } 32 33 func (n NoopDB) PutDeploymentStatus(allocID string, ds *structs.AllocDeploymentStatus) error { 34 return nil 35 } 36 37 func (n NoopDB) GetTaskRunnerState(allocID string, taskName string) (*state.LocalState, *structs.TaskState, error) { 38 return nil, nil, nil 39 } 40 41 func (n NoopDB) PutTaskRunnerLocalState(allocID string, taskName string, val *state.LocalState) error { 42 return nil 43 } 44 45 func (n NoopDB) PutTaskState(allocID string, taskName string, state *structs.TaskState) error { 46 return nil 47 } 48 49 func (n NoopDB) DeleteTaskBucket(allocID, taskName string) error { 50 return nil 51 } 52 53 func (n NoopDB) DeleteAllocationBucket(allocID string) error { 54 return nil 55 } 56 57 func (n NoopDB) PutDevicePluginState(ps *dmstate.PluginState) error { 58 return nil 59 } 60 61 func (n NoopDB) GetDevicePluginState() (*dmstate.PluginState, error) { 62 return nil, nil 63 } 64 65 func (n NoopDB) PutDriverPluginState(ps *driverstate.PluginState) error { 66 return nil 67 } 68 69 func (n NoopDB) GetDriverPluginState() (*driverstate.PluginState, error) { 70 return nil, nil 71 } 72 73 func (n NoopDB) Close() error { 74 return nil 75 }