mock

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

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 WithPayFunc(f func(context.Context, swarm.Address, uint64) error) Option

func WithSettlementRecvFunc

func WithSettlementRecvFunc(f func(swarm.Address) (uint64, error)) Option

func WithSettlementSentFunc

func WithSettlementSentFunc(f func(swarm.Address) (uint64, error)) Option

WithsettlementFunc sets the mock settlement function

func WithSettlementsRecvFunc

func WithSettlementsRecvFunc(f func() (map[string]uint64, error)) Option

func WithSettlementsSentFunc

func WithSettlementsSentFunc(f func() (map[string]uint64, error)) Option

WithsettlementsFunc sets the mock settlements function

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the mock settlement service.

func (*Service) Pay

func (s *Service) Pay(c context.Context, peer swarm.Address, amount uint64) error

func (*Service) SetNotifyPaymentFunc added in v0.4.0

func (s *Service) SetNotifyPaymentFunc(settlement.NotifyPaymentFunc)

func (*Service) SettlementsReceived

func (s *Service) SettlementsReceived() (map[string]uint64, error)

func (*Service) SettlementsSent

func (s *Service) SettlementsSent() (map[string]uint64, error)

settlements is the mock function wrapper that calls the set implementation

func (*Service) TotalReceived

func (s *Service) TotalReceived(peer swarm.Address) (totalSent uint64, err error)

func (*Service) TotalSent

func (s *Service) TotalSent(peer swarm.Address) (totalSent uint64, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL