Documentation ¶
Overview ¶
Package jobstore is a generated GoMock package.
Index ¶
- Constants
- func NewBadRequestError(message string) bacerrors.Error
- func NewErrEvaluationAlreadyExists(id string) bacerrors.Error
- func NewErrEvaluationNotFound(id string) bacerrors.Error
- func NewErrExecutionAlreadyExists(id string) bacerrors.Error
- func NewErrExecutionAlreadyTerminal(id string, actual models.ExecutionStateType, ...) bacerrors.Error
- func NewErrExecutionNotFound(id string) bacerrors.Error
- func NewErrInvalidExecutionDesiredState(id string, actual models.ExecutionDesiredStateType, ...) bacerrors.Error
- func NewErrInvalidExecutionState(id string, actual models.ExecutionStateType, ...) bacerrors.Error
- func NewErrInvalidExecutionVersion(id string, actual, expected uint64) bacerrors.Error
- func NewErrInvalidJobState(id string, actual models.JobStateType, expected models.JobStateType) bacerrors.Error
- func NewErrInvalidJobVersion(id string, actual, expected uint64) bacerrors.Error
- func NewErrJobAlreadyExists(id string) bacerrors.Error
- func NewErrJobAlreadyTerminal(id string, actual models.JobStateType, newState models.JobStateType) bacerrors.Error
- func NewErrJobNotFound(id string) bacerrors.Error
- func NewErrMultipleEvaluationsFound(id string) bacerrors.Error
- func NewErrMultipleExecutionsFound(id string) bacerrors.Error
- func NewErrMultipleJobsFound(id string) bacerrors.Error
- func NewJobStoreError(message string) bacerrors.Error
- type GetExecutionsOptions
- type JobHistoryQuery
- type JobHistoryQueryResponse
- type JobQuery
- type JobQueryResponse
- type MockStore
- func (m *MockStore) AddExecutionHistory(ctx context.Context, jobID, executionID string, events ...models.Event) error
- func (m *MockStore) AddJobHistory(ctx context.Context, jobID string, events ...models.Event) error
- func (m *MockStore) BeginTx(ctx context.Context) (TxContext, error)
- func (m *MockStore) Close(ctx context.Context) error
- func (m *MockStore) CreateEvaluation(ctx context.Context, eval models.Evaluation) error
- func (m *MockStore) CreateExecution(ctx context.Context, execution models.Execution) error
- func (m *MockStore) CreateJob(ctx context.Context, j models.Job) error
- func (m *MockStore) DeleteEvaluation(ctx context.Context, id string) error
- func (m *MockStore) DeleteJob(ctx context.Context, jobID string) error
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) GetEvaluation(ctx context.Context, id string) (models.Evaluation, error)
- func (m *MockStore) GetEventStore() watcher.EventStore
- func (m *MockStore) GetExecutions(ctx context.Context, options GetExecutionsOptions) ([]models.Execution, error)
- func (m *MockStore) GetInProgressJobs(ctx context.Context, jobType string) ([]models.Job, error)
- func (m *MockStore) GetJob(ctx context.Context, id string) (models.Job, error)
- func (m *MockStore) GetJobHistory(ctx context.Context, jobID string, options JobHistoryQuery) (*JobHistoryQueryResponse, error)
- func (m *MockStore) GetJobs(ctx context.Context, query JobQuery) (*JobQueryResponse, error)
- func (m *MockStore) UpdateExecution(ctx context.Context, request UpdateExecutionRequest) error
- func (m *MockStore) UpdateJobState(ctx context.Context, request UpdateJobStateRequest) error
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) AddExecutionHistory(ctx, jobID, executionID interface{}, events ...interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) AddJobHistory(ctx, jobID interface{}, events ...interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) BeginTx(ctx interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) Close(ctx interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) CreateEvaluation(ctx, eval interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) CreateExecution(ctx, execution interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) CreateJob(ctx, j interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) DeleteEvaluation(ctx, id interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) DeleteJob(ctx, jobID interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetEvaluation(ctx, id interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetEventStore() *gomock.Call
- func (mr *MockStoreMockRecorder) GetExecutions(ctx, options interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetInProgressJobs(ctx, jobType interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetJob(ctx, id interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetJobHistory(ctx, jobID, options interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) GetJobs(ctx, query interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) UpdateExecution(ctx, request interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) UpdateJobState(ctx, request interface{}) *gomock.Call
- type MockTxContext
- func (m *MockTxContext) Commit() error
- func (m *MockTxContext) Deadline() (time.Time, bool)
- func (m *MockTxContext) Done() <-chan struct{}
- func (m *MockTxContext) EXPECT() *MockTxContextMockRecorder
- func (m *MockTxContext) Err() error
- func (m *MockTxContext) Rollback() error
- func (m *MockTxContext) Value(key any) any
- type MockTxContextMockRecorder
- func (mr *MockTxContextMockRecorder) Commit() *gomock.Call
- func (mr *MockTxContextMockRecorder) Deadline() *gomock.Call
- func (mr *MockTxContextMockRecorder) Done() *gomock.Call
- func (mr *MockTxContextMockRecorder) Err() *gomock.Call
- func (mr *MockTxContextMockRecorder) Rollback() *gomock.Call
- func (mr *MockTxContextMockRecorder) Value(key interface{}) *gomock.Call
- type Store
- type TxContext
- type UpdateExecutionCondition
- type UpdateExecutionRequest
- type UpdateJobCondition
- type UpdateJobStateRequest
Constants ¶
const ( // EventObjectExecutionUpsert is the event type for execution upsert events, which holds richer data // about the execution's update, such as the previous and new execution data, and any events. EventObjectExecutionUpsert = "ExecutionUpsert" // EventObjectEvaluation is the event type for evaluation events EventObjectEvaluation = "Evaluation" )
const ( ConflictJobState bacerrors.ErrorCode = "ConflictJobState" MultipleJobsFound bacerrors.ErrorCode = "MultipleJobsFound" MultipleExecutionsFound bacerrors.ErrorCode = "MultipleExecutionsFound" MultipleEvaluationsFound bacerrors.ErrorCode = "MultipleEvaluationsFound" ConflictJobVersion bacerrors.ErrorCode = "ConflictJobVersion" )
const JobStoreComponent = "JobStore"
Variables ¶
This section is empty.
Functions ¶
func NewBadRequestError ¶ added in v1.5.0
func NewErrEvaluationAlreadyExists ¶ added in v1.5.0
func NewErrEvaluationNotFound ¶ added in v1.5.0
func NewErrExecutionAlreadyTerminal ¶
func NewErrExecutionAlreadyTerminal(id string, actual models.ExecutionStateType, newState models.ExecutionStateType) bacerrors.Error
func NewErrExecutionNotFound ¶
func NewErrInvalidExecutionDesiredState ¶ added in v1.5.2
func NewErrInvalidExecutionDesiredState( id string, actual models.ExecutionDesiredStateType, expected ...models.ExecutionDesiredStateType) bacerrors.Error
func NewErrInvalidExecutionState ¶
func NewErrInvalidExecutionState(id string, actual models.ExecutionStateType, expected ...models.ExecutionStateType) bacerrors.Error
func NewErrInvalidJobState ¶
func NewErrInvalidJobState(id string, actual models.JobStateType, expected models.JobStateType) bacerrors.Error
func NewErrInvalidJobVersion ¶
func NewErrJobAlreadyExists ¶
func NewErrJobAlreadyTerminal ¶
func NewErrJobAlreadyTerminal(id string, actual models.JobStateType, newState models.JobStateType) bacerrors.Error
func NewErrJobNotFound ¶
func NewErrMultipleEvaluationsFound ¶ added in v1.5.0
func NewErrMultipleExecutionsFound ¶ added in v1.5.0
func NewErrMultipleJobsFound ¶ added in v1.5.0
func NewJobStoreError ¶ added in v1.5.0
Types ¶
type GetExecutionsOptions ¶ added in v1.2.2
type JobHistoryQuery ¶ added in v1.5.0
type JobHistoryQueryResponse ¶ added in v1.5.0
type JobHistoryQueryResponse struct { JobHistory []models.JobHistory Offset uint32 NextToken string }
type JobQuery ¶
type JobQuery struct { Namespace string // IncludeTags and ExcludeTags are used primarily by the requester's list API. // In the orchestrator API, we insted use the Selector field to filter jobs. IncludeTags []string ExcludeTags []string Limit uint32 Offset uint64 ReturnAll bool SortBy string SortReverse bool Selector labels.Selector }
type JobQueryResponse ¶ added in v1.2.2
type MockStore ¶ added in v1.0.4
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface.
func NewMockStore ¶ added in v1.0.4
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance.
func (*MockStore) AddExecutionHistory ¶ added in v1.5.0
func (m *MockStore) AddExecutionHistory(ctx context.Context, jobID, executionID string, events ...models.Event) error
AddExecutionHistory mocks base method.
func (*MockStore) AddJobHistory ¶ added in v1.5.0
AddJobHistory mocks base method.
func (*MockStore) CreateEvaluation ¶ added in v1.0.4
CreateEvaluation mocks base method.
func (*MockStore) CreateExecution ¶ added in v1.0.4
CreateExecution mocks base method.
func (*MockStore) DeleteEvaluation ¶ added in v1.0.4
DeleteEvaluation mocks base method.
func (*MockStore) EXPECT ¶ added in v1.0.4
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStore) GetEvaluation ¶ added in v1.0.4
GetEvaluation mocks base method.
func (*MockStore) GetEventStore ¶ added in v1.5.2
func (m *MockStore) GetEventStore() watcher.EventStore
GetEventStore mocks base method.
func (*MockStore) GetExecutions ¶ added in v1.0.4
func (m *MockStore) GetExecutions(ctx context.Context, options GetExecutionsOptions) ([]models.Execution, error)
GetExecutions mocks base method.
func (*MockStore) GetInProgressJobs ¶ added in v1.0.4
GetInProgressJobs mocks base method.
func (*MockStore) GetJobHistory ¶ added in v1.0.4
func (m *MockStore) GetJobHistory(ctx context.Context, jobID string, options JobHistoryQuery) (*JobHistoryQueryResponse, error)
GetJobHistory mocks base method.
func (*MockStore) UpdateExecution ¶ added in v1.0.4
func (m *MockStore) UpdateExecution(ctx context.Context, request UpdateExecutionRequest) error
UpdateExecution mocks base method.
func (*MockStore) UpdateJobState ¶ added in v1.0.4
func (m *MockStore) UpdateJobState(ctx context.Context, request UpdateJobStateRequest) error
UpdateJobState mocks base method.
type MockStoreMockRecorder ¶ added in v1.0.4
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore.
func (*MockStoreMockRecorder) AddExecutionHistory ¶ added in v1.5.0
func (mr *MockStoreMockRecorder) AddExecutionHistory(ctx, jobID, executionID interface{}, events ...interface{}) *gomock.Call
AddExecutionHistory indicates an expected call of AddExecutionHistory.
func (*MockStoreMockRecorder) AddJobHistory ¶ added in v1.5.0
func (mr *MockStoreMockRecorder) AddJobHistory(ctx, jobID interface{}, events ...interface{}) *gomock.Call
AddJobHistory indicates an expected call of AddJobHistory.
func (*MockStoreMockRecorder) BeginTx ¶ added in v1.3.1
func (mr *MockStoreMockRecorder) BeginTx(ctx interface{}) *gomock.Call
BeginTx indicates an expected call of BeginTx.
func (*MockStoreMockRecorder) Close ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) Close(ctx interface{}) *gomock.Call
Close indicates an expected call of Close.
func (*MockStoreMockRecorder) CreateEvaluation ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) CreateEvaluation(ctx, eval interface{}) *gomock.Call
CreateEvaluation indicates an expected call of CreateEvaluation.
func (*MockStoreMockRecorder) CreateExecution ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) CreateExecution(ctx, execution interface{}) *gomock.Call
CreateExecution indicates an expected call of CreateExecution.
func (*MockStoreMockRecorder) CreateJob ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) CreateJob(ctx, j interface{}) *gomock.Call
CreateJob indicates an expected call of CreateJob.
func (*MockStoreMockRecorder) DeleteEvaluation ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) DeleteEvaluation(ctx, id interface{}) *gomock.Call
DeleteEvaluation indicates an expected call of DeleteEvaluation.
func (*MockStoreMockRecorder) DeleteJob ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) DeleteJob(ctx, jobID interface{}) *gomock.Call
DeleteJob indicates an expected call of DeleteJob.
func (*MockStoreMockRecorder) GetEvaluation ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) GetEvaluation(ctx, id interface{}) *gomock.Call
GetEvaluation indicates an expected call of GetEvaluation.
func (*MockStoreMockRecorder) GetEventStore ¶ added in v1.5.2
func (mr *MockStoreMockRecorder) GetEventStore() *gomock.Call
GetEventStore indicates an expected call of GetEventStore.
func (*MockStoreMockRecorder) GetExecutions ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) GetExecutions(ctx, options interface{}) *gomock.Call
GetExecutions indicates an expected call of GetExecutions.
func (*MockStoreMockRecorder) GetInProgressJobs ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) GetInProgressJobs(ctx, jobType interface{}) *gomock.Call
GetInProgressJobs indicates an expected call of GetInProgressJobs.
func (*MockStoreMockRecorder) GetJob ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) GetJob(ctx, id interface{}) *gomock.Call
GetJob indicates an expected call of GetJob.
func (*MockStoreMockRecorder) GetJobHistory ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) GetJobHistory(ctx, jobID, options interface{}) *gomock.Call
GetJobHistory indicates an expected call of GetJobHistory.
func (*MockStoreMockRecorder) GetJobs ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) GetJobs(ctx, query interface{}) *gomock.Call
GetJobs indicates an expected call of GetJobs.
func (*MockStoreMockRecorder) UpdateExecution ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) UpdateExecution(ctx, request interface{}) *gomock.Call
UpdateExecution indicates an expected call of UpdateExecution.
func (*MockStoreMockRecorder) UpdateJobState ¶ added in v1.0.4
func (mr *MockStoreMockRecorder) UpdateJobState(ctx, request interface{}) *gomock.Call
UpdateJobState indicates an expected call of UpdateJobState.
type MockTxContext ¶ added in v1.3.1
type MockTxContext struct {
// contains filtered or unexported fields
}
MockTxContext is a mock of TxContext interface.
func NewMockTxContext ¶ added in v1.3.1
func NewMockTxContext(ctrl *gomock.Controller) *MockTxContext
NewMockTxContext creates a new mock instance.
func (*MockTxContext) Commit ¶ added in v1.3.1
func (m *MockTxContext) Commit() error
Commit mocks base method.
func (*MockTxContext) Deadline ¶ added in v1.3.1
func (m *MockTxContext) Deadline() (time.Time, bool)
Deadline mocks base method.
func (*MockTxContext) Done ¶ added in v1.3.1
func (m *MockTxContext) Done() <-chan struct{}
Done mocks base method.
func (*MockTxContext) EXPECT ¶ added in v1.3.1
func (m *MockTxContext) EXPECT() *MockTxContextMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTxContext) Err ¶ added in v1.3.1
func (m *MockTxContext) Err() error
Err mocks base method.
func (*MockTxContext) Rollback ¶ added in v1.3.1
func (m *MockTxContext) Rollback() error
Rollback mocks base method.
func (*MockTxContext) Value ¶ added in v1.3.1
func (m *MockTxContext) Value(key any) any
Value mocks base method.
type MockTxContextMockRecorder ¶ added in v1.3.1
type MockTxContextMockRecorder struct {
// contains filtered or unexported fields
}
MockTxContextMockRecorder is the mock recorder for MockTxContext.
func (*MockTxContextMockRecorder) Commit ¶ added in v1.3.1
func (mr *MockTxContextMockRecorder) Commit() *gomock.Call
Commit indicates an expected call of Commit.
func (*MockTxContextMockRecorder) Deadline ¶ added in v1.3.1
func (mr *MockTxContextMockRecorder) Deadline() *gomock.Call
Deadline indicates an expected call of Deadline.
func (*MockTxContextMockRecorder) Done ¶ added in v1.3.1
func (mr *MockTxContextMockRecorder) Done() *gomock.Call
Done indicates an expected call of Done.
func (*MockTxContextMockRecorder) Err ¶ added in v1.3.1
func (mr *MockTxContextMockRecorder) Err() *gomock.Call
Err indicates an expected call of Err.
func (*MockTxContextMockRecorder) Rollback ¶ added in v1.3.1
func (mr *MockTxContextMockRecorder) Rollback() *gomock.Call
Rollback indicates an expected call of Rollback.
func (*MockTxContextMockRecorder) Value ¶ added in v1.3.1
func (mr *MockTxContextMockRecorder) Value(key interface{}) *gomock.Call
Value indicates an expected call of Value.
type Store ¶
type Store interface { // BeginTx starts a new transaction and returns a transactional context BeginTx(ctx context.Context) (TxContext, error) // GetJob returns a job, identified by the id parameter, or an error if // it does not exist. GetJob(ctx context.Context, id string) (models.Job, error) // GetJobs retrieves a slice of jobs defined by the contents of the // [JobQuery]. If it fails, it will return an error GetJobs(ctx context.Context, query JobQuery) (*JobQueryResponse, error) // GetInProgressJobs retrieves all jobs that have a state that can be // considered, 'in progress'. Failure generates an error. If the jobType // is provided, only active jobs of that type will be returned. GetInProgressJobs(ctx context.Context, jobType string) ([]models.Job, error) // GetJobHistory retrieves the history for the specified job. The // history returned is filtered by the contents of the provided // [JobHistoryFilterOptions]. GetJobHistory(ctx context.Context, jobID string, options JobHistoryQuery) (*JobHistoryQueryResponse, error) // CreateJob will create a new job and persist it in the store. CreateJob(ctx context.Context, j models.Job) error // GetExecutions retrieves all executions for the specified job. GetExecutions(ctx context.Context, options GetExecutionsOptions) ([]models.Execution, error) // UpdateJobState updates the state for the job identified in the // [UpdateJobStateRequest]. UpdateJobState(ctx context.Context, request UpdateJobStateRequest) error // AddJobHistory adds a new history entry for the specified job AddJobHistory(ctx context.Context, jobID string, events ...models.Event) error // CreateExecution creates a new execution CreateExecution(ctx context.Context, execution models.Execution) error // UpdateExecution updates the execution state according to the values // within [UpdateExecutionRequest]. UpdateExecution(ctx context.Context, request UpdateExecutionRequest) error // AddExecutionHistory adds a new history entry for the specified execution AddExecutionHistory(ctx context.Context, jobID, executionID string, events ...models.Event) error // DeleteJob removes all trace of the provided job from storage DeleteJob(ctx context.Context, jobID string) error // CreateEvaluation creates a new evaluation CreateEvaluation(ctx context.Context, eval models.Evaluation) error // GetEvaluation retrieves the specified evaluation GetEvaluation(ctx context.Context, id string) (models.Evaluation, error) // DeleteEvaluation deletes the specified evaluation DeleteEvaluation(ctx context.Context, id string) error // GetEventStore returns the event store for the execution store GetEventStore() watcher.EventStore // Close provides an interface to cleanup any resources in use when the // store is no longer required Close(ctx context.Context) error }
A Store will persist jobs and their state to the underlying storage. It also gives an efficient way to retrieve jobs using queries.
type TxContext ¶ added in v1.3.1
TxContext is a transactional context that can be used to commit or rollback
type UpdateExecutionCondition ¶
type UpdateExecutionCondition struct { ExpectedStates []models.ExecutionStateType ExpectedDesiredStates []models.ExecutionDesiredStateType ExpectedRevision uint64 UnexpectedStates []models.ExecutionStateType }
type UpdateExecutionRequest ¶
type UpdateJobCondition ¶
type UpdateJobCondition struct { ExpectedState models.JobStateType UnexpectedStates []models.JobStateType ExpectedRevision uint64 }
type UpdateJobStateRequest ¶
type UpdateJobStateRequest struct { JobID string Condition UpdateJobCondition NewState models.JobStateType Message string }