Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocatable ¶
type Allocatable struct { NodeName string `json:"node_name"` Cpu float64 `json:"cpu"` Disk uint64 `json:"disk"` Memory uint64 `json:"memory"` UpdateTime time.Time `json:"update_time"` }
Allocatable available resources for node
func NewAllocatable ¶ added in v1.1.3
func NewAllocatable(nodeName string) *Allocatable
NewAllocatable returns a new *Allocatable
type AllocatableOption ¶
type AllocatableOption func(a *Allocatable)
AllocatableOption Allocatable's options
type Capacity ¶
type Capacity struct { NodeName string `json:"node_name"` Cpu float64 `json:"cpu"` Disk uint64 `json:"disk"` Memory uint64 `json:"memory"` //byte CpuCors int32 `json:"cpu_cores"` CpuUsage uint8 `json:"cpu_usage"` MemoryUsage uint8 `json:"memory_usage"` UpdateTime time.Time `json:"update_time"` Allocatable *Allocatable `json:"allocatable"` }
Capacity node capacity
func NewCapacity ¶ added in v1.1.3
New returns a new *Capacity
type Node ¶
type Node struct { Name string `json:"name"` Role Role `json:"role"` IP net.IP `json:"ip"` Version string `json:"version"` CreateTime time.Time `json:"create_time"` }
Node is node
type NodeOption ¶
type NodeOption func(s *Node)
NodeOption configure node
func WithNodeVersion ¶
func WithNodeVersion(v string) NodeOption
WithNodeVersion sets node's version
type Role ¶
type Role struct { Master bool `json:"master"` Admin bool `json:"admin"` Worker bool `json:"worker"` }
Role store struct
type Status ¶
type Status struct { NodeName string `json:"node_name"` Ready bool `json:"ready"` MemoryPressure bool `json:"memory_pressure"` DiskPressure bool `json:"disk_pressure"` CPUPressure bool `json:"cpu_pressure"` }
Status node status
type StatusOption ¶
type StatusOption func(s *Status)
StatusOption is function configure Status
func WithDiskPressure ¶
func WithDiskPressure(b bool) StatusOption
WithDiskPressure sets status disk
func WithMemoryPressure ¶
func WithMemoryPressure(b bool) StatusOption
WithMemoryPressure sets status memory
func WithNetworkUnavailable ¶
func WithNetworkUnavailable(b bool) StatusOption
WithNetworkUnavailable sets status network
Click to show internal directories.
Click to hide internal directories.