node

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 3 Imported by: 0

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"`
}

type AllocatableOption

type AllocatableOption func(a *Allocatable)

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_cors"`
	CpuUsage    uint8     `json:"cpu_usage"`
	MemoryUsage uint8     `json:"memory_usage"`
	UpdateTime  time.Time `json:"update_time"`
	Allocatable *Allocatable
}

type CapacityOption

type CapacityOption func(c *Capacity)

type Condition

type Condition struct {
}

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"`
}

func (*Node) Key

func (s *Node) Key() (key string)

func (*Node) Unmarshal

func (s *Node) Unmarshal(val []byte) (err error)

func (*Node) Val

func (s *Node) Val() (val string)

type NodeOption

type NodeOption func(s *Node)

func WithNodeIP

func WithNodeIP(i net.IP) NodeOption

func WithNodeVersion

func WithNodeVersion(v string) NodeOption

type Role

type Role struct {
	Master bool `json:"master"`
	Admin  bool `json:"admin"`
	Worker bool `json:"worker"`
}

type Status

type Status struct {
	NodeName           string `json:"node_name"`
	Ready              bool   `json:"ready"`
	NetworkUnavailable bool   `json:"network_unavailable"`
	MemoryPressure     bool   `json:"memory_pressure"`
	DiskPressure       bool   `json:"disk_pressure"`
	CPUPressure        bool   `json:"cpu_pressure"`
}

type StatusOption

type StatusOption func(s *Status)

func WithCPUPressure

func WithCPUPressure(b bool) StatusOption

func WithDiskPressure

func WithDiskPressure(b bool) StatusOption

func WithMemoryPressure

func WithMemoryPressure(b bool) StatusOption

func WithNetworkUnavailable

func WithNetworkUnavailable(b bool) StatusOption

func WithReady

func WithReady(b bool) StatusOption

Jump to

Keyboard shortcuts

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