Documentation ¶
Index ¶
- func ApplyJobQueryField(fieldPtr interface{}, queryField JobQueryField) error
- func NewTestEventEmitter(header testevent.Header) testevent.Emitter
- func NewTestEventEmitterFetcher(header testevent.Header) testevent.EmitterFetcher
- func NewTestEventEmitterFetcherWithAllowedEvents(header testevent.Header, allowedEvents *map[event.Name]bool) testevent.EmitterFetcher
- func NewTestEventEmitterWithAllowedEvents(header testevent.Header, allowedEvents *map[event.Name]bool) testevent.Emitter
- func NewTestEventFetcher() testevent.Fetcher
- func SetAsyncStorage(storageEngine Storage) error
- func SetStorage(storageEngine Storage) error
- func WithConsistencyModel(ctx xcontext.Context, model ConsistencyModel) xcontext.Context
- type ConsistencyModel
- type ErrJobQueryFieldHasZeroValue
- type ErrJobQueryFieldIsAlreadySet
- type EventStorage
- type FrameworkEventEmitter
- type FrameworkEventEmitterFetcher
- type FrameworkEventFetcher
- type JobQuery
- type JobQueryField
- type JobQueryFields
- type JobStorage
- type JobStorageManager
- func (jsm JobStorageManager) GetJobReport(ctx xcontext.Context, jobID types.JobID) (*job.JobReport, error)
- func (jsm JobStorageManager) GetJobRequest(ctx xcontext.Context, jobID types.JobID) (*job.Request, error)
- func (jsm JobStorageManager) ListJobs(ctx xcontext.Context, query *JobQuery) ([]types.JobID, error)
- func (jsm JobStorageManager) StoreJobRequest(ctx xcontext.Context, request *job.Request) (types.JobID, error)
- func (jsm JobStorageManager) StoreReport(ctx xcontext.Context, report *job.Report) error
- type ResettableStorage
- type Storage
- type TestEventEmitter
- type TestEventEmitterFetcher
- type TestEventFetcher
- type TransactionalStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyJobQueryField ¶
func ApplyJobQueryField(fieldPtr interface{}, queryField JobQueryField) error
func NewTestEventEmitter ¶
NewTestEventEmitter creates a new Emitter object associated with a Header
func NewTestEventEmitterFetcher ¶
func NewTestEventEmitterFetcher(header testevent.Header) testevent.EmitterFetcher
NewTestEventEmitterFetcher creates a new EmitterFetcher object associated with a Header
func NewTestEventEmitterFetcherWithAllowedEvents ¶
func NewTestEventEmitterFetcherWithAllowedEvents(header testevent.Header, allowedEvents *map[event.Name]bool) testevent.EmitterFetcher
NewTestEventEmitterFetcherWithAllowedEvents creates a new EmitterFetcher object associated with a Header
func NewTestEventEmitterWithAllowedEvents ¶
func NewTestEventEmitterWithAllowedEvents(header testevent.Header, allowedEvents *map[event.Name]bool) testevent.Emitter
NewTestEventEmitterWithAllowedEvents creates a new Emitter object associated with a Header
func NewTestEventFetcher ¶
NewTestEventFetcher creates a new Fetcher object associated with a Header
func SetAsyncStorage ¶
SetAsyncStorage sets the desired storage engine for read-only events. Switching to a new storage engine implies garbage collecting the old one, with possible loss of pending events if not flushed correctly
func SetStorage ¶
SetStorage sets the desired storage engine for events. Switching to a new storage engine implies garbage collecting the old one, with possible loss of pending events if not flushed correctly
func WithConsistencyModel ¶
func WithConsistencyModel(ctx xcontext.Context, model ConsistencyModel) xcontext.Context
Types ¶
type ConsistencyModel ¶
type ConsistencyModel int
ConsistencyModel hints at whether queries should go to the primary database or any available replica (in which case, the guarantee is eventual consistency)
const ( ConsistentReadAfterWrite ConsistencyModel = iota ConsistentEventually )
type ErrJobQueryFieldHasZeroValue ¶
type ErrJobQueryFieldHasZeroValue struct {
QueryField JobQueryField
}
ErrQueryFieldHasZeroValue is returned when a QueryFields failed validation due to a QueryField with a zero value (this is unexpected and forbidden).
func (ErrJobQueryFieldHasZeroValue) Error ¶
func (err ErrJobQueryFieldHasZeroValue) Error() string
type ErrJobQueryFieldIsAlreadySet ¶
type ErrJobQueryFieldIsAlreadySet struct { FieldValue interface{} QueryField JobQueryField }
func (ErrJobQueryFieldIsAlreadySet) Error ¶
func (err ErrJobQueryFieldIsAlreadySet) Error() string
type EventStorage ¶
type EventStorage interface { // Test events storage interface StoreTestEvent(ctx xcontext.Context, event testevent.Event) error GetTestEvents(ctx xcontext.Context, eventQuery *testevent.Query) ([]testevent.Event, error) // Framework events storage interface StoreFrameworkEvent(ctx xcontext.Context, event frameworkevent.Event) error GetFrameworkEvent(ctx xcontext.Context, eventQuery *frameworkevent.Query) ([]frameworkevent.Event, error) }
type FrameworkEventEmitter ¶
type FrameworkEventEmitter struct { }
FrameworkEventEmitter implements Emitter interface from the frameworkevent package
func NewFrameworkEventEmitter ¶
func NewFrameworkEventEmitter() FrameworkEventEmitter
NewFrameworkEventEmitter creates a new Emitter object for framework events
func (FrameworkEventEmitter) Emit ¶
func (ev FrameworkEventEmitter) Emit(ctx xcontext.Context, event frameworkevent.Event) error
Emit emits an event using the selected storage engine
type FrameworkEventEmitterFetcher ¶
type FrameworkEventEmitterFetcher struct { FrameworkEventEmitter FrameworkEventFetcher }
FrameworkEventEmitterFetcher implements Emitter and Fetcher interface from the frameworkevent package
func NewFrameworkEventEmitterFetcher ¶
func NewFrameworkEventEmitterFetcher() FrameworkEventEmitterFetcher
NewFrameworkEventEmitterFetcher creates a new EmitterFetcher object for framework events
type FrameworkEventFetcher ¶
type FrameworkEventFetcher struct { }
FrameworkEventFetcher implements the Fetcher interface from the frameworkevent package
func NewFrameworkEventFetcher ¶
func NewFrameworkEventFetcher() FrameworkEventFetcher
NewFrameworkEventFetcher creates a new Fetcher object for framework events
func (FrameworkEventFetcher) Fetch ¶
func (ev FrameworkEventFetcher) Fetch(ctx xcontext.Context, queryFields ...frameworkevent.QueryField) ([]frameworkevent.Event, error)
Fetch retrieves events based on QueryFields that are used to build a Query object for FrameworkEvents
type JobQuery ¶
func BuildJobQuery ¶
func BuildJobQuery(queryFields ...JobQueryField) (*JobQuery, error)
type JobQueryField ¶
type JobQueryField interface {
// contains filtered or unexported methods
}
func QueryJobServerID ¶
func QueryJobServerID(serverID string) JobQueryField
func QueryJobStates ¶
func QueryJobStates(states ...job.State) JobQueryField
func QueryJobTags ¶
func QueryJobTags(tags ...string) JobQueryField
type JobQueryFields ¶
type JobQueryFields []JobQueryField
func (JobQueryFields) BuildQuery ¶
func (queryFields JobQueryFields) BuildQuery() (*JobQuery, error)
type JobStorage ¶
type JobStorage interface { // Job request interface StoreJobRequest(ctx xcontext.Context, request *job.Request) (types.JobID, error) GetJobRequest(ctx xcontext.Context, jobID types.JobID) (*job.Request, error) // Job report interface StoreReport(ctx xcontext.Context, report *job.Report) error GetJobReport(ctx xcontext.Context, jobID types.JobID) (*job.JobReport, error) // Job enumeration interface ListJobs(ctx xcontext.Context, query *JobQuery) ([]types.JobID, error) }
JobStorage defines the interface that implements persistence for job related information
type JobStorageManager ¶
type JobStorageManager struct { }
JobStorageManager implements JobStorage interface
func NewJobStorageManager ¶
func NewJobStorageManager() JobStorageManager
NewJobStorageManager creates a new JobStorageManager object
func (JobStorageManager) GetJobReport ¶
func (jsm JobStorageManager) GetJobReport(ctx xcontext.Context, jobID types.JobID) (*job.JobReport, error)
GetJobReport fetches a job report from the storage layer
func (JobStorageManager) GetJobRequest ¶
func (jsm JobStorageManager) GetJobRequest(ctx xcontext.Context, jobID types.JobID) (*job.Request, error)
GetJobRequest fetches a job request from the storage layer
func (JobStorageManager) StoreJobRequest ¶
func (jsm JobStorageManager) StoreJobRequest(ctx xcontext.Context, request *job.Request) (types.JobID, error)
StoreJobRequest submits a job request to the storage layer
func (JobStorageManager) StoreReport ¶
StoreReport submits a job run or final report to the storage layer
type ResettableStorage ¶
ResettableStorage is implemented by storage engines that support reset operation
type Storage ¶
type Storage interface { JobStorage EventStorage // Close flushes and releases resources associated with the storage engine. Close() error // Version returns the version of the storage being used Version() (uint64, error) }
Storage defines the interface that storage engines must implement
func GetStorage ¶
GetStorage returns the primary storage for events.
type TestEventEmitter ¶
type TestEventEmitter struct {
// contains filtered or unexported fields
}
TestEventEmitter implements Emitter interface from the testevent package
type TestEventEmitterFetcher ¶
type TestEventEmitterFetcher struct { TestEventEmitter TestEventFetcher }
TestEventEmitterFetcher implements Emitter and Fetcher interface of the testevent package
type TestEventFetcher ¶
type TestEventFetcher struct { }
TestEventFetcher implements the Fetcher interface from the testevent package
func (TestEventFetcher) Fetch ¶
func (ev TestEventFetcher) Fetch(ctx xcontext.Context, queryFields ...testevent.QueryField) ([]testevent.Event, error)
Fetch retrieves events based on QueryFields that are used to build a Query object for TestEvents
type TransactionalStorage ¶
type TransactionalStorage interface { Storage BeginTx() (TransactionalStorage, error) Commit() error Rollback() error }
TransactionalStorage is implemented by storage backends that support transactions. Only default isolation level is supported.