Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextFactory ¶ added in v1.1.0
func (ContextFactory) CreateStandardTimeoutContext ¶ added in v1.1.0
func (cf ContextFactory) CreateStandardTimeoutContext() (context.Context, context.CancelFunc)
CreateStandardTimeoutContext creates a context with the configured timeout. It is a child of the configured context and can be canceled by that context's cancel function. Returns the created context and its cancel function.
type CoreScopeFactory ¶
type CoreScopeFactory struct {
DataAdapter DataAdapter
}
func (CoreScopeFactory) CreateDataExecutorScope ¶
func (sf CoreScopeFactory) CreateDataExecutorScope(body func(DataExecutor) error) error
func (CoreScopeFactory) CreateTransactionScope ¶
func (sf CoreScopeFactory) CreateTransactionScope(exec DataExecutor, body func(Transaction) (bool, error)) error
type DataAdapter ¶
type DataAdapter interface { // Setup sets up the adapter and returns any errors. Setup() error // CleanUp cleans up the adapter and returns any errors. CleanUp() error // GetExecutor gets the DataExecutor for the adapter. GetExecutor() DataExecutor }
type DataCRUD ¶
type DataCRUD interface { models.MigrationCRUD models.UserCRUD models.ClientCRUD models.SessionCRUD models.UserRoleCRUD }
DataCRUD encapsulates the other CRUD interfaces.
type DataExecutor ¶
type DataExecutor interface { DataCRUD // CreateTransaction creates a new transaction and returns any errors. CreateTransaction() (Transaction, error) }
type MigrationRepositoryFactory ¶
type MigrationRepositoryFactory interface { // CreateMigrationRepository creates a MigrationRepository using the provided data executor. CreateMigrationRepository(DataExecutor) migrationrunner.MigrationRepository }
type ScopeFactory ¶
type ScopeFactory interface { // CreateDataExecutorScope handles setup and clean up of the data executor, and passes it to the provided body function. // Returns any errors from the executor or body. CreateDataExecutorScope(func(DataExecutor) error) error // CreateTransactionScope handles transaction creation and commiting, and passes it to the provided body function. // Rollbacks on failure or error from body, and returns any errors from the transaction or body. CreateTransactionScope(DataExecutor, func(Transaction) (bool, error)) error }
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.