Documentation
¶
Index ¶
- type Mercury
- func (m *Mercury) AddNode(ctx context.Context, opts *types.AddNodeOptions) (*types.Node, error)
- func (m *Mercury) AddPod(ctx context.Context, name, desc string) (*types.Pod, error)
- func (m Mercury) AddWorkload(ctx context.Context, workload *types.Workload, processing *types.Processing) error
- func (m *Mercury) CreateProcessing(ctx context.Context, processing *types.Processing, count int) error
- func (m *Mercury) DeleteProcessing(ctx context.Context, processing *types.Processing) error
- func (m *Mercury) GetAllPods(ctx context.Context) ([]*types.Pod, error)
- func (m *Mercury) GetDeployStatus(ctx context.Context, appname, entryname string) (map[string]int, error)
- func (m *Mercury) GetNode(ctx context.Context, nodename string) (*types.Node, error)
- func (m *Mercury) GetNodeStatus(ctx context.Context, nodename string) (*types.NodeStatus, error)
- func (m *Mercury) GetNodes(ctx context.Context, nodenames []string) ([]*types.Node, error)
- func (m *Mercury) GetNodesByPod(ctx context.Context, nodeFilter *types.NodeFilter, opts ...store.Option) ([]*types.Node, error)
- func (m *Mercury) GetPod(ctx context.Context, name string) (*types.Pod, error)
- func (m *Mercury) GetWorkload(ctx context.Context, ID string) (*types.Workload, error)
- func (m *Mercury) GetWorkloadStatus(ctx context.Context, ID string) (*types.StatusMeta, error)
- func (m *Mercury) GetWorkloads(ctx context.Context, IDs []string) (workloads []*types.Workload, err error)
- func (m *Mercury) ListNodeWorkloads(ctx context.Context, nodename string, labels map[string]string) ([]*types.Workload, error)
- func (m *Mercury) ListWorkloads(ctx context.Context, appname, entrypoint, nodename string, limit int64, ...) ([]*types.Workload, error)
- func (m *Mercury) LoadNodeCert(ctx context.Context, node *types.Node) (err error)
- func (m *Mercury) NodeStatusStream(ctx context.Context) chan *types.NodeStatus
- func (m *Mercury) RegisterService(ctx context.Context, serviceAddress string, expire time.Duration) (<-chan struct{}, func(), error)
- func (m *Mercury) RemoveNode(ctx context.Context, node *types.Node) error
- func (m *Mercury) RemovePod(ctx context.Context, podname string) error
- func (m *Mercury) RemoveWorkload(ctx context.Context, workload *types.Workload) error
- func (m *Mercury) ServiceStatusStream(ctx context.Context) (chan []string, error)
- func (m *Mercury) SetNodeStatus(ctx context.Context, node *types.Node, ttl int64) error
- func (m *Mercury) SetWorkloadStatus(ctx context.Context, status *types.StatusMeta, ttl int64) error
- func (m *Mercury) UpdateNodes(ctx context.Context, nodes ...*types.Node) error
- func (m *Mercury) UpdateWorkload(ctx context.Context, workload *types.Workload) error
- func (m *Mercury) WorkloadStatusStream(ctx context.Context, appname, entrypoint, nodename string, ...) chan *types.WorkloadStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mercury ¶
Mercury means store with etcdv3
func (*Mercury) AddNode ¶
AddNode save it to etcd storage path in etcd is `/pod/nodes/:podname/:nodename` node->pod path in etcd is `/node/pod/:nodename` func (m *Mercury) AddNode(ctx context.Context, name, endpoint, podname, ca, cert, key string, cpu, share int, memory, storage int64, labels map[string]string, numa types.NUMA, numaMemory types.NUMAMemory, volume types.VolumeMap) (*types.Node, error) {
func (*Mercury) AddPod ¶
AddPod add a pod save it to etcd storage path in etcd is `/pod/info/:podname`
func (Mercury) AddWorkload ¶
func (m Mercury) AddWorkload(ctx context.Context, workload *types.Workload, processing *types.Processing) error
AddWorkload add a workload mainly record its relationship on pod and node actually if we already know its node, we will know its pod but we still store it storage path in etcd is `/workload/:workloadid`
func (*Mercury) CreateProcessing ¶
func (m *Mercury) CreateProcessing(ctx context.Context, processing *types.Processing, count int) error
CreateProcessing save processing status in etcd
func (*Mercury) DeleteProcessing ¶
DeleteProcessing delete processing status in etcd
func (*Mercury) GetAllPods ¶
GetAllPods get all pods in etcd any error will break and return error immediately storage path in etcd is `/pod`
func (*Mercury) GetDeployStatus ¶
func (m *Mercury) GetDeployStatus(ctx context.Context, appname, entryname string) (map[string]int, error)
GetDeployStatus get deploy status from store
func (*Mercury) GetNodeStatus ¶
GetNodeStatus returns status for a node
func (*Mercury) GetNodesByPod ¶
func (m *Mercury) GetNodesByPod(ctx context.Context, nodeFilter *types.NodeFilter, opts ...store.Option) ([]*types.Node, error)
GetNodesByPod get all nodes bound to pod here we use podname instead of pod instance
func (*Mercury) GetWorkload ¶
GetWorkload get a workload workload if must be in full length, or we can't find it in etcd storage path in etcd is `/workload/:workloadid`
func (*Mercury) GetWorkloadStatus ¶
GetWorkloadStatus get workload status
func (*Mercury) GetWorkloads ¶
func (m *Mercury) GetWorkloads(ctx context.Context, IDs []string) (workloads []*types.Workload, err error)
GetWorkloads get many workloads
func (*Mercury) ListNodeWorkloads ¶
func (m *Mercury) ListNodeWorkloads(ctx context.Context, nodename string, labels map[string]string) ([]*types.Workload, error)
ListNodeWorkloads list workloads belong to one node
func (*Mercury) ListWorkloads ¶
func (m *Mercury) ListWorkloads(ctx context.Context, appname, entrypoint, nodename string, limit int64, labels map[string]string) ([]*types.Workload, error)
ListWorkloads list workloads
func (*Mercury) LoadNodeCert ¶
func (*Mercury) NodeStatusStream ¶
func (m *Mercury) NodeStatusStream(ctx context.Context) chan *types.NodeStatus
NodeStatusStream returns a stream of node status it tells you if status of a node is changed, either PUT or DELETE PUT -> Alive: true DELETE -> Alive: false
func (*Mercury) RegisterService ¶
func (m *Mercury) RegisterService(ctx context.Context, serviceAddress string, expire time.Duration) (<-chan struct{}, func(), error)
RegisterService put /services/{address}
func (*Mercury) RemoveNode ¶
RemoveNode delete a node
func (*Mercury) RemoveWorkload ¶
RemoveWorkload remove a workload workload ID must be in full length
func (*Mercury) ServiceStatusStream ¶
ServiceStatusStream watches /services/ --prefix
func (*Mercury) SetNodeStatus ¶
SetNodeStatus sets status for a node, value will expire after ttl seconds ttl < 0 means to delete node status this is heartbeat of node
func (*Mercury) SetWorkloadStatus ¶
SetWorkloadStatus set workload status
func (*Mercury) UpdateNodes ¶
UpdateNodes .
func (*Mercury) UpdateWorkload ¶
UpdateWorkload update a workload
func (*Mercury) WorkloadStatusStream ¶
func (m *Mercury) WorkloadStatusStream(ctx context.Context, appname, entrypoint, nodename string, labels map[string]string) chan *types.WorkloadStatus
WorkloadStatusStream watch deployed status