node

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 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"`
}

Allocatable available resources for node

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

Node is node

func (*Node) Key

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

Key generate etcd key

func (*Node) Unmarshal

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

Unmarshal generate from json data

func (*Node) Val

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

Val generate etcd val

type NodeOption

type NodeOption func(s *Node)

NodeOption configure node

func WithNodeIP

func WithNodeIP(i net.IP) NodeOption

WithNodeIP sets node's ip

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