resource

package
v0.11.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortProvidersByMemory

func SortProvidersByMemory(p []*ResourceProvider)

func SortProvidersByUsage

func SortProvidersByUsage(p []*ResourceProvider)

Types

type ConsumerGetter

type ConsumerGetter interface {
	GetConsumers(environmentID string) ([]ResourceConsumer, error)
}

type ProviderManager

type ProviderManager interface {
	CalculateNewProvider(environmentID string) (*ResourceProvider, error)
	GetProviders(environmentID string) ([]*ResourceProvider, error)
	ScaleTo(environmentID string, size int, unusedProviders []*ResourceProvider) (int, error)
}

type ResourceConsumer

type ResourceConsumer struct {
	ID     string
	Memory bytesize.Bytesize
	Ports  []int
}

func NewResourceConsumer

func NewResourceConsumer(id string, memory bytesize.Bytesize, ports []int) ResourceConsumer

func (ResourceConsumer) ToModel

type ResourceProvider

type ResourceProvider struct {
	ID string
	// contains filtered or unexported fields
}

func NewResourceProvider

func NewResourceProvider(id string, inUse bool, availableMemory bytesize.Bytesize, usedPorts []int) *ResourceProvider

func (*ResourceProvider) HasResourcesFor

func (r *ResourceProvider) HasResourcesFor(consumer ResourceConsumer) bool

func (*ResourceProvider) IsInUse

func (r *ResourceProvider) IsInUse() bool

func (*ResourceProvider) SubtractResourcesFor

func (r *ResourceProvider) SubtractResourcesFor(consumer ResourceConsumer) error

func (ResourceProvider) ToModel

type ResourceProviderSorter

type ResourceProviderSorter struct {
	Providers []*ResourceProvider
	// contains filtered or unexported fields
}

func (*ResourceProviderSorter) Len

func (r *ResourceProviderSorter) Len() int

func (*ResourceProviderSorter) Less

func (r *ResourceProviderSorter) Less(i, j int) bool

func (*ResourceProviderSorter) Swap

func (r *ResourceProviderSorter) Swap(i, j int)

Directories

Path Synopsis
Package mock_resource is a generated GoMock package.
Package mock_resource is a generated GoMock package.

Jump to

Keyboard shortcuts

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