Documentation
¶
Index ¶
- Constants
- Variables
- func CheckBidEligibility(gspec *dtypes.GroupSpec, providerAttrs atrtypes.Attributes, ...) (bool, []string, error)
- type BidPricingStrategy
- func MakeRandomRangePricing() (BidPricingStrategy, error)
- func MakeScalePricing(cpuScale decimal.Decimal, memoryScale decimal.Decimal, storageScale Storage, ...) (BidPricingStrategy, error)
- func MakeShellScriptPricing(path string, processLimit uint, runtimeLimit time.Duration) (BidPricingStrategy, error)
- type Config
- type ProviderAttrSignatureService
- type Request
- type ScreenBidResult
- type Service
- type StatusClient
- type Storage
Constants ¶
const (
DefaultPricePrecision = 6
)
Variables ¶
var ( ErrBidQuantityInvalid = errors.New("a bid quantity is invalid") ErrBidZero = errors.New("a bid of zero was produced") )
var ErrNotRunning = errors.New("not running")
ErrNotRunning declares new error with message "not running"
Functions ¶
func CheckBidEligibility ¶
func CheckBidEligibility( gspec *dtypes.GroupSpec, providerAttrs atrtypes.Attributes, bidAttrs atrtypes.Attributes, maxGroupVolumes int, pass ProviderAttrSignatureService, providerOwner string, ) (bool, []string, error)
CheckBidEligibility checks whether a provider should bid on a given group spec. Returns (shouldBid, reasons, error) where reasons lists why bidding was declined. This is used by both the live bid flow and the bid screening/precheck endpoint.
Types ¶
type BidPricingStrategy ¶
type BidPricingStrategy interface {
CalculatePrice(ctx context.Context, req Request) (sdk.DecCoin, error)
}
func MakeRandomRangePricing ¶
func MakeRandomRangePricing() (BidPricingStrategy, error)
func MakeScalePricing ¶
func MakeShellScriptPricing ¶
type Config ¶
type Config struct {
PricingStrategy BidPricingStrategy
Deposit sdk.Coin
BidTimeout time.Duration
Attributes atttypes.Attributes
MaxGroupVolumes int
}
Config represents the configuration parameters for the bid engine. It controls pricing, deposits, timeouts and provider capabilities and attributes
type ProviderAttrSignatureService ¶
type ProviderAttrSignatureService interface {
GetAuditorAttributeSignatures(auditor string) (atypes.AuditedProviders, error)
GetAttributes() (atrtypes.Attributes, error)
}
type ScreenBidResult ¶
type ScreenBidResult struct {
Passed bool
Reasons []string
AllocatedResources dtypes.ResourceUnits
ClusterParams interface{}
Price sdk.DecCoin
}
ScreenBidResult contains the result of a bid screening/precheck operation.
type Service ¶
type Service interface {
StatusClient
ScreenBid(ctx context.Context, gspec *dtypes.GroupSpec) (*ScreenBidResult, error)
Close() error
Done() <-chan struct{}
}
Service handles bidding on orders.
type StatusClient ¶
type StatusClient interface {
Status(context.Context) (*apclient.BidEngineStatus, error)
StatusV1(ctx context.Context) (*provider.BidEngineStatus, error)
}
StatusClient interface predefined with Status method
type Storage ¶
func (Storage) AllLessThenOrEqual ¶
AllLessThenOrEqual check all storage classes fit into max limits note better have dedicated limits for each class