unit

package
v4.0.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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
)
View Source
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
)
View Source
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
	// Logger specifies the option to provide a logger for the work unit.
	Logger = work.UnitLogger
	// Scope specifies the option to provide a metric scope for the work unit.
	Scope = work.UnitScope
	// 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
)
View Source
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.DataMapper

DataMapper represents a creator, modifier, and deleter of entities.

type MapperContext

type MapperContext = work.MapperContext

MapperContext represents the executional context for a data mapper.

type Option

type Option = work.UnitOption

Option applies an option to the provided configuration.

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.

type TypeName

type TypeName = work.TypeName

TypeName represents an entity's type.

type Unit

type Unit = work.Unit

Unit represents an atomic set of entity changes.

type Uniter

type Uniter = work.Uniter

Uniter represents a factory for work units.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL