Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingDataMapper represents the error that is returned // when attempting to add, alter, remove, or register an entity // that doesn't have a corresponding data mapper. ErrMissingDataMapper = work.ErrMissingDataMapper // ErrNoDataMapper represents the error that occurs when attempting // to create a work unit without any data mappers. ErrNoDataMapper = work.ErrNoDataMapper )
var ( // TypeNameOf provides the type name for the provided entity. TypeNameOf = work.TypeNameOf // New creates a new work unit. New = work.NewUnit // NewUniter creates a new uniter with the provided unit options. NewUniter = work.NewUniter )
var ( // DB specifies the option to provide the database for the work unit. DB = work.UnitDB // DataMappers specifies the option to provide the data mappers for // the work unit. DataMappers = work.UnitDataMappers // ZapLogger specifies the option to provide a zap logger for the work unit. ZapLogger = work.UnitZapLogger // TallyMetricScope specifies the option to provide a tally metric scope for the work unit. TallyMetricScope = work.UnitTallyMetricScope // AfterRegisterActions specifies the option to provide actions to execute // after entities are registered with the work unit. AfterRegisterActions = work.UnitAfterRegisterActions // AfterAddActions specifies the option to provide actions to execute // after entities are added with the work unit. AfterAddActions = work.UnitAfterAddActions // AfterAlterActions specifies the option to provide actions to execute // after entities are altered with the work unit. AfterAlterActions = work.UnitAfterAlterActions // AfterRemoveActions specifies the option to provide actions to execute // after entities are removed with the work unit. AfterRemoveActions = work.UnitAfterRemoveActions // AfterInsertsActions specifies the option to provide actions to execute // after new entities are inserted in the data store. AfterInsertsActions = work.UnitAfterInsertsActions // AfterUpdatesActions specifies the option to provide actions to execute // after altered entities are updated in the data store. AfterUpdatesActions = work.UnitAfterUpdatesActions // AfterDeletesActions specifies the option to provide actions to execute // after removed entities are deleted in the data store. AfterDeletesActions = work.UnitAfterDeletesActions // AfterRollbackActions specifies the option to provide actions to execute // after a rollback is performed. AfterRollbackActions = work.UnitAfterRollbackActions // AfterSaveActions specifies the option to provide actions to execute // after a save is performed. AfterSaveActions = work.UnitAfterSaveActions // BeforeInsertsActions specifies the option to provide actions to execute // before new entities are inserted in the data store. BeforeInsertsActions = work.UnitBeforeInsertsActions // BeforeUpdatesActions specifies the option to provide actions to execute // before altered entities are updated in the data store. BeforeUpdatesActions = work.UnitBeforeUpdatesActions // BeforeDeletesActions specifies the option to provide actions to execute // before removed entities are deleted in the data store. BeforeDeletesActions = work.UnitBeforeDeletesActions // BeforeRollbackActions specifies the option to provide actions to execute // before a rollback is performed. BeforeRollbackActions = work.UnitBeforeRollbackActions // BeforeSaveActions specifies the option to provide actions to execute // before a save is performed. BeforeSaveActions = work.UnitBeforeSaveActions // DefaultLoggingActions specifies all of the default logging actions. DefaultLoggingActions = work.UnitDefaultLoggingActions // DisableDefaultLoggingActions disables the default logging actions. DisableDefaultLoggingActions = work.DisableDefaultLoggingActions // RetryAttempts defines the number of retry attempts to perform. RetryAttempts = work.UnitRetryAttempts // RetryDelay defines the delay to utilize during retries. RetryDelay = work.UnitRetryDelay // RetryMaximumJitter defines the maximum jitter to utilize during // retries that utilize random delay times. RetryMaximumJitter = work.UnitRetryMaximumJitter // RetryType defines the type of retry to perform. RetryType = work.UnitRetryType // InsertFunc defines the function to be used for inserting new // entities in the underlying data store. InsertFunc = work.UnitInsertFunc // UpdateFunc defines the function to be used for updating existing // entities in the underlying data store. UpdateFunc = work.UnitUpdateFunc // DeleteFunc defines the function to be used for deleting existing // entities in the underlying data store. DeleteFunc = work.UnitDeleteFunc // WithCacheClient defines the cache client to be used. WithCacheClient = work.UnitWithCacheClient )
var ( // ActionTypeAfterRegister indicates an action type that occurs after // an entity is registered. ActionTypeAfterRegister = work.UnitActionTypeAfterRegister // ActionTypeAfterAdd indicates an action type that occurs after an // entity is added. ActionTypeAfterAdd = work.UnitActionTypeAfterAdd // ActionTypeAfterAlter indicates an action type that occurs after // an entity is altered. ActionTypeAfterAlter = work.UnitActionTypeAfterAlter // ActionTypeAfterRemove indicates an action type that occurs after // an entity is removed. ActionTypeAfterRemove = work.UnitActionTypeAfterRemove // ActionTypeAfterInserts indicates an action type that occurs after // new entities are inserted in the data store. ActionTypeAfterInserts = work.UnitActionTypeAfterInserts // ActionTypeAfterUpdates indicates an action type that occurs after // existing entities are updated in the data store. ActionTypeAfterUpdates = work.UnitActionTypeAfterUpdates // ActionTypeAfterDeletes indicates an action type that occurs after // existing entities are deleted in the data store. ActionTypeAfterDeletes = work.UnitActionTypeAfterDeletes // ActionTypeAfterRollback indicates an action type that occurs after // rollback. ActionTypeAfterRollback = work.UnitActionTypeAfterRollback // ActionTypeAfterSave indicates an action type that occurs after save. ActionTypeAfterSave = work.UnitActionTypeAfterSave // ActionTypeBeforeRegister indicates an action type that occurs // before an entity is registered. ActionTypeBeforeRegister = work.UnitActionTypeBeforeRegister // ActionTypeBeforeAdd indicates an action type that occurs before an // entity is added. ActionTypeBeforeAdd = work.UnitActionTypeBeforeAdd // ActionTypeBeforeAlter indicates an action type that occurs before an // entity is altered. ActionTypeBeforeAlter = work.UnitActionTypeBeforeAlter // ActionTypeBeforeRemove indicates an action type that occurs before an // entity is removed. ActionTypeBeforeRemove = work.UnitActionTypeBeforeRemove // ActionTypeBeforeInserts indicates an action type that occurs before // new entities are inserted in the data store. ActionTypeBeforeInserts = work.UnitActionTypeBeforeInserts // ActionTypeBeforeUpdates indicates an action type that occurs before // existing entities are updated in the data store. ActionTypeBeforeUpdates = work.UnitActionTypeBeforeUpdates // ActionTypeBeforeDeletes indicates an action type that occurs before // existing entities are deleted in the data store. ActionTypeBeforeDeletes = work.UnitActionTypeBeforeDeletes // ActionTypeBeforeRollback indicates an action type that occurs before // rollback. ActionTypeBeforeRollback = work.UnitActionTypeBeforeRollback // ActionTypeBeforeSave indicates an action type that occurs before save. ActionTypeBeforeSave = work.UnitActionTypeBeforeSave )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action = work.UnitAction
Action represents an operation performed during a paticular lifecycle event of a work unit.
type ActionContext ¶
type ActionContext = work.UnitActionContext
ActionContext represents the executional context for an action.
type ActionType ¶
type ActionType = work.UnitActionType
ActionType represents the type of work unit action.
type DataMapper ¶
type DataMapper = work.UnitDataMapper
DataMapper represents a creator, modifier, and deleter of entities.
type DataMapperFunc ¶
type DataMapperFunc = work.UnitDataMapperFunc
DataMapperFunc represents a data mapper function that performs a single operation, such as insert, update, or delete.
type MapperContext ¶
type MapperContext = work.UnitMapperContext
MapperContext represents the additional context provided to data mappers and data mapper functions to help facilitate the mapping process.
type Options ¶
type Options = work.UnitOptions
Options represents the configuration options for the work unit.
type RetryDelayType ¶
type RetryDelayType = work.UnitRetryDelayType
RetryDelayType represents the type of retry delay to perform.