Documentation ¶
Index ¶
- type Krypton
- func (k *Krypton) AddContainer(id, podname, nodename string) (*types.Container, error)
- func (k *Krypton) AddNode(name, endpoint, podname string, public bool) (*types.Node, error)
- func (k *Krypton) AddPod(name, desc string) (*types.Pod, error)
- func (k *Krypton) GetAllNodes() ([]*types.Node, error)
- func (k *Krypton) GetAllPods() ([]*types.Pod, error)
- func (k *Krypton) GetContainer(id string) (*types.Container, error)
- func (k *Krypton) GetContainers(ids []string) ([]*types.Container, error)
- func (k *Krypton) GetNode(podname, nodename string) (*types.Node, error)
- func (k *Krypton) GetNodesByPod(podname string) ([]*types.Node, error)
- func (k *Krypton) GetPod(name string) (*types.Pod, error)
- func (k *Krypton) RemoveContainer(id string) error
- func (k *Krypton) UpdateNode(node *types.Node) error
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 (*Krypton) AddContainer ¶
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 ¶
add a node save it to etcd storage path in etcd is `/eru-core/pod/:podname/node/:nodename/info`
func (*Krypton) AddPod ¶
add a pod save it to etcd storage path in etcd is `/eru-core/pod/:podname/info`
func (*Krypton) GetAllNodes ¶
get all nodes from etcd any error will break and return immediately
func (*Krypton) GetAllPods ¶
get all pods in etcd any error will break and return error immediately storage path in etcd is `/eru-core/pod`
func (*Krypton) GetContainer ¶
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 ¶
get many containers
func (*Krypton) GetNode ¶
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 ¶
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) RemoveContainer ¶
remove a container container id must be in full length