github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/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 "github.com/hashicorp/nomad/client/dynamicplugins" 7 driverstate "github.com/hashicorp/nomad/client/pluginmanager/drivermanager/state" 8 "github.com/hashicorp/nomad/nomad/structs" 9 ) 10 11 // NoopDB implements a StateDB that does not persist any data. 12 type NoopDB struct{} 13 14 func (n NoopDB) Name() string { 15 return "noopdb" 16 } 17 18 func (n NoopDB) Upgrade() error { 19 return nil 20 } 21 22 func (n NoopDB) GetAllAllocations() ([]*structs.Allocation, map[string]error, error) { 23 return nil, nil, nil 24 } 25 26 func (n NoopDB) PutAllocation(*structs.Allocation) error { 27 return nil 28 } 29 30 func (n NoopDB) GetDeploymentStatus(allocID string) (*structs.AllocDeploymentStatus, error) { 31 return nil, nil 32 } 33 34 func (n NoopDB) PutDeploymentStatus(allocID string, ds *structs.AllocDeploymentStatus) error { 35 return nil 36 } 37 38 func (n NoopDB) GetTaskRunnerState(allocID string, taskName string) (*state.LocalState, *structs.TaskState, error) { 39 return nil, nil, nil 40 } 41 42 func (n NoopDB) PutTaskRunnerLocalState(allocID string, taskName string, val *state.LocalState) error { 43 return nil 44 } 45 46 func (n NoopDB) PutTaskState(allocID string, taskName string, state *structs.TaskState) error { 47 return nil 48 } 49 50 func (n NoopDB) DeleteTaskBucket(allocID, taskName string) error { 51 return nil 52 } 53 54 func (n NoopDB) DeleteAllocationBucket(allocID string) error { 55 return nil 56 } 57 58 func (n NoopDB) PutDevicePluginState(ps *dmstate.PluginState) error { 59 return nil 60 } 61 62 func (n NoopDB) GetDevicePluginState() (*dmstate.PluginState, error) { 63 return nil, nil 64 } 65 66 func (n NoopDB) PutDriverPluginState(ps *driverstate.PluginState) error { 67 return nil 68 } 69 70 func (n NoopDB) GetDriverPluginState() (*driverstate.PluginState, error) { 71 return nil, nil 72 } 73 74 func (n NoopDB) PutDynamicPluginRegistryState(ps *dynamicplugins.RegistryState) error { 75 return nil 76 } 77 78 func (n NoopDB) GetDynamicPluginRegistryState() (*dynamicplugins.RegistryState, error) { 79 return nil, nil 80 } 81 82 func (n NoopDB) Close() error { 83 return nil 84 }