dao_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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ALLRegisterNodes

func ALLRegisterNodes() (list []*node.Node, err error)

ALLRegisterNodes returns all register nodes

func AllNodes

func AllNodes() (list []*node.Node, err error)

AllNodes return all node data from etcd

func AllNodesMap

func AllNodesMap() (mapping map[string]*node.Node, err error)

AllNodesMap returns all register nodes in map form

func AllRegisterNodesMap

func AllRegisterNodesMap() (mapping map[string]*node.Node, err error)

AllRegisterNodesMap returns all register nodes from etcd in map form

func AllWorkNodesMap

func AllWorkNodesMap() (res map[string]*node.Node, err error)

AllWorkNodesMap returns all register nodes from etcd in map form

func AllocatablePrefix

func AllocatablePrefix() string

AllocatablePrefix returns prefix key of etcd for allocatable

func CapacityMap

func CapacityMap() (mapping map[string]*node.Capacity, err error)

CapacityMap returns capacity data in map form

func CapacityPrefix

func CapacityPrefix() string

CapacityPrefix returns prefix key of etcd for capacity

func CreateNode

func CreateNode(n *node.Node) (err error)

CreateNode create a node in etcd

func CreateNodeIfNotExist

func CreateNodeIfNotExist(n *node.Node) (err error)

CreateNodeIfNotExist create a node in etcd if that not exist

func CreateOrUpdateStatus

func CreateOrUpdateStatus(nodeName string, opts ...node.StatusOption) (ok bool, err error)

CreateOrUpdateStatus crate of update status in etcd create if not exist

func CreateStatusIfNotExist

func CreateStatusIfNotExist(n *node.Status) (err error)

CreateStatusIfNotExist create status if not exist

func DeleteStatus

func DeleteStatus(name string) (err error)

DeleteStatus delete node status in etcd

func GetNode

func GetNode(name string) (n *node.Node, err error)

GetNode get node data from etcd

func GetStatus

func GetStatus(nodeName string) (s *node.Status, err error)

GetStatus get node status from etcd

func NodePrefix

func NodePrefix() string

NodePrefix returns etcd prefix of node

func NodeRegisterPrefix

func NodeRegisterPrefix() string

NodeRegisterPrefix returns etcd prefix of register node

func StatusMap

func StatusMap() (mapping map[string]*node.Status, err error)

StatusMap returns all node status in map form

func StatusPrefix

func StatusPrefix() string

StatusPrefix returns etcd prefix of node status

func UpdateAllocatable

func UpdateAllocatable(al *node.Allocatable) (err error)

UpdateAllocatable update allocatable data to etcd

func UpdateCapacity

func UpdateCapacity(cap *node.Capacity) (err error)

UpdateCapacity update capacity data to etcd

func UpdateNode

func UpdateNode(nodeName string, opts ...node.NodeOption) (ok bool, err error)

UpdateNode update a node data in etcd

Types

This section is empty.

Jump to

Keyboard shortcuts

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