github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/client/state/db_noop.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/client/serviceregistration/checks"
     9  	"github.com/hashicorp/nomad/nomad/structs"
    10  )
    11  
    12  // NoopDB implements a StateDB that does not persist any data.
    13  type NoopDB struct{}
    14  
    15  func (n NoopDB) Name() string {
    16  	return "noopdb"
    17  }
    18  
    19  func (n NoopDB) Upgrade() error {
    20  	return nil
    21  }
    22  
    23  func (n NoopDB) GetAllAllocations() ([]*structs.Allocation, map[string]error, error) {
    24  	return nil, nil, nil
    25  }
    26  
    27  func (n NoopDB) PutAllocation(alloc *structs.Allocation, opts ...WriteOption) error {
    28  	return nil
    29  }
    30  
    31  func (n NoopDB) GetDeploymentStatus(allocID string) (*structs.AllocDeploymentStatus, error) {
    32  	return nil, nil
    33  }
    34  
    35  func (n NoopDB) PutDeploymentStatus(allocID string, ds *structs.AllocDeploymentStatus) error {
    36  	return nil
    37  }
    38  
    39  func (n NoopDB) GetNetworkStatus(allocID string) (*structs.AllocNetworkStatus, error) {
    40  	return nil, nil
    41  }
    42  
    43  func (n NoopDB) PutNetworkStatus(allocID string, ds *structs.AllocNetworkStatus, opts ...WriteOption) error {
    44  	return nil
    45  }
    46  
    47  func (n NoopDB) GetTaskRunnerState(allocID string, taskName string) (*state.LocalState, *structs.TaskState, error) {
    48  	return nil, nil, nil
    49  }
    50  
    51  func (n NoopDB) PutTaskRunnerLocalState(allocID string, taskName string, val *state.LocalState) error {
    52  	return nil
    53  }
    54  
    55  func (n NoopDB) PutTaskState(allocID string, taskName string, state *structs.TaskState) error {
    56  	return nil
    57  }
    58  
    59  func (n NoopDB) DeleteTaskBucket(allocID, taskName string) error {
    60  	return nil
    61  }
    62  
    63  func (n NoopDB) DeleteAllocationBucket(allocID string, opts ...WriteOption) error {
    64  	return nil
    65  }
    66  
    67  func (n NoopDB) PutDevicePluginState(ps *dmstate.PluginState) error {
    68  	return nil
    69  }
    70  
    71  func (n NoopDB) GetDevicePluginState() (*dmstate.PluginState, error) {
    72  	return nil, nil
    73  }
    74  
    75  func (n NoopDB) PutDriverPluginState(ps *driverstate.PluginState) error {
    76  	return nil
    77  }
    78  
    79  func (n NoopDB) GetDriverPluginState() (*driverstate.PluginState, error) {
    80  	return nil, nil
    81  }
    82  
    83  func (n NoopDB) PutDynamicPluginRegistryState(ps *dynamicplugins.RegistryState) error {
    84  	return nil
    85  }
    86  
    87  func (n NoopDB) GetDynamicPluginRegistryState() (*dynamicplugins.RegistryState, error) {
    88  	return nil, nil
    89  }
    90  
    91  func (n NoopDB) PutCheckResult(allocID string, qr *structs.CheckQueryResult) error {
    92  	return nil
    93  }
    94  
    95  func (n NoopDB) GetCheckResults() (checks.ClientResults, error) {
    96  	return nil, nil
    97  }
    98  
    99  func (n NoopDB) DeleteCheckResults(allocID string, checkIDs []structs.CheckID) error {
   100  	return nil
   101  }
   102  
   103  func (n NoopDB) PurgeCheckResults(allocID string) error {
   104  	return nil
   105  }
   106  
   107  func (n NoopDB) Close() error {
   108  	return nil
   109  }