Documentation ¶
Overview ¶
Package multi provides a multi-ledger funder and adjudicator.
Index ¶
- func IsMultiLedgerAssets(assets []channel.Asset) bool
- type Adjudicator
- func (a *Adjudicator) LedgerAdjudicator(l LedgerID) (channel.Adjudicator, bool)
- func (a *Adjudicator) Progress(ctx context.Context, req channel.ProgressReq) error
- func (a *Adjudicator) Register(ctx context.Context, req channel.AdjudicatorReq, ...) error
- func (a *Adjudicator) RegisterAdjudicator(l LedgerID, la channel.Adjudicator)
- func (a *Adjudicator) Subscribe(ctx context.Context, chID channel.ID) (channel.AdjudicatorSubscription, error)
- func (a *Adjudicator) Withdraw(ctx context.Context, req channel.AdjudicatorReq, subStates channel.StateMap) error
- type AdjudicatorSubscription
- type Asset
- type Funder
- type LedgerID
- type LedgerIDMapKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMultiLedgerAssets ¶
IsMultiLedgerAssets returns whether the assets are from multiple ledgers.
Types ¶
type Adjudicator ¶
type Adjudicator struct {
// contains filtered or unexported fields
}
Adjudicator is a multi-ledger adjudicator.
func (*Adjudicator) LedgerAdjudicator ¶ added in v0.10.3
func (a *Adjudicator) LedgerAdjudicator(l LedgerID) (channel.Adjudicator, bool)
LedgerAdjudicator returns the adjudicator for a given ledger.
func (*Adjudicator) Progress ¶
func (a *Adjudicator) Progress(ctx context.Context, req channel.ProgressReq) error
Progress progresses the state of a multi-ledger channel. It dispatches Progress calls to all relevant adjudicators. If any of the calls fails, the method returns an error.
func (*Adjudicator) Register ¶
func (a *Adjudicator) Register(ctx context.Context, req channel.AdjudicatorReq, subStates []channel.SignedState) error
Register registers a multi-ledger channel. It dispatches Register calls to all relevant adjudicators. If any of the calls fails, the method returns an error.
func (*Adjudicator) RegisterAdjudicator ¶
func (a *Adjudicator) RegisterAdjudicator(l LedgerID, la channel.Adjudicator)
RegisterAdjudicator registers an adjudicator for a given ledger.
func (*Adjudicator) Subscribe ¶
func (a *Adjudicator) Subscribe(ctx context.Context, chID channel.ID) (channel.AdjudicatorSubscription, error)
Subscribe creates a new multi-ledger AdjudicatorSubscription.
func (*Adjudicator) Withdraw ¶
func (a *Adjudicator) Withdraw(ctx context.Context, req channel.AdjudicatorReq, subStates channel.StateMap) error
Withdraw withdraws the funds from a multi-ledger channel. It dispatches Withdraw calls to all relevant adjudicators. If any of the calls fails, the method returns an error.
type AdjudicatorSubscription ¶
type AdjudicatorSubscription struct {
// contains filtered or unexported fields
}
AdjudicatorSubscription is a multi-ledger adjudicator subscription.
func (*AdjudicatorSubscription) Close ¶
func (s *AdjudicatorSubscription) Close() error
Close closes the subscription.
func (*AdjudicatorSubscription) Err ¶
func (s *AdjudicatorSubscription) Err() error
Err blocks until an error occurred and returns it.
func (*AdjudicatorSubscription) Next ¶
func (s *AdjudicatorSubscription) Next() channel.AdjudicatorEvent
Next returns the next event.
type Funder ¶
type Funder struct {
// contains filtered or unexported fields
}
Funder is a multi-ledger funder.
type LedgerID ¶
type LedgerID interface {
MapKey() LedgerIDMapKey
}
LedgerID represents a ledger identifier.
type LedgerIDMapKey ¶
type LedgerIDMapKey string
LedgerIDMapKey is the map key representation of a ledger identifier.