Files
nomad/client/state/interface.go
2018-10-16 16:56:56 -07:00

19 lines
688 B
Go

package state
import (
"github.com/hashicorp/nomad/client/allocrunner/taskrunner/state"
"github.com/hashicorp/nomad/nomad/structs"
)
// StateDB implementations store and load Nomad client state.
type StateDB interface {
GetAllAllocations() ([]*structs.Allocation, map[string]error, error)
PutAllocation(*structs.Allocation) error
GetTaskRunnerState(allocID, taskName string) (*state.LocalState, *structs.TaskState, error)
PutTaskRunnerLocalState(allocID, taskName string, val interface{}) error
PutTaskState(allocID, taskName string, state *structs.TaskState) error
DeleteTaskBucket(allocID, taskName string) error
DeleteAllocationBucket(allocID string) error
Close() error
}