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" redis:"node_name"`
Cpu float64 `json:"cpu" redis:"cpu"`
Disk uint64 `json:"disk" redis:"disk"`
Memory uint64 `json:"memory" redis:"memory"`
UpdateTime time.Time `json:"update_time" redis:"update_time"`
}
Allocatable available resources for node
func (*Allocatable) Key ¶
func (a *Allocatable) Key() string
func (*Allocatable) Unmarshal ¶
func (a *Allocatable) Unmarshal(data []byte) error
func (*Allocatable) Val ¶
func (a *Allocatable) Val() string
type Capacity ¶
type Capacity struct {
NodeName string `json:"node_name" redis:"node_name"`
Cpu float64 `json:"cpu" redis:"cpu"`
Disk uint64 `json:"disk" redis:"disk"`
Memory uint64 `json:"memory" redis:"memory"` //byte
CpuCors int32 `json:"cpu_cores" redis:"cpu_cores"`
CpuUsage uint8 `json:"cpu_usage" redis:"cpu_usage"`
MemoryUsage uint8 `json:"memory_usage" redis:"memory_usage"`
UpdateTime time.Time `json:"update_time" redis:"update_time"`
Allocatable Allocatable `json:"allocatable" redis:"allocatable"`
}
Capacity node capacity
type CapacityMap ¶
func (*CapacityMap) Key ¶
func (c *CapacityMap) Key() string
func (*CapacityMap) Unmarshal ¶
func (c *CapacityMap) Unmarshal(data []byte) error
func (*CapacityMap) Val ¶
func (c *CapacityMap) Val() string
type Node ¶
type Node struct {
Name string `json:"name" redis:"name"`
Role Role `json:"role" redis:"role"`
IP string `json:"ip" redis:"ip"`
Version string `json:"version" redis:"version"`
CreateTime time.Time `json:"create_time" redis:"create_time"`
UpdateTime time.Time `json:"update_time" redis:"update_time"`
LastRunTime time.Time `json:"last_run_time" redis:"last_run_time"`
}
Node is node
func (*Node) RegisterName ¶
type NodeOption ¶
NodeOption configure node
func WithNodeVersion ¶
func WithNodeVersion(v string) NodeOption
WithNodeVersion sets node's version
type Role ¶
type Role struct {
Master bool `json:"master" redis:"master"`
Admin bool `json:"admin" redis:"admin"`
Worker bool `json:"worker" redis:"worker"`
}
Role store struct
type Status ¶
type Status struct {
NodeName string `json:"node_name" redis:"node_name"`
Ready bool `json:"ready" redis:"ready"`
MemoryPressure bool `json:"memory_pressure" redis:"memory_pressure"`
DiskPressure bool `json:"disk_pressure" redis:"disk_pressure"`
CPUPressure bool `json:"cpu_pressure" redis:"cpu_pressure"`
}
Status node status
type StatusCondition ¶
type StatusCondition = string
StatusCondition Status field name
const ( ConReady StatusCondition = "ready" ConMemoryPressure StatusCondition = "memory_pressure" ConDiskPressure StatusCondition = "disk_pressure" ConCPUPressure StatusCondition = "cpu_pressure" )
type StatusConditions ¶
type StatusConditions = map[StatusCondition]bool
StatusConditions Status conditions
type StatusOption ¶
type StatusOption func(s *Status)
StatusOption is function configure Status
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.