Documentation
¶
Index ¶
- Constants
- Variables
- func ProvideResolverOption(provider interface{}) fx.Option
- func ResolveModule() fx.Option
- type InMemoryLocker
- type InsufficientFundError
- type Ledger
- func (l *Ledger) Close(ctx context.Context) error
- func (l *Ledger) Commit(ctx context.Context, ts []core.Transaction) ([]core.Transaction, error)
- func (l *Ledger) Execute(ctx context.Context, script core.Script) error
- func (l *Ledger) FindAccounts(ctx context.Context, m ...query.QueryModifier) (query.Cursor, error)
- func (l *Ledger) FindTransactions(ctx context.Context, m ...query.QueryModifier) (query.Cursor, error)
- func (l *Ledger) GetAccount(ctx context.Context, address string) (core.Account, error)
- func (l *Ledger) GetLastTransaction(ctx context.Context) (core.Transaction, error)
- func (l *Ledger) GetTransaction(ctx context.Context, id string) (core.Transaction, error)
- func (l *Ledger) LoadMapping(ctx context.Context) (*core.Mapping, error)
- func (l *Ledger) RevertTransaction(ctx context.Context, id string) error
- func (l *Ledger) SaveMapping(ctx context.Context, mapping core.Mapping) error
- func (l *Ledger) SaveMeta(ctx context.Context, targetType string, targetID string, m core.Metadata) error
- func (l *Ledger) Stats(ctx context.Context) (Stats, error)
- func (l *Ledger) Verify() error
- type Locker
- type ResolveOptionFn
- type Resolver
- type ResolverOption
- type Stats
- type Unlock
- type ValidationError
Constants ¶
View Source
const ResolverOptionsKey = `group:"_ledgerResolverOptions"`
Variables ¶
View Source
var DefaultContracts = []core.Contract{ { Expr: &core.ExprGte{ Op1: core.VariableExpr{ Name: "balance", }, Op2: core.ConstantExpr{ Value: float64(0), }, }, Account: "*", }, }
View Source
var DefaultResolverOptions = []ResolverOption{ WithStorageFactory(storage.NewDefaultFactory(sqlstorage.NewInMemorySQLiteDriver())), WithLocker(NewInMemoryLocker()), }
Functions ¶
func ProvideResolverOption ¶
func ResolveModule ¶
Types ¶
type InMemoryLocker ¶
type InMemoryLocker struct {
// contains filtered or unexported fields
}
func NewInMemoryLocker ¶
func NewInMemoryLocker() *InMemoryLocker
type InsufficientFundError ¶
type InsufficientFundError struct {
Asset string
}
func NewInsufficientFundError ¶
func NewInsufficientFundError(asset string) *InsufficientFundError
func (InsufficientFundError) Error ¶
func (e InsufficientFundError) Error() string
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
func (*Ledger) Commit ¶
func (l *Ledger) Commit(ctx context.Context, ts []core.Transaction) ([]core.Transaction, error)
func (*Ledger) FindAccounts ¶
func (*Ledger) FindTransactions ¶
func (*Ledger) GetAccount ¶
func (*Ledger) GetLastTransaction ¶
func (*Ledger) GetTransaction ¶
func (*Ledger) LoadMapping ¶
func (*Ledger) RevertTransaction ¶
func (*Ledger) SaveMapping ¶
type ResolveOptionFn ¶
func WithLocker ¶
func WithLocker(locker Locker) ResolveOptionFn
func WithStorageFactory ¶
func WithStorageFactory(factory storage.Factory) ResolveOptionFn
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(options ...ResolverOption) *Resolver
type ResolverOption ¶
type ResolverOption interface {
// contains filtered or unexported methods
}
type ValidationError ¶
type ValidationError struct {
Msg string
}
func NewValidationError ¶
func NewValidationError(msg string) *ValidationError
func (ValidationError) Error ¶
func (v ValidationError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.