mirror of
https://github.com/lightninglabs/aperture.git
synced 2026-01-28 05:34:32 +01:00
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.
14 lines
354 B
Go
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
|
|
}
|