Documentation ¶
Index ¶
- func Plan(left, right allocation.ResourceSlice) (c, u, d allocation.ResourceSlice)
- type Estimator
- type Evaluator
- func (e *Evaluator) Allocate(pod *manifest.Pod, env map[string]string)
- func (e *Evaluator) CreateProvider(id string, alloc *allocation.Provider)
- func (e *Evaluator) Deallocate(name string)
- func (e *Evaluator) DestroyProvider(id string)
- func (e *Evaluator) GetConstraint(pod *manifest.Pod) (c manifest.Constraint)
- func (e *Evaluator) Open() (err error)
- func (e *Evaluator) UpdateProvider(id string, alloc *allocation.Provider)
- type Sandbox
- func (s *Sandbox) Close() (err error)
- func (s *Sandbox) Configure(p *allocation.Provider) (err error)
- func (s *Sandbox) Create(id string, req *allocation.Resource)
- func (s *Sandbox) Destroy(id string)
- func (s *Sandbox) Shutdown() (err error)
- func (s *Sandbox) Update(id string, req *allocation.Resource)
- type SandboxConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Plan ¶
func Plan(left, right allocation.ResourceSlice) (c, u, d allocation.ResourceSlice)
Types ¶
type Estimator ¶
type Estimator interface { // Get estimator uuid Results() (uid string, ctx context.Context, ch chan *estimator.Result) // Create resource and notify downstream Create(id string, request *allocation.Resource) (err error) // Update resource and notify downstream Update(id string, request *allocation.Resource) (err error) // Destroy resource and notify downstream Destroy(name string) (err error) // Destroy all resources without notify downstream Shutdown() io.Closer }
Estimator estimates resources and sends results to downstream consumer in form id:map[string]string there values are:
allocated = true|false <key> = "<value>"
Downstream should be notified about destroyed resources by message with empty payload.
func GetEstimator ¶
type Evaluator ¶
type Evaluator struct { *supervisor.Control // contains filtered or unexported fields }
func NewEvaluator ¶
func (*Evaluator) CreateProvider ¶
func (e *Evaluator) CreateProvider(id string, alloc *allocation.Provider)
Create provider
func (*Evaluator) Deallocate ¶
func (*Evaluator) DestroyProvider ¶
func (*Evaluator) GetConstraint ¶
func (e *Evaluator) GetConstraint(pod *manifest.Pod) (c manifest.Constraint)
If Pod has any resources returns "${provider.<resource-provider>.allocated}":"true" for each resource. Elsewhere returns "resource.allocate":"false".
func (*Evaluator) UpdateProvider ¶
func (e *Evaluator) UpdateProvider(id string, alloc *allocation.Provider)
type Sandbox ¶
type Sandbox struct {
// contains filtered or unexported fields
}
Sandbox manages underlying estimator and proxies notifications to downstream
func NewSandbox ¶
func NewSandbox(config SandboxConfig, id string, provider *allocation.Provider) (s *Sandbox)
func (*Sandbox) Configure ¶
func (s *Sandbox) Configure(p *allocation.Provider) (err error)
Update provider
func (*Sandbox) Create ¶
func (s *Sandbox) Create(id string, req *allocation.Resource)
Create resource with id
Click to show internal directories.
Click to hide internal directories.