rpc

package
v0.0.0-...-1a62c48 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vibranium

type Vibranium struct {
	TaskNum int
	// contains filtered or unexported fields
}

Vibranium is implementations for grpc server interface Many data types should be transformed

func New

func New(cluster cluster.Cluster, config types.Config) *Vibranium

New will new a new cluster instance

func (*Vibranium) AddNode

func (v *Vibranium) AddNode(ctx context.Context, opts *pb.AddNodeOptions) (*pb.Node, error)

AddNode saves a node and returns it to client Method must be called synchronously, or nothing will be returned

func (*Vibranium) AddPod

func (v *Vibranium) AddPod(ctx context.Context, opts *pb.AddPodOptions) (*pb.Pod, error)

AddPod saves a pod, and returns it to client

func (*Vibranium) BuildImage

func (v *Vibranium) BuildImage(opts *pb.BuildImageOptions, stream pb.CoreRPC_BuildImageServer) error

BuildImage streamed returned functions

func (*Vibranium) ContainerDeployed

func (v *Vibranium) ContainerDeployed(ctx context.Context, opts *pb.ContainerDeployedOptions) (*pb.Empty, error)

ContainerDeployed store deploy status

func (*Vibranium) Copy

func (v *Vibranium) Copy(opts *pb.CopyOptions, stream pb.CoreRPC_CopyServer) error

Copy copy files from multiple containers

func (*Vibranium) CreateContainer

func (v *Vibranium) CreateContainer(opts *pb.DeployOptions, stream pb.CoreRPC_CreateContainerServer) error

CreateContainer create containers

func (*Vibranium) DeployStatus

func (v *Vibranium) DeployStatus(opts *pb.DeployStatusOptions, stream pb.CoreRPC_DeployStatusServer) error

DeployStatus watch and show deployed status

func (*Vibranium) GetContainer

func (v *Vibranium) GetContainer(ctx context.Context, id *pb.ContainerID) (*pb.Container, error)

GetContainer get a container More information will be shown

func (*Vibranium) GetContainers

func (v *Vibranium) GetContainers(ctx context.Context, cids *pb.ContainerIDs) (*pb.Containers, error)

GetContainers get lots containers like GetContainer, information should be returned

func (*Vibranium) GetNode

func (v *Vibranium) GetNode(ctx context.Context, opts *pb.GetNodeOptions) (*pb.Node, error)

GetNode get a node

func (*Vibranium) GetNodeByName

func (v *Vibranium) GetNodeByName(ctx context.Context, opts *pb.GetNodeOptions) (*pb.Node, error)

GetNodeByName get node by name

func (*Vibranium) GetPod

func (v *Vibranium) GetPod(ctx context.Context, opts *pb.GetPodOptions) (*pb.Pod, error)

GetPod show a pod

func (*Vibranium) ListContainers

func (v *Vibranium) ListContainers(ctx context.Context, opts *pb.DeployStatusOptions) (*pb.Containers, error)

ListContainers by appname with optional entrypoint and nodename

func (*Vibranium) ListNetworks

func (v *Vibranium) ListNetworks(ctx context.Context, opts *pb.ListNetworkOptions) (*pb.Networks, error)

ListNetworks list networks for pod

func (*Vibranium) ListNodeContainers

func (v *Vibranium) ListNodeContainers(ctx context.Context, opts *pb.GetNodeOptions) (*pb.Containers, error)

ListNodeContainers list node containers

func (*Vibranium) ListPodNodes

func (v *Vibranium) ListPodNodes(ctx context.Context, opts *pb.ListNodesOptions) (*pb.Nodes, error)

ListPodNodes returns a list of node for pod

func (*Vibranium) ListPods

func (v *Vibranium) ListPods(ctx context.Context, _ *pb.Empty) (*pb.Pods, error)

ListPods returns a list of pods

func (*Vibranium) ReallocResource

func (v *Vibranium) ReallocResource(opts *pb.ReallocOptions, stream pb.CoreRPC_ReallocResourceServer) error

ReallocResource realloc res for containers

func (*Vibranium) RemoveContainer

func (v *Vibranium) RemoveContainer(opts *pb.RemoveContainerOptions, stream pb.CoreRPC_RemoveContainerServer) error

RemoveContainer remove containers

func (*Vibranium) RemoveImage

func (v *Vibranium) RemoveImage(opts *pb.RemoveImageOptions, stream pb.CoreRPC_RemoveImageServer) error

RemoveImage remove image

func (*Vibranium) RemoveNode

func (v *Vibranium) RemoveNode(ctx context.Context, opts *pb.RemoveNodeOptions) (*pb.Pod, error)

RemoveNode removes the node from etcd

func (*Vibranium) RemovePod

func (v *Vibranium) RemovePod(ctx context.Context, opts *pb.RemovePodOptions) (*pb.Empty, error)

RemovePod removes a pod only if it's empty

func (*Vibranium) ReplaceContainer

func (v *Vibranium) ReplaceContainer(opts *pb.ReplaceOptions, stream pb.CoreRPC_ReplaceContainerServer) error

ReplaceContainer replace containers

func (*Vibranium) RunAndWait

func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error

RunAndWait is lambda

func (*Vibranium) SetNodeAvailable

func (v *Vibranium) SetNodeAvailable(ctx context.Context, opts *pb.NodeAvailable) (*pb.Node, error)

SetNodeAvailable set node availability

func (*Vibranium) Wait

func (v *Vibranium) Wait()

Wait for all tasks done 会在外面graceful之后调用. 不完成不给退出进程.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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