Documentation
¶
Overview ¶
Package adapters contains the private glue that composes the per-service packages (warmstorage, spregistry, payments, costs, internal/contracts/ pdpverifier) into the narrow interfaces consumed by the storage package.
This package is a root-synapse implementation detail. It must not be imported outside the SDK and must not import the root synapse package. Each exported constructor returns a storage-package interface so that the concrete adapter types stay unexported and never enlarge the public API.
Index ¶
- func NewCostCalculator(c *costs.Service) storage.MultiCostCalculator
- func NewDataSetFinder(ws *warmstorage.Service) storage.DataSetFinder
- func NewPaymentsFunder(p *payments.Service) storage.PaymentsFunder
- func NewStorageInfoReader(ws *warmstorage.Service, sp *spregistry.Service, pay *payments.Service, ...) storage.StorageInfoReader
- type PDPReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCostCalculator ¶
func NewCostCalculator(c *costs.Service) storage.MultiCostCalculator
NewCostCalculator returns a storage.MultiCostCalculator backed by c.
func NewDataSetFinder ¶
func NewDataSetFinder(ws *warmstorage.Service) storage.DataSetFinder
NewDataSetFinder returns a storage.DataSetFinder backed by ws.
func NewPaymentsFunder ¶
func NewPaymentsFunder(p *payments.Service) storage.PaymentsFunder
NewPaymentsFunder returns a storage.PaymentsFunder backed by p.
func NewStorageInfoReader ¶
func NewStorageInfoReader(ws *warmstorage.Service, sp *spregistry.Service, pay *payments.Service, usdfcToken, fwss common.Address) storage.StorageInfoReader
NewStorageInfoReader returns a storage.StorageInfoReader that assembles pricing, providers and allowances from ws, sp and pay.
Types ¶
type PDPReader ¶
type PDPReader interface {
storage.PDPVerifierReader
storage.DataSetSizeReader
}
PDPReader is the union of storage.PDPVerifierReader and storage.DataSetSizeReader satisfied by a single adapter around the abigen PDPVerifierCaller plus an ethclient. Root synapse holds a single field of this type and fans it out to both storage options.
func NewPDPVerifierReader ¶
func NewPDPVerifierReader(caller *pdpverifier.PDPVerifierCaller, backend *ethclient.Client) PDPReader
NewPDPVerifierReader returns a PDPReader wrapping caller and backend. When caller is nil it returns a nil interface value, letting callers keep the plain `if r != nil` check without hitting Go's typed-nil interface trap.