Files
aperture/pricer/pricer.go
Elle Mouton 7fdda6a504 pricer: add pricer package
This commit adds a new pricer package which contains a Pricer interface
and two implementations of the interface. The Pricer interface can be
used to query the price of a certain path. The two implementations are
as follows: a DefaultPricer which returns the same price for all paths
of a service, and a GRPCPricer which queries a backend grpc server for
the price of a given path.
2021-08-03 14:25:45 +02:00

14 lines
354 B
Go

package pricer
import "context"
// Pricer is an interface used to query price data from a price provider.
type Pricer interface {
// GetPrice should return the price in satoshis for the given
// resource path.
GetPrice(ctx context.Context, path string) (int64, error)
// Close should clean up the Pricer implementation if needed.
Close() error
}