Documentation
¶
Index ¶
- func NewSettlement(opts ...Option) settlement.Interface
- type Option
- func WithPayFunc(f func(context.Context, swarm.Address, uint64) error) 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) Pay(c context.Context, peer swarm.Address, amount uint64) error
- func (s *Service) SetNotifyPaymentFunc(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) (totalSent 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 NewSettlement ¶
func NewSettlement(opts ...Option) settlement.Interface
Newsettlement creates the mock settlement implementation
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is the option passed to the mock settlement service
func WithPayFunc ¶ added in v0.3.1
func WithSettlementRecvFunc ¶
func WithSettlementSentFunc ¶
WithsettlementFunc sets the mock settlement function
func WithSettlementsRecvFunc ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the mock settlement service.
func (*Service) SetNotifyPaymentFunc ¶ added in v0.4.0
func (s *Service) SetNotifyPaymentFunc(settlement.NotifyPaymentFunc)
func (*Service) SettlementsReceived ¶
func (*Service) SettlementsSent ¶
settlements is the mock function wrapper that calls the set implementation
func (*Service) TotalReceived ¶
Click to show internal directories.
Click to hide internal directories.