bidengine

package
v0.0.0-...-e391bab Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBidQuantityInvalid = errors.New("A bid quantity is invalid")
View Source
var ErrBidZero = errors.New("A bid of zero was produced")
View Source
var ErrNotRunning = errors.New("not running")

ErrNotRunning declares new error with message "not running"

Functions

This section is empty.

Types

type BidPricingStrategy

type BidPricingStrategy interface {
	CalculatePrice(ctx context.Context, owner string, gspec *dtypes.GroupSpec) (sdk.Coin, error)
}

func MakeRandomRangePricing

func MakeRandomRangePricing() (BidPricingStrategy, error)

func MakeScalePricing

func MakeScalePricing(
	cpuScale decimal.Decimal,
	memoryScale decimal.Decimal,
	storageScale decimal.Decimal,
	endpointScale decimal.Decimal) (BidPricingStrategy, error)

func MakeShellScriptPricing

func MakeShellScriptPricing(path string, processLimit uint, runtimeLimit time.Duration) (BidPricingStrategy, error)

type Config

type Config struct {
	PricingStrategy BidPricingStrategy
	Deposit         sdk.Coin
	BidTimeout      time.Duration
	Attributes      types.Attributes
}

type ProviderAttrSignatureService

type ProviderAttrSignatureService interface {
	GetAuditorAttributeSignatures(auditor string) ([]atypes.Provider, error)
}

type Service

type Service interface {
	StatusClient
	Close() error
	Done() <-chan struct{}
}

Service handles bidding on orders.

func NewService

func NewService(ctx context.Context, session session.Session, cluster cluster.Cluster, bus pubsub.Bus, cfg Config) (Service, error)

NewService creates new service instance and returns error incase of failure

type Status

type Status struct {
	Orders uint32 `json:"orders"`
}

Status stores orders

type StatusClient

type StatusClient interface {
	Status(context.Context) (*Status, error)
}

StatusClient interface predefined with Status method

Jump to

Keyboard shortcuts

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