pricing

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 10 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrThresholdTooLow says that the proposed payment threshold is too low for even a single reserve.
	ErrThresholdTooLow = errors.New("threshold too low")
)

Functions

This section is empty.

Types

type Interface

type Interface interface {
	AnnouncePaymentThreshold(ctx context.Context, peer swarm.Address, paymentThreshold *big.Int) error
}

Interface is the main interface of the pricing protocol

type PaymentThresholdObserver

type PaymentThresholdObserver interface {
	NotifyPaymentThreshold(peer swarm.Address, paymentThreshold *big.Int) error
}

PaymentThresholdObserver is used for being notified of payment threshold updates

type Service

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

func New

func New(streamer p2p.Streamer, logger log.Logger, paymentThreshold, lightPaymentThreshold, minThreshold *big.Int) *Service

func (*Service) AnnouncePaymentThreshold

func (s *Service) AnnouncePaymentThreshold(ctx context.Context, peer swarm.Address, paymentThreshold *big.Int) error

AnnouncePaymentThreshold announces the payment threshold to per

func (*Service) Protocol

func (s *Service) Protocol() p2p.ProtocolSpec

func (*Service) SetPaymentThresholdObserver

func (s *Service) SetPaymentThresholdObserver(observer PaymentThresholdObserver)

SetPaymentThresholdObserver sets the PaymentThresholdObserver to be used when receiving a new payment threshold

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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