Documentation ¶
Index ¶
- type Calcium
- func (c *Calcium) AddNode(ctx context.Context, opts *types.AddNodeOptions) (*types.Node, error)
- func (c *Calcium) AddPod(ctx context.Context, podname, desc string) (*types.Pod, error)
- func (c *Calcium) BuildImage(ctx context.Context, opts *types.BuildOptions) (ch chan *types.BuildImageMessage, err error)
- func (c *Calcium) CacheImage(ctx context.Context, opts *types.ImageOptions) (chan *types.CacheImageMessage, error)
- func (c *Calcium) CalculateCapacity(ctx context.Context, opts *types.DeployOptions) (*types.CapacityMessage, error)
- func (c *Calcium) ConnectNetwork(ctx context.Context, network, target, ipv4, ipv6 string) ([]string, error)
- func (c *Calcium) ControlWorkload(ctx context.Context, IDs []string, typ string, force bool) (chan *types.ControlWorkloadMessage, error)
- func (c *Calcium) Copy(ctx context.Context, opts *types.CopyOptions) (chan *types.CopyMessage, error)
- func (c *Calcium) CreateWorkload(ctx context.Context, opts *types.DeployOptions) (chan *types.CreateWorkloadMessage, error)
- func (c *Calcium) DisasterRecover(ctx context.Context)
- func (c *Calcium) DisconnectNetwork(ctx context.Context, network, target string, force bool) error
- func (c *Calcium) DissociateWorkload(ctx context.Context, IDs []string) (chan *types.DissociateWorkloadMessage, error)
- func (c *Calcium) ExecuteWorkload(ctx context.Context, opts *types.ExecuteWorkloadOptions, inCh <-chan []byte) chan *types.AttachWorkloadMessage
- func (c *Calcium) Finalizer()
- func (c *Calcium) GetIdentifier() string
- func (c *Calcium) GetNode(ctx context.Context, nodename string) (node *types.Node, err error)
- func (c *Calcium) GetNodeEngineInfo(ctx context.Context, nodename string) (*enginetypes.Info, error)
- func (c *Calcium) GetNodeStatus(ctx context.Context, nodename string) (*types.NodeStatus, error)
- func (c *Calcium) GetPod(ctx context.Context, podname string) (*types.Pod, error)
- func (c *Calcium) GetStore() store.Store
- func (c *Calcium) GetWorkload(ctx context.Context, ID string) (workload *types.Workload, err error)
- func (c *Calcium) GetWorkloads(ctx context.Context, IDs []string) (workloads []*types.Workload, err error)
- func (c *Calcium) GetWorkloadsStatus(ctx context.Context, IDs []string) ([]*types.StatusMeta, error)
- func (c *Calcium) InitMetrics(ctx context.Context)
- func (c *Calcium) ListImage(ctx context.Context, opts *types.ImageOptions) (chan *types.ListImageMessage, error)
- func (c *Calcium) ListNetworks(ctx context.Context, podname string, driver string) ([]*enginetypes.Network, error)
- func (c *Calcium) ListNodeWorkloads(ctx context.Context, nodename string, labels map[string]string) (workloads []*types.Workload, err error)
- func (c *Calcium) ListPodNodes(ctx context.Context, opts *types.ListNodesOptions) (<-chan *types.Node, error)
- func (c *Calcium) ListPods(ctx context.Context) ([]*types.Pod, error)
- func (c *Calcium) ListWorkloads(ctx context.Context, opts *types.ListWorkloadsOptions) (workloads []*types.Workload, err error)
- func (c *Calcium) LogStream(ctx context.Context, opts *types.LogStreamOptions) (chan *types.LogStreamMessage, error)
- func (c *Calcium) NodeResource(ctx context.Context, nodename string, fix bool) (*types.NodeResourceInfo, error)
- func (c *Calcium) NodeStatusStream(ctx context.Context) chan *types.NodeStatus
- func (c *Calcium) PodResource(ctx context.Context, podname string) (chan *types.NodeResourceInfo, error)
- func (c *Calcium) RawEngine(ctx context.Context, opts *types.RawEngineOptions) (msg *types.RawEngineMessage, err error)
- func (c *Calcium) ReallocResource(ctx context.Context, opts *types.ReallocOptions) (err error)
- func (c *Calcium) RegisterService(ctx context.Context) (unregister func(), err error)
- func (c *Calcium) RemapResourceAndLog(ctx context.Context, logger *log.Fields, node *types.Node)
- func (c *Calcium) RemoveImage(ctx context.Context, opts *types.ImageOptions) (chan *types.RemoveImageMessage, error)
- func (c *Calcium) RemoveNode(ctx context.Context, nodename string) error
- func (c *Calcium) RemovePod(ctx context.Context, podname string) error
- func (c *Calcium) RemoveWorkload(ctx context.Context, IDs []string, force bool) (chan *types.RemoveWorkloadMessage, error)
- func (c *Calcium) RemoveWorkloadSync(ctx context.Context, IDs []string) error
- func (c *Calcium) ReplaceWorkload(ctx context.Context, opts *types.ReplaceOptions) (chan *types.ReplaceWorkloadMessage, error)
- func (c *Calcium) RunAndWait(ctx context.Context, opts *types.DeployOptions, inCh <-chan []byte) ([]string, <-chan *types.AttachWorkloadMessage, error)
- func (c *Calcium) Send(ctx context.Context, opts *types.SendOptions) (chan *types.SendMessage, error)
- func (c *Calcium) SendLargeFile(ctx context.Context, inputChan chan *types.SendLargeFileOptions) chan *types.SendMessage
- func (c *Calcium) SetNode(ctx context.Context, opts *types.SetNodeOptions) (*types.Node, error)
- func (c *Calcium) SetNodeStatus(ctx context.Context, nodename string, ttl int64) error
- func (c *Calcium) SetWorkloadsStatus(ctx context.Context, statusMetas []*types.StatusMeta, ttls map[string]int64) ([]*types.StatusMeta, error)
- func (c *Calcium) WatchServiceStatus(ctx context.Context) (<-chan types.ServiceStatus, error)
- func (c *Calcium) WorkloadStatusStream(ctx context.Context, appname, entrypoint, nodename string, ...) chan *types.WorkloadStatus
- type CreateLambdaHandler
- func (h *CreateLambdaHandler) Check(context.Context, any) (bool, error)
- func (h *CreateLambdaHandler) Decode(bs []byte) (any, error)
- func (h *CreateLambdaHandler) Encode(raw any) ([]byte, error)
- func (h *CreateLambdaHandler) Handle(ctx context.Context, raw any) error
- func (h *CreateLambdaHandler) Typ() string
- type CreateWorkloadHandler
- func (h *CreateWorkloadHandler) Check(_ context.Context, raw any) (handle bool, err error)
- func (h *CreateWorkloadHandler) Decode(bs []byte) (any, error)
- func (h *CreateWorkloadHandler) Encode(raw any) ([]byte, error)
- func (h *CreateWorkloadHandler) Handle(ctx context.Context, raw any) (err error)
- func (h *CreateWorkloadHandler) Typ() string
- type ProcessingCreatedHandler
- func (h ProcessingCreatedHandler) Check(_ context.Context, raw any) (bool, error)
- func (h *ProcessingCreatedHandler) Decode(bs []byte) (any, error)
- func (h *ProcessingCreatedHandler) Encode(raw any) ([]byte, error)
- func (h *ProcessingCreatedHandler) Handle(ctx context.Context, raw any) (err error)
- func (h *ProcessingCreatedHandler) Typ() string
- type WorkloadResourceAllocatedHandler
- func (h *WorkloadResourceAllocatedHandler) Check(_ context.Context, raw any) (bool, error)
- func (h *WorkloadResourceAllocatedHandler) Decode(bytes []byte) (any, error)
- func (h *WorkloadResourceAllocatedHandler) Encode(raw any) ([]byte, error)
- func (h *WorkloadResourceAllocatedHandler) Handle(ctx context.Context, raw any) (err error)
- func (h *WorkloadResourceAllocatedHandler) Typ() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calcium ¶
type Calcium struct {
// contains filtered or unexported fields
}
Calcium implement the cluster
func (*Calcium) BuildImage ¶
func (c *Calcium) BuildImage(ctx context.Context, opts *types.BuildOptions) (ch chan *types.BuildImageMessage, err error)
BuildImage will build image
func (*Calcium) CacheImage ¶
func (c *Calcium) CacheImage(ctx context.Context, opts *types.ImageOptions) (chan *types.CacheImageMessage, error)
CacheImage cache Image 在podname上cache这个image 实际上就是在所有的node上去pull一次
func (*Calcium) CalculateCapacity ¶
func (c *Calcium) CalculateCapacity(ctx context.Context, opts *types.DeployOptions) (*types.CapacityMessage, error)
CalculateCapacity calculates capacity
func (*Calcium) ConnectNetwork ¶
func (c *Calcium) ConnectNetwork(ctx context.Context, network, target, ipv4, ipv6 string) ([]string, error)
ConnectNetwork connect to a network
func (*Calcium) ControlWorkload ¶
func (c *Calcium) ControlWorkload(ctx context.Context, IDs []string, typ string, force bool) (chan *types.ControlWorkloadMessage, error)
ControlWorkload control workloads status
func (*Calcium) Copy ¶
func (c *Calcium) Copy(ctx context.Context, opts *types.CopyOptions) (chan *types.CopyMessage, error)
Copy uses VirtualizationCopyFrom cp to copy specified things and send to remote
func (*Calcium) CreateWorkload ¶
func (c *Calcium) CreateWorkload(ctx context.Context, opts *types.DeployOptions) (chan *types.CreateWorkloadMessage, error)
CreateWorkload use options to create workloads
func (*Calcium) DisasterRecover ¶
DisasterRecover .
func (*Calcium) DisconnectNetwork ¶
DisconnectNetwork connect to a network
func (*Calcium) DissociateWorkload ¶
func (c *Calcium) DissociateWorkload(ctx context.Context, IDs []string) (chan *types.DissociateWorkloadMessage, error)
DissociateWorkload dissociate workload from eru, return it resource but not modity it
func (*Calcium) ExecuteWorkload ¶
func (c *Calcium) ExecuteWorkload(ctx context.Context, opts *types.ExecuteWorkloadOptions, inCh <-chan []byte) chan *types.AttachWorkloadMessage
ExecuteWorkload executes commands in running workloads
func (*Calcium) GetIdentifier ¶
GetIdentifier returns the identifier of calcium
func (*Calcium) GetNodeEngineInfo ¶
func (c *Calcium) GetNodeEngineInfo(ctx context.Context, nodename string) (*enginetypes.Info, error)
GetNodeEngineInfo get node engine
func (*Calcium) GetNodeStatus ¶
GetNodeStatus set status of a node it's used to report whether a node is still alive
func (*Calcium) GetWorkload ¶
GetWorkload get a workload
func (*Calcium) GetWorkloads ¶
func (c *Calcium) GetWorkloads(ctx context.Context, IDs []string) (workloads []*types.Workload, err error)
GetWorkloads get workloads
func (*Calcium) GetWorkloadsStatus ¶
func (c *Calcium) GetWorkloadsStatus(ctx context.Context, IDs []string) ([]*types.StatusMeta, error)
GetWorkloadsStatus get workload status
func (*Calcium) ListImage ¶
func (c *Calcium) ListImage(ctx context.Context, opts *types.ImageOptions) (chan *types.ListImageMessage, error)
ListImage list Image on a pod or some nodes.
func (*Calcium) ListNetworks ¶
func (c *Calcium) ListNetworks(ctx context.Context, podname string, driver string) ([]*enginetypes.Network, error)
ListNetworks by podname get one node from a pod and list networks only get those driven by network driver
func (*Calcium) ListNodeWorkloads ¶
func (c *Calcium) ListNodeWorkloads(ctx context.Context, nodename string, labels map[string]string) (workloads []*types.Workload, err error)
ListNodeWorkloads list workloads belong to one node
func (*Calcium) ListPodNodes ¶
func (c *Calcium) ListPodNodes(ctx context.Context, opts *types.ListNodesOptions) (<-chan *types.Node, error)
ListPodNodes list nodes belong to pod node with resource info
func (*Calcium) ListWorkloads ¶
func (c *Calcium) ListWorkloads(ctx context.Context, opts *types.ListWorkloadsOptions) (workloads []*types.Workload, err error)
ListWorkloads list workloads
func (*Calcium) LogStream ¶
func (c *Calcium) LogStream(ctx context.Context, opts *types.LogStreamOptions) (chan *types.LogStreamMessage, error)
LogStream log stream for one workload
func (*Calcium) NodeResource ¶
func (c *Calcium) NodeResource(ctx context.Context, nodename string, fix bool) (*types.NodeResourceInfo, error)
NodeResource check node's workload and resource
func (*Calcium) NodeStatusStream ¶
func (c *Calcium) NodeStatusStream(ctx context.Context) chan *types.NodeStatus
NodeStatusStream returns a stream of node status for subscribing
func (*Calcium) PodResource ¶
func (c *Calcium) PodResource(ctx context.Context, podname string) (chan *types.NodeResourceInfo, error)
PodResource show pod resource usage
func (*Calcium) RawEngine ¶
func (c *Calcium) RawEngine(ctx context.Context, opts *types.RawEngineOptions) (msg *types.RawEngineMessage, err error)
func (*Calcium) ReallocResource ¶
ReallocResource updates workload resource dynamically
func (*Calcium) RegisterService ¶
RegisterService writes self service address in store
func (*Calcium) RemapResourceAndLog ¶
RemapResourceAndLog called on changes of resource binding, such as cpu binding as an internal api, remap doesn't lock node, the responsibility of that should be taken on by caller
func (*Calcium) RemoveImage ¶
func (c *Calcium) RemoveImage(ctx context.Context, opts *types.ImageOptions) (chan *types.RemoveImageMessage, error)
RemoveImage remove images
func (*Calcium) RemoveNode ¶
RemoveNode remove a node
func (*Calcium) RemoveWorkload ¶
func (c *Calcium) RemoveWorkload(ctx context.Context, IDs []string, force bool) (chan *types.RemoveWorkloadMessage, error)
RemoveWorkload remove workloads returns a channel that contains removing responses
func (*Calcium) RemoveWorkloadSync ¶
RemoveWorkloadSync .
func (*Calcium) ReplaceWorkload ¶
func (c *Calcium) ReplaceWorkload(ctx context.Context, opts *types.ReplaceOptions) (chan *types.ReplaceWorkloadMessage, error)
ReplaceWorkload replace workloads with same resource
func (*Calcium) RunAndWait ¶
func (c *Calcium) RunAndWait(ctx context.Context, opts *types.DeployOptions, inCh <-chan []byte) ([]string, <-chan *types.AttachWorkloadMessage, error)
RunAndWait implement lambda
func (*Calcium) Send ¶
func (c *Calcium) Send(ctx context.Context, opts *types.SendOptions) (chan *types.SendMessage, error)
Send files to workload
func (*Calcium) SendLargeFile ¶
func (c *Calcium) SendLargeFile(ctx context.Context, inputChan chan *types.SendLargeFileOptions) chan *types.SendMessage
SendLargeFile send large files by stream to workload
func (*Calcium) SetNodeStatus ¶
SetNodeStatus set status of a node it's used to report whether a node is still alive
func (*Calcium) SetWorkloadsStatus ¶
func (c *Calcium) SetWorkloadsStatus(ctx context.Context, statusMetas []*types.StatusMeta, ttls map[string]int64) ([]*types.StatusMeta, error)
SetWorkloadsStatus set workloads status
func (*Calcium) WatchServiceStatus ¶
WatchServiceStatus returns chan of available service address
func (*Calcium) WorkloadStatusStream ¶
func (c *Calcium) WorkloadStatusStream(ctx context.Context, appname, entrypoint, nodename string, labels map[string]string) chan *types.WorkloadStatus
WorkloadStatusStream stream workload status
type CreateLambdaHandler ¶
type CreateLambdaHandler struct {
// contains filtered or unexported fields
}
CreateLambdaHandler indicates event handler for creating lambda.
func (*CreateLambdaHandler) Decode ¶
func (h *CreateLambdaHandler) Decode(bs []byte) (any, error)
Decode .
func (*CreateLambdaHandler) Encode ¶
func (h *CreateLambdaHandler) Encode(raw any) ([]byte, error)
Encode .
type CreateWorkloadHandler ¶
type CreateWorkloadHandler struct {
// contains filtered or unexported fields
}
CreateWorkloadHandler indicates event handler for creating workload.
func (*CreateWorkloadHandler) Decode ¶
func (h *CreateWorkloadHandler) Decode(bs []byte) (any, error)
Decode .
func (*CreateWorkloadHandler) Encode ¶
func (h *CreateWorkloadHandler) Encode(raw any) ([]byte, error)
Encode .
type ProcessingCreatedHandler ¶
type ProcessingCreatedHandler struct {
// contains filtered or unexported fields
}
ProcessingCreatedHandler .
func (*ProcessingCreatedHandler) Decode ¶
func (h *ProcessingCreatedHandler) Decode(bs []byte) (any, error)
Decode .
func (*ProcessingCreatedHandler) Encode ¶
func (h *ProcessingCreatedHandler) Encode(raw any) ([]byte, error)
Encode .
type WorkloadResourceAllocatedHandler ¶
type WorkloadResourceAllocatedHandler struct {
// contains filtered or unexported fields
}
WorkloadResourceAllocatedHandler .
func (*WorkloadResourceAllocatedHandler) Decode ¶
func (h *WorkloadResourceAllocatedHandler) Decode(bytes []byte) (any, error)
Decode .
func (*WorkloadResourceAllocatedHandler) Encode ¶
func (h *WorkloadResourceAllocatedHandler) Encode(raw any) ([]byte, error)
Encode .
func (*WorkloadResourceAllocatedHandler) Handle ¶
func (h *WorkloadResourceAllocatedHandler) Handle(ctx context.Context, raw any) (err error)
Handle .
func (*WorkloadResourceAllocatedHandler) Typ ¶
func (h *WorkloadResourceAllocatedHandler) Typ() string
Event .
Source Files ¶
- build.go
- calcium.go
- capacity.go
- control.go
- copy.go
- create.go
- dissociate.go
- execute.go
- helper.go
- hook.go
- image.go
- lambda.go
- lock.go
- log.go
- metrics.go
- network.go
- node.go
- pod.go
- raw_engine.go
- realloc.go
- remap.go
- remove.go
- replace.go
- resource.go
- send.go
- sendlarge.go
- service.go
- status.go
- stream.go
- wal.go
- workload.go