Documentation ¶
Index ¶
- Constants
- Variables
- type ChannelInfo
- type Manager
- func (pm *Manager) AddVoucher(ctx context.Context, ch address.Address, sv *types.SignedVoucher, proof []byte, ...) (types.BigInt, error)
- func (pm *Manager) AllocateLane(ch address.Address) (uint64, error)
- func (pm *Manager) CheckVoucherSpendable(ctx context.Context, ch address.Address, sv *types.SignedVoucher, ...) (bool, error)
- func (pm *Manager) CheckVoucherValid(ctx context.Context, ch address.Address, sv *types.SignedVoucher) error
- func (pm *Manager) GetChannelInfo(addr address.Address) (*ChannelInfo, error)
- func (pm *Manager) GetPaych(ctx context.Context, from, to address.Address, ensureFree types.BigInt) (address.Address, cid.Cid, error)
- func (pm *Manager) ListChannels() ([]address.Address, error)
- func (pm *Manager) ListVouchers(ctx context.Context, ch address.Address) ([]*VoucherInfo, error)
- func (pm *Manager) NextNonceForLane(ctx context.Context, ch address.Address, lane uint64) (uint64, error)
- func (pm *Manager) OutboundChanTo(from, to address.Address) (address.Address, error)
- func (pm *Manager) TrackInboundChannel(ctx context.Context, ch address.Address) error
- func (pm *Manager) TrackOutboundChannel(ctx context.Context, ch address.Address) error
- type ManagerApi
- type Store
- type VoucherInfo
Constants ¶
View Source
const ( DirInbound = 1 DirOutbound = 2 )
Variables ¶
View Source
var ErrChannelNotTracked = errors.New("channel not tracked")
Functions ¶
This section is empty.
Types ¶
type ChannelInfo ¶
type ChannelInfo struct { Channel address.Address Control address.Address Target address.Address Direction uint64 Vouchers []*VoucherInfo NextLane uint64 }
func (*ChannelInfo) MarshalCBOR ¶
func (t *ChannelInfo) MarshalCBOR(w io.Writer) error
func (*ChannelInfo) UnmarshalCBOR ¶
func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(sm *stmgr.StateManager, pchstore *Store, api ManagerApi) *Manager
func (*Manager) AddVoucher ¶
func (*Manager) AllocateLane ¶
func (*Manager) CheckVoucherSpendable ¶
func (pm *Manager) CheckVoucherSpendable(ctx context.Context, ch address.Address, sv *types.SignedVoucher, secret []byte, proof []byte) (bool, error)
checks if the given voucher is currently spendable
func (*Manager) CheckVoucherValid ¶
func (pm *Manager) CheckVoucherValid(ctx context.Context, ch address.Address, sv *types.SignedVoucher) error
checks if the given voucher is valid (is or could become spendable at some point)
func (*Manager) GetChannelInfo ¶
func (pm *Manager) GetChannelInfo(addr address.Address) (*ChannelInfo, error)
func (*Manager) ListChannels ¶
func (*Manager) ListVouchers ¶
func (pm *Manager) ListVouchers(ctx context.Context, ch address.Address) ([]*VoucherInfo, error)
func (*Manager) NextNonceForLane ¶
func (*Manager) OutboundChanTo ¶
func (*Manager) TrackInboundChannel ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(ds dtypes.MetadataDS) *Store
func (*Store) AllocateLane ¶
func (*Store) ListChannels ¶
func (*Store) TrackChannel ¶
func (ps *Store) TrackChannel(ch *ChannelInfo) error
func (*Store) VouchersForPaych ¶
func (ps *Store) VouchersForPaych(ch address.Address) ([]*VoucherInfo, error)
type VoucherInfo ¶
type VoucherInfo struct { Voucher *types.SignedVoucher Proof []byte }
func (*VoucherInfo) MarshalCBOR ¶
func (t *VoucherInfo) MarshalCBOR(w io.Writer) error
func (*VoucherInfo) UnmarshalCBOR ¶
func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) error
Click to show internal directories.
Click to hide internal directories.