utils

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultTreeName : the default name of the tree (if unspecified)
	DefaultTreeName string = "default"

	// DefaultResourceNames : the default resource names
	DefaultResourceNames []string = []string{"cpu", "memory", "nvidia.com/gpu"}

	// DefaultTreeKind : the default kind attribute of the tree
	DefaultTreeKind string = "QuotaTree"

	// DefaultConsumerKind : the kind attribute for a consumer
	DefaultConsumerKind string = "Consumer"
)

Functions

This section is empty.

Types

type JConsumer

type JConsumer struct {
	Kind     string        `json:"kind"`
	MetaData JMetaData     `json:"metadata"`
	Spec     JConsumerSpec `json:"spec"`
}

JConsumer : JSON consumer

type JConsumerSpec

type JConsumerSpec struct {
	ID    string              `json:"id"`
	Trees []JConsumerTreeSpec `json:"trees"`
}

JConsumerSpec : spec of consumer of multiple trees

type JConsumerTreeSpec

type JConsumerTreeSpec struct {
	ID            string         `json:"id"`
	TreeName      string         `json:"treeName"`
	GroupID       string         `json:"groupID"`
	Request       map[string]int `json:"request"`
	Priority      int            `json:"priority"`
	CType         int            `json:"type"`
	UnPreemptable bool           `json:"unPreemptable"`
}

JConsumerTreeSpec : consumer spec for a tree

type JMetaData

type JMetaData struct {
	Name string `json:"name"`
}

JMetaData : common metada

type JNodeSpec

type JNodeSpec struct {
	Parent string            `json:"parent"`
	Quota  map[string]string `json:"quota"`
	Hard   string            `json:"hard"`
}

JNodeSpec : spec for a node in the quota tree

type JQuotaTree

type JQuotaTree struct {
	Kind     string    `json:"kind"`
	MetaData JMetaData `json:"metadata"`
	Spec     JTreeSpec `json:"spec"`
}

JQuotaTree : JSON quota tree

type JTreeInfo

type JTreeInfo struct {
	Name          string   `json:"name"`
	ResourceNames []string `json:"resourceNames"`
}

JTreeInfo : data about tree name and resource names

type JTreeSpec

type JTreeSpec struct {
	ResourceNames []string             `json:"resourceNames"`
	Nodes         map[string]JNodeSpec `json:"nodes"`
}

JTreeSpec : spec of quota tree

Jump to

Keyboard shortcuts

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