Documentation ¶
Index ¶
- type CPUMemNodeContainers
- type CPUMemNodeContainersMap
- type Calcium
- func (c *Calcium) AddNode(ctx context.Context, nodename, endpoint, podname, ca, cert, key string, ...) (*types.Node, error)
- func (c *Calcium) AddPod(ctx context.Context, podname, favor, desc string) (*types.Pod, error)
- func (c *Calcium) BuildImage(ctx context.Context, opts *types.BuildOptions) (chan *types.BuildImageMessage, error)
- func (c *Calcium) ContainerDeployed(ctx context.Context, ID, appname, entrypoint, nodename, data string) error
- func (c *Calcium) Copy(ctx context.Context, opts *types.CopyOptions) (chan *types.CopyMessage, error)
- func (c *Calcium) CreateContainer(ctx context.Context, opts *types.DeployOptions) (chan *types.CreateContainerMessage, error)
- func (c *Calcium) DeployStatusStream(ctx context.Context, appname, entrypoint, nodename string) chan *types.DeployStatus
- func (c *Calcium) GetContainer(ctx context.Context, ID string) (*types.Container, error)
- func (c *Calcium) GetContainers(ctx context.Context, IDs []string) ([]*types.Container, error)
- func (c *Calcium) GetNode(ctx context.Context, podname, nodename string) (*types.Node, error)
- func (c *Calcium) GetNodeByName(ctx context.Context, nodename string) (*types.Node, error)
- func (c *Calcium) GetPod(ctx context.Context, podname string) (*types.Pod, error)
- func (c *Calcium) ListContainers(ctx context.Context, appname, entrypoint, nodename string) ([]*types.Container, error)
- func (c *Calcium) ListNetworks(ctx context.Context, podname string, driver string) ([]*types.Network, error)
- func (c *Calcium) ListNodeContainers(ctx context.Context, nodename string) ([]*types.Container, error)
- func (c *Calcium) ListPodNodes(ctx context.Context, podname string, all bool) ([]*types.Node, error)
- func (c *Calcium) ListPods(ctx context.Context) ([]*types.Pod, error)
- func (c *Calcium) Lock(ctx context.Context, name string, timeout int) (lock.DistributedLock, error)
- func (c *Calcium) ReallocResource(ctx context.Context, IDs []string, cpu float64, mem int64) (chan *types.ReallocResourceMessage, error)
- func (c *Calcium) RemoveContainer(ctx context.Context, IDs []string, force bool) (chan *types.RemoveContainerMessage, error)
- func (c *Calcium) RemoveImage(ctx context.Context, podname, nodename string, images []string) (chan *types.RemoveImageMessage, error)
- func (c *Calcium) RemoveNode(ctx context.Context, nodename, podname string) (*types.Pod, error)
- func (c *Calcium) RemovePod(ctx context.Context, podname string) error
- func (c *Calcium) ReplaceContainer(ctx context.Context, opts *types.DeployOptions, force bool) (chan *types.ReplaceContainerMessage, error)
- func (c *Calcium) RunAndWait(ctx context.Context, opts *types.DeployOptions, stdin io.ReadCloser) (chan *types.RunAndWaitMessage, error)
- func (c *Calcium) SetNodeAvailable(ctx context.Context, podname, nodename string, available bool) (*types.Node, error)
- func (c *Calcium) SetStore(s store.Store)
- type NodeCPUMap
- type NodeContainers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUMemNodeContainers ¶
type CPUMemNodeContainers map[float64]map[int64]NodeContainers
CPUMemNodeContainers store cpu, mem and nodecontainers
type CPUMemNodeContainersMap ¶
type CPUMemNodeContainersMap map[float64]map[int64]NodeCPUMap
CPUMemNodeContainersMap store cpu, mem and nodecpumap
type Calcium ¶
type Calcium struct {
// contains filtered or unexported fields
}
Calcium implement the cluster
func (*Calcium) AddNode ¶
func (c *Calcium) AddNode(ctx context.Context, nodename, endpoint, podname, ca, cert, key string, cpu, share int, memory int64, labels map[string]string) (*types.Node, error)
AddNode add a node in pod
func (*Calcium) BuildImage ¶
func (c *Calcium) BuildImage(ctx context.Context, opts *types.BuildOptions) (chan *types.BuildImageMessage, error)
BuildImage will build image for repository since we wanna set UID for the user inside container, we have to know the uid parameter
build directory is like:
buildDir ├─ :appname ├─ code ├─ Dockerfile
func (*Calcium) ContainerDeployed ¶
func (c *Calcium) ContainerDeployed(ctx context.Context, ID, appname, entrypoint, nodename, data string) error
ContainerDeployed show container deploy status
func (*Calcium) Copy ¶
func (c *Calcium) Copy(ctx context.Context, opts *types.CopyOptions) (chan *types.CopyMessage, error)
Copy uses docker cp to copy specified things and send to remote
func (*Calcium) CreateContainer ¶
func (c *Calcium) CreateContainer(ctx context.Context, opts *types.DeployOptions) (chan *types.CreateContainerMessage, error)
CreateContainer use options to create containers
func (*Calcium) DeployStatusStream ¶
func (c *Calcium) DeployStatusStream(ctx context.Context, appname, entrypoint, nodename string) chan *types.DeployStatus
DeployStatusStream watch deploy status
func (*Calcium) GetContainer ¶
GetContainer get a container
func (*Calcium) GetContainers ¶
GetContainers get containers
func (*Calcium) GetNodeByName ¶
GetNodeByName get node by name
func (*Calcium) ListContainers ¶
func (c *Calcium) ListContainers(ctx context.Context, appname, entrypoint, nodename string) ([]*types.Container, error)
ListContainers list containers
func (*Calcium) ListNetworks ¶
func (c *Calcium) ListNetworks(ctx context.Context, podname string, driver string) ([]*types.Network, error)
ListNetworks by podname just get one node from podname and call docker network ls only get those driven by network driver
func (*Calcium) ListNodeContainers ¶
func (c *Calcium) ListNodeContainers(ctx context.Context, nodename string) ([]*types.Container, error)
ListNodeContainers list containers belong to one node
func (*Calcium) ListPodNodes ¶
func (c *Calcium) ListPodNodes(ctx context.Context, podname string, all bool) ([]*types.Node, error)
ListPodNodes list nodes belong to pod
func (*Calcium) ReallocResource ¶
func (c *Calcium) ReallocResource(ctx context.Context, IDs []string, cpu float64, mem int64) (chan *types.ReallocResourceMessage, error)
ReallocResource allow realloc container resource
func (*Calcium) RemoveContainer ¶
func (c *Calcium) RemoveContainer(ctx context.Context, IDs []string, force bool) (chan *types.RemoveContainerMessage, error)
RemoveContainer remove containers returns a channel that contains removing responses
func (*Calcium) RemoveImage ¶
func (c *Calcium) RemoveImage(ctx context.Context, podname, nodename string, images []string) (chan *types.RemoveImageMessage, error)
RemoveImage remove images
func (*Calcium) RemoveNode ¶
RemoveNode remove a node
func (*Calcium) ReplaceContainer ¶
func (c *Calcium) ReplaceContainer(ctx context.Context, opts *types.DeployOptions, force bool) (chan *types.ReplaceContainerMessage, error)
ReplaceContainer replace containers with same resource
func (*Calcium) RunAndWait ¶
func (c *Calcium) RunAndWait(ctx context.Context, opts *types.DeployOptions, stdin io.ReadCloser) (chan *types.RunAndWaitMessage, error)
RunAndWait implement lambda