etcdstore

package
v0.0.0-...-9b5a650 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Krypton

type Krypton struct {
	// contains filtered or unexported fields
}

func NewKrypton

func NewKrypton(config *types.Config) (*Krypton, error)

func (*Krypton) AddContainer

func (k *Krypton) AddContainer(id, podname, nodename string) (*types.Container, error)

add a container 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 `/eru-core/container/:containerid`

func (*Krypton) AddNode

func (k *Krypton) AddNode(name, endpoint, podname string, public bool) (*types.Node, error)

add a node save it to etcd storage path in etcd is `/eru-core/pod/:podname/node/:nodename/info`

func (*Krypton) AddPod

func (k *Krypton) AddPod(name, desc string) (*types.Pod, error)

add a pod save it to etcd storage path in etcd is `/eru-core/pod/:podname/info`

func (*Krypton) GetAllNodes

func (k *Krypton) GetAllNodes() ([]*types.Node, error)

get all nodes from etcd any error will break and return immediately

func (*Krypton) GetAllPods

func (k *Krypton) GetAllPods() ([]*types.Pod, error)

get all pods in etcd any error will break and return error immediately storage path in etcd is `/eru-core/pod`

func (*Krypton) GetContainer

func (k *Krypton) GetContainer(id string) (*types.Container, error)

get a container container if must be in full length, or we can't find it in etcd storage path in etcd is `/eru-core/container/:containerid`

func (*Krypton) GetContainers

func (k *Krypton) GetContainers(ids []string) ([]*types.Container, error)

get many containers

func (*Krypton) GetNode

func (k *Krypton) GetNode(podname, nodename string) (*types.Node, error)

get a node from etcd and construct it's docker client a node must belong to a pod and since node is not the smallest unit to user, to get a node we must specify the corresponding pod storage path in etcd is `/eru-core/pod/:podname/node/:nodename/info`

func (*Krypton) GetNodesByPod

func (k *Krypton) GetNodesByPod(podname string) ([]*types.Node, error)

get all nodes bound to pod here we use podname instead of pod instance storage path in etcd is `/eru-core/pod/:podname/node`

func (*Krypton) GetPod

func (k *Krypton) GetPod(name string) (*types.Pod, error)

get a pod from etcd storage path in etcd is `/eru-core/pod/:podname/info`

func (*Krypton) RemoveContainer

func (k *Krypton) RemoveContainer(id string) error

remove a container container id must be in full length

func (*Krypton) UpdateNode

func (k *Krypton) UpdateNode(node *types.Node) error

update a node, save it to etcd storage path in etcd is `/eru-core/pod/:podname/node/:nodename/info`

Jump to

Keyboard shortcuts

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