resourcepool

package
v0.0.0-...-f11c6e4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResourceNodeMapRwMutex *sync.RWMutex

Functions

This section is empty.

Types

type NodeResourceMapType

type NodeResourceMapType map[string](*ResourceType)
var ResourceNodeMap NodeResourceMapType // resouceName -> ResourceType

func (NodeResourceMapType) GetResource

func (m NodeResourceMapType) GetResource(resource string) (*ResourceType, *error.Error)

type NodeResourceType

type NodeResourceType struct {
	Max         uint               `json:"max"` // TODO: []uint,  {height1, height2 ... low1, low2}
	Min         uint               `json:"min"` // TODO: []uint,  {height1, height2 ... low1, low2}
	Allocated   uint               `json:"allocated"`
	Stream      *(map[string]uint) `json:"stream"`
	NodeRwMutex *sync.RWMutex      `json:"-"`
}

type ResourceType

type ResourceType struct {
	NodeMap        map[string](*NodeResourceType) `json:"node_map"` // node -> NodeResourceType
	ResouceRwMutex *sync.RWMutex                  `json:"-"`
}

func (ResourceType) GetNodeResource

func (r ResourceType) GetNodeResource(node string) (*NodeResourceType, *error.Error)

func (ResourceType) ResourceAlloc

func (r ResourceType) ResourceAlloc(value uint) (string, string, *error.Error)

Jump to

Keyboard shortcuts

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