Documentation
¶
Index ¶
- Variables
- func Register(kind Kind, create CreateFn) error
- func RegisterEvChan(name Name, get GetEventChanFn, cb EventCbFn) error
- func UnRegisterEvChan(name Name)
- type CreateFn
- type EventCbFn
- type Executor
- type GetEventChanFn
- type Kind
- type Name
- type NodeLabelSetting
- type StopEventsChans
- type TerminalExecutor
Constants ¶
This section is empty.
Variables ¶
View Source
var EvCbMap = map[Name]EventCbFn{}
View Source
var EvFuncMap = map[Name]GetEventChanFn{}
View Source
var Factory = map[Kind]CreateFn{}
Functions ¶
func RegisterEvChan ¶
func RegisterEvChan(name Name, get GetEventChanFn, cb EventCbFn) error
Get a GetEventChanFn according to an executor's name
func UnRegisterEvChan ¶
func UnRegisterEvChan(name Name)
Types ¶
type CreateFn ¶
type CreateFn func(name Name, clustername string, options map[string]string, moreoptions interface{}) (Executor, error)
Create be used to create a executor instance.
type EventCbFn ¶
type EventCbFn func(k string, v interface{}, t storetypes.ChangeType) error
type Executor ¶
type Executor interface { Kind() Kind Name() Name CleanUpBeforeDelete() Create(ctx context.Context, spec interface{}) (interface{}, error) Destroy(ctx context.Context, spec interface{}) error Status(ctx context.Context, spec interface{}) (apistructs.StatusDesc, error) Remove(ctx context.Context, spec interface{}) error Update(ctx context.Context, spec interface{}) (interface{}, error) Inspect(ctx context.Context, spec interface{}) (interface{}, error) Cancel(ctx context.Context, spec interface{}) (interface{}, error) Scale(ctx context.Context, spec interface{}) (interface{}, error) Precheck(ctx context.Context, spec interface{}) (apistructs.ServiceGroupPrecheckData, error) // only k8s-job executor supported JobVolumeCreate(ctx context.Context, spec interface{}) (string, error) // SetNodeLabels set schedule-labels on nodes // Only k8s, k8sjob, marathon, metronome executor implement this function SetNodeLabels(setting NodeLabelSetting, hosts []string, labels map[string]string) error // executor's capacity // 1. addonoperator CapacityInfo() apistructs.CapacityInfoData ResourceInfo(brief bool) (apistructs.ClusterResourceInfoData, error) // only k8s executor supported KillPod(podname string) error }
Executor defines the all interfaces that must be implemented by a executor instance.
type GetEventChanFn ¶
type GetEventChanFn func(Name) (chan *eventtypes.StatusEvent, chan struct{}, *sync.Map, error)
return executor's event channel according to executor's name
type NodeLabelSetting ¶
type NodeLabelSetting struct {
SoldierURL string
}
type StopEventsChans ¶
type StopEventsChans struct { StopWatchEventCh chan struct{} StopHandleEventCh chan struct{} }
type TerminalExecutor ¶
Click to show internal directories.
Click to hide internal directories.