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 ¶
func NewResourceConsumer ¶
func NewResourceConsumer(id string, memory bytesize.Bytesize, ports []int) ResourceConsumer
func (ResourceConsumer) ToModel ¶
func (r ResourceConsumer) ToModel() models.ResourceConsumer
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 ¶
func (r ResourceProvider) ToModel() models.ResourceProvider
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. |
Click to show internal directories.
Click to hide internal directories.