bidengine

package
v0.16.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 35 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 added in v0.9.1

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

func MakeRandomRangePricing added in v0.9.1

func MakeRandomRangePricing() (BidPricingStrategy, error)

func MakeScalePricing added in v0.9.1

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

func MakeShellScriptPricing added in v0.9.1

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

type Config added in v0.10.0

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

type ProviderAttrSignatureService added in v0.10.2

type ProviderAttrSignatureService interface {
	GetAuditorAttributeSignatures(auditor string) ([]atypes.Provider, error)
	GetAttributes() (types.Attributes, 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 in case of failure

type Status added in v0.6.0

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

Status stores orders

type StatusClient added in v0.3.4

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

StatusClient interface predefined with Status method

type Storage added in v0.16.0

type Storage map[string]decimal.Decimal

func (Storage) AllLessThenOrEqual added in v0.16.0

func (ss Storage) AllLessThenOrEqual(val decimal.Decimal) bool

AllLessThenOrEqual check all storage classes fit into max limits note better have dedicated limits for each class

func (Storage) IsAnyNegative added in v0.16.0

func (ss Storage) IsAnyNegative() bool

func (Storage) IsAnyZero added in v0.16.0

func (ss Storage) IsAnyZero() bool

Jump to

Keyboard shortcuts

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