Documentation ¶
Index ¶
- Constants
- func GetDatabase(path string) (*bolt.DB, error)
- type StateCounter
- type Store
- func (s *Store) Close(ctx context.Context) error
- func (s *Store) CreateExecution(ctx context.Context, localExecutionState store.LocalExecutionState) error
- func (s *Store) DeleteExecution(ctx context.Context, executionID string) error
- func (s *Store) GetExecution(ctx context.Context, executionID string) (store.LocalExecutionState, error)
- func (s *Store) GetExecutionCount(ctx context.Context, state store.LocalExecutionStateType) (uint64, error)
- func (s *Store) GetExecutionHistory(ctx context.Context, executionID string) ([]store.LocalStateHistory, error)
- func (s *Store) GetExecutions(ctx context.Context, jobID string) ([]store.LocalExecutionState, error)
- func (s *Store) GetLiveExecutions(ctx context.Context) ([]store.LocalExecutionState, error)
- func (s *Store) UpdateExecutionState(ctx context.Context, request store.UpdateExecutionStateRequest) error
Constants ¶
const ( DefaultSliceRetrievalCapacity = 10 BucketExecutionsName = "execution" BucketHistoryName = "execution-history" BucketJobIndexName = "execution-index" BucketLiveIndexName = "execution-live-index" )
const (
DefaultDatabasePermissions = 0600
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StateCounter ¶
type StateCounter struct {
// contains filtered or unexported fields
}
func NewStateCounter ¶
func NewStateCounter() *StateCounter
func (*StateCounter) DecrementState ¶
func (s *StateCounter) DecrementState(key store.LocalExecutionStateType, amount uint64)
func (*StateCounter) Get ¶
func (s *StateCounter) Get(key store.LocalExecutionStateType) uint64
func (*StateCounter) Include ¶
func (s *StateCounter) Include(other *StateCounter)
func (*StateCounter) IncrementState ¶
func (s *StateCounter) IncrementState(key store.LocalExecutionStateType, amount uint64)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
NewStore creates a new store backed by a boltdb database at the file location provided by the caller. During initialisation the primary buckets are created, but they are not stored in the struct as they are tied to the transaction where they are referenced and it would mean later transactions will fail unless they obtain their own reference to the bucket.
func (*Store) CreateExecution ¶
func (s *Store) CreateExecution(ctx context.Context, localExecutionState store.LocalExecutionState) error
CreateExecution creates a new execution in the database and also sets up the relevant index entry for the new execution.
func (*Store) DeleteExecution ¶
DeleteExecution delete the execution, removes its history and removes it from the job index (along with the job indexes bucket)
func (*Store) GetExecution ¶
func (s *Store) GetExecution(ctx context.Context, executionID string) (store.LocalExecutionState, error)
GetExecution returns the stored LocalExecutionState structure for the provided execution ID.
func (*Store) GetExecutionCount ¶
func (*Store) GetExecutionHistory ¶
func (s *Store) GetExecutionHistory(ctx context.Context, executionID string) ([]store.LocalStateHistory, error)
GetExecutionHistory retrieves the execution history for a single execution specified by the executionID parameter.
func (*Store) GetExecutions ¶
func (s *Store) GetExecutions(ctx context.Context, jobID string) ([]store.LocalExecutionState, error)
GetExecutions retrieves akk if the executions from the job-index bucket for the provided Job ID.
func (*Store) GetLiveExecutions ¶
func (*Store) UpdateExecutionState ¶
func (s *Store) UpdateExecutionState(ctx context.Context, request store.UpdateExecutionStateRequest) error
UpdateExecutionState updates the current state of the execution