Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Modules = struct { SQLUnit fx.Option BestEffortUnit fx.Option }{ SQLUnit: fx.Options( fx.Provide(func(p SQLUnitParameters) SQLWorkUniterResult { options := []work.Option{} if p.Logger != nil { options = append(options, work.UnitLogger(p.Logger)) } if p.Scope != nil { options = append(options, work.UnitScope(p.Scope)) } return SQLWorkUniterResult{ WorkUniter: work.NewSQLUniter(p.Mappers, p.DB, options...), } })), BestEffortUnit: fx.Options( fx.Provide(func(p UnitParameters) BestEffortWorkUniterResult { options := []work.Option{} if p.Logger != nil { options = append(options, work.UnitLogger(p.Logger)) } if p.Scope != nil { options = append(options, work.UnitScope(p.Scope)) } return BestEffortWorkUniterResult{ WorkUniter: work.NewBestEffortUniter(p.Mappers, options...), } })), }
Modules defines the various work unit Fx modules.
Functions ¶
This section is empty.
Types ¶
type BestEffortWorkUniterResult ¶
type BestEffortWorkUniterResult struct { fx.Out WorkUniter work.Uniter `name:"bestEffortWorkUniter",group:"workUniter"` }
BestEffortWorkUniterResult defines the best effort uniter to be provided to the dependency injection container.
type SQLUnitParameters ¶
type SQLUnitParameters struct { fx.In Mappers map[work.TypeName]work.SQLDataMapper DB *sql.DB `name:"rwDB"` Logger *zap.Logger `optional:"true"` Scope tally.Scope `optional:"true"` }
SQLUnitParameters encapsulates the various dependencies required to construct SQL work units.
type SQLWorkUniterResult ¶
type SQLWorkUniterResult struct { fx.Out WorkUniter work.Uniter `name:"sqlWorkUniter",group:"workUniter"` }
SQLWorkUniterResult defines the SQL work uniter to be provided to the dependency injection container.
type UnitParameters ¶
type UnitParameters struct { fx.In Mappers map[work.TypeName]work.DataMapper Logger *zap.Logger `optional:"true"` Scope tally.Scope `optional:"true"` }
UnitParameters encapsulates the various dependencies required to contruct various work units, such as the best effort work unit.
Click to show internal directories.
Click to hide internal directories.