pricing

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyRules

type EmptyRules struct{}

EmptyRules is an implementation of PricingRules which always return an invalid result.

func (EmptyRules) PricesFor

func (EmptyRules) PricesFor(auction *pb.Auction) (prices ResolvedPrices, valid bool)

PricesFor always returns valid = false.

type PricingRules

type PricingRules interface {
	PricesFor(auction *pb.Auction) (prices ResolvedPrices, valid bool)
}

PricingRules represents arbitrary logic to determine the prices for an auction.

func NewCIDGravityRules

func NewCIDGravityRules(apiKey string) PricingRules

NewCIDGravityRules returns PricingRules based on CID gravity configuration for the storage provider.

type ResolvedPrices

type ResolvedPrices struct {
	UnverifiedPriceValid bool
	UnverifiedPrice      int64
	VerifiedPriceValid   bool
	VerifiedPrice        int64
}

ResolvedPrices represents the result after matching an auction through the pricing rules.

Jump to

Keyboard shortcuts

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