estimator

package
v0.0.0-...-3a937ec Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlackholeEstimator = "blackhole" // blackhole estimator name
)

Variables

View Source
var (
	ErrNotAvailable    = errors.New("not-available")
	ErrInvalidProvider = errors.New("invalid-provider-kind")
)

Functions

func NewEstimatorMessage

func NewEstimatorMessage(id string, err error, values manifest.FlatMap) (res bus.Message)

Create new estimator message with "__values"

Types

type Blackhole

type Blackhole struct {
	// contains filtered or unexported fields
}

Blackhole estimator accepts all requests but evaluates only destroys

func NewBlackhole

func NewBlackhole(globalConfig GlobalConfig, config Config) (b *Blackhole)

func (Blackhole) Close

func (b Blackhole) Close() error

func (Blackhole) Create

func (b Blackhole) Create(id string, resource *allocation.Resource) (err error)

func (Blackhole) Destroy

func (b Blackhole) Destroy(id string) (err error)

func (Blackhole) Results

func (b Blackhole) Results() (id string, ctx context.Context, ch chan *Result)

func (Blackhole) Shutdown

func (b Blackhole) Shutdown()

func (Blackhole) Update

func (b Blackhole) Update(id string, resource *allocation.Resource) (err error)

type Config

type Config struct {
	Ctx      context.Context
	Log      *logx.Log
	Provider *allocation.Provider
	Id       string // Full provider ID
}

Config

type GlobalConfig

type GlobalConfig struct {
}

Global estimator config

type Invalid

type Invalid struct {
	// contains filtered or unexported fields
}

Invalid estimator accepts resource requests but always responds that all of them are failed

func NewInvalid

func NewInvalid(globalConfig GlobalConfig, config Config) (i *Invalid)

func (Invalid) Close

func (b Invalid) Close() error

func (Invalid) Create

func (b Invalid) Create(id string, resource *allocation.Resource) (err error)

func (Invalid) Destroy

func (b Invalid) Destroy(id string) (err error)

func (Invalid) Results

func (b Invalid) Results() (id string, ctx context.Context, ch chan *Result)

func (Invalid) Shutdown

func (b Invalid) Shutdown()

func (Invalid) Update

func (b Invalid) Update(id string, resource *allocation.Resource) (err error)

type Range

type Range struct {
	// contains filtered or unexported fields
}

func NewRange

func NewRange(globalConfig GlobalConfig, config Config) (r *Range)

func (Range) Close

func (b Range) Close() error

func (Range) Create

func (b Range) Create(id string, resource *allocation.Resource) (err error)

func (Range) Destroy

func (b Range) Destroy(id string) (err error)

func (Range) Results

func (b Range) Results() (id string, ctx context.Context, ch chan *Result)

func (Range) Shutdown

func (b Range) Shutdown()

func (Range) Update

func (b Range) Update(id string, resource *allocation.Resource) (err error)

type Result

type Result struct {
	Uuid    string // Estimator id
	Message bus.Message
}

Estimator result

Jump to

Keyboard shortcuts

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