Documentation ¶
Index ¶
- func New(opts ...Option) settlement.Interface
- func NewApiInterface(opts ...Option) swap.ApiInterface
- type Option
- func WithCashChequeFunc(f func(ctx context.Context, peer swarm.Address) (common.Hash, error)) Option
- func WithCashoutStatusFunc(...) Option
- func WithHandshakeFunc(f func(swarm.Address, common.Address) error) Option
- func WithLastReceivedChequeFunc(f func(swarm.Address) (*chequebook.SignedCheque, error)) Option
- func WithLastReceivedChequesFunc(f func() (map[string]*chequebook.SignedCheque, error)) Option
- func WithLastSentChequeFunc(f func(swarm.Address) (*chequebook.SignedCheque, error)) Option
- func WithLastSentChequesFunc(f func() (map[string]*chequebook.SignedCheque, error)) Option
- func WithPayFunc(f func(context.Context, swarm.Address, uint64) error) Option
- func WithReceiveChequeFunc(f func(context.Context, swarm.Address, *chequebook.SignedCheque) error) Option
- func WithSetNotifyPaymentFunc(f settlement.NotifyPaymentFunc) Option
- func WithSettlementRecvFunc(f func(swarm.Address) (uint64, error)) Option
- func WithSettlementSentFunc(f func(swarm.Address) (uint64, error)) Option
- func WithSettlementsRecvFunc(f func() (map[string]uint64, error)) Option
- func WithSettlementsSentFunc(f func() (map[string]uint64, error)) Option
- type Service
- func (s *Service) CashCheque(ctx context.Context, peer swarm.Address) (common.Hash, error)
- func (s *Service) CashoutStatus(ctx context.Context, peer swarm.Address) (*chequebook.CashoutStatus, error)
- func (s *Service) Handshake(peer swarm.Address, beneficiary common.Address) error
- func (s *Service) LastReceivedCheque(address swarm.Address) (*chequebook.SignedCheque, error)
- func (s *Service) LastReceivedCheques() (map[string]*chequebook.SignedCheque, error)
- func (s *Service) LastSentCheque(address swarm.Address) (*chequebook.SignedCheque, error)
- func (s *Service) LastSentCheques() (map[string]*chequebook.SignedCheque, error)
- func (s *Service) Pay(ctx context.Context, peer swarm.Address, amount uint64) error
- func (s *Service) ReceiveCheque(ctx context.Context, peer swarm.Address, cheque *chequebook.SignedCheque) (err error)
- func (s *Service) SetNotifyPaymentFunc(f settlement.NotifyPaymentFunc)
- func (s *Service) SettlementsReceived() (map[string]uint64, error)
- func (s *Service) SettlementsSent() (map[string]uint64, error)
- func (s *Service) TotalReceived(peer swarm.Address) (totalReceived uint64, err error)
- func (s *Service) TotalSent(peer swarm.Address) (totalSent uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewApiInterface ¶
func NewApiInterface(opts ...Option) swap.ApiInterface
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is the option passed to the mock settlement service
func WithCashChequeFunc ¶
func WithCashoutStatusFunc ¶
func WithCashoutStatusFunc(f func(ctx context.Context, peer swarm.Address) (*chequebook.CashoutStatus, error)) Option
func WithLastReceivedChequeFunc ¶
func WithLastReceivedChequeFunc(f func(swarm.Address) (*chequebook.SignedCheque, error)) Option
func WithLastReceivedChequesFunc ¶
func WithLastReceivedChequesFunc(f func() (map[string]*chequebook.SignedCheque, error)) Option
func WithLastSentChequeFunc ¶
func WithLastSentChequeFunc(f func(swarm.Address) (*chequebook.SignedCheque, error)) Option
func WithLastSentChequesFunc ¶
func WithLastSentChequesFunc(f func() (map[string]*chequebook.SignedCheque, error)) Option
func WithReceiveChequeFunc ¶
func WithReceiveChequeFunc(f func(context.Context, swarm.Address, *chequebook.SignedCheque) error) Option
func WithSetNotifyPaymentFunc ¶ added in v0.4.0
func WithSetNotifyPaymentFunc(f settlement.NotifyPaymentFunc) Option
WithsettlementsFunc sets the mock settlements function
func WithSettlementRecvFunc ¶
func WithSettlementSentFunc ¶
WithsettlementFunc sets the mock settlement function
func WithSettlementsRecvFunc ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CashCheque ¶
func (*Service) CashoutStatus ¶
func (s *Service) CashoutStatus(ctx context.Context, peer swarm.Address) (*chequebook.CashoutStatus, error)
func (*Service) LastReceivedCheque ¶
func (s *Service) LastReceivedCheque(address swarm.Address) (*chequebook.SignedCheque, error)
func (*Service) LastReceivedCheques ¶
func (s *Service) LastReceivedCheques() (map[string]*chequebook.SignedCheque, error)
func (*Service) LastSentCheque ¶
func (s *Service) LastSentCheque(address swarm.Address) (*chequebook.SignedCheque, error)
func (*Service) LastSentCheques ¶
func (s *Service) LastSentCheques() (map[string]*chequebook.SignedCheque, error)
func (*Service) ReceiveCheque ¶
func (s *Service) ReceiveCheque(ctx context.Context, peer swarm.Address, cheque *chequebook.SignedCheque) (err error)
ReceiveCheque is the mock ReceiveCheque function of swap.
func (*Service) SetNotifyPaymentFunc ¶ added in v0.4.0
func (s *Service) SetNotifyPaymentFunc(f settlement.NotifyPaymentFunc)
func (*Service) SettlementsReceived ¶
SettlementsReceived is the mock SettlementsReceived function of swap.
func (*Service) SettlementsSent ¶
SettlementsSent is the mock SettlementsSent function of swap.
func (*Service) TotalReceived ¶
TotalReceived is the mock TotalReceived function of swap.
Click to show internal directories.
Click to hide internal directories.