Documentation ¶
Index ¶
- Variables
- func MustRegister(kind Kind, create CreateFn)
- func Register(kind Kind, create CreateFn) error
- type ActionExecutor
- type CreateFn
- type K8sBaseExecutor
- type K8sExecutor
- func (k *K8sExecutor) BatchDelete(ctx context.Context, tasks []*spec.PipelineTask) (data interface{}, err error)
- func (k *K8sExecutor) Cancel(ctx context.Context, task *spec.PipelineTask) (data interface{}, err error)
- func (k *K8sExecutor) Create(ctx context.Context, task *spec.PipelineTask) (data interface{}, err error)
- func (k *K8sExecutor) Exist(ctx context.Context, task *spec.PipelineTask) (created bool, started bool, err error)
- func (k *K8sExecutor) Remove(ctx context.Context, task *spec.PipelineTask) (data interface{}, err error)
- func (k *K8sExecutor) Update(ctx context.Context, task *spec.PipelineTask) (interface{}, error)
- type Kind
- type Name
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EnvRetainNamespace = "RETAIN_NAMESPACE"
)
View Source
var Factory = map[Kind]CreateFn{}
Functions ¶
func MustRegister ¶
MustRegister panic if register failed.
Types ¶
type ActionExecutor ¶
type ActionExecutor interface { Kind() Kind Name() Name // Exist 返回 created, started, error Exist(ctx context.Context, action *spec.PipelineTask) (created bool, started bool, err error) // Create 保证幂等 Create(ctx context.Context, action *spec.PipelineTask) (interface{}, error) // Start 保证幂等 Start(ctx context.Context, action *spec.PipelineTask) (interface{}, error) Update(ctx context.Context, action *spec.PipelineTask) (interface{}, error) // Status 只做简单重试 Status(ctx context.Context, action *spec.PipelineTask) (apistructs.PipelineStatusDesc, error) Inspect(ctx context.Context, action *spec.PipelineTask) (apistructs.TaskInspect, error) Cancel(ctx context.Context, action *spec.PipelineTask) (interface{}, error) Remove(ctx context.Context, action *spec.PipelineTask) (interface{}, error) BatchDelete(ctx context.Context, actions []*spec.PipelineTask) (interface{}, error) }
type CreateFn ¶
type CreateFn func(name Name, options map[string]string) (ActionExecutor, error)
Create be used to create an action executor instance.
type K8sBaseExecutor ¶
type K8sBaseExecutor interface { Kind() Kind Name() Name Status(ctx context.Context, action *spec.PipelineTask) (apistructs.PipelineStatusDesc, error) Delete(ctx context.Context, task *spec.PipelineTask) (data interface{}, err error) // CleanUp clean up all resources under this namespace CleanUp(ctx context.Context, namespace string) error }
type K8sExecutor ¶
type K8sExecutor struct { K8sBaseExecutor // contains filtered or unexported fields }
func NewK8sExecutor ¶
func NewK8sExecutor(exe K8sBaseExecutor) *K8sExecutor
func (*K8sExecutor) BatchDelete ¶
func (k *K8sExecutor) BatchDelete(ctx context.Context, tasks []*spec.PipelineTask) (data interface{}, err error)
func (*K8sExecutor) Cancel ¶
func (k *K8sExecutor) Cancel(ctx context.Context, task *spec.PipelineTask) (data interface{}, err error)
func (*K8sExecutor) Create ¶
func (k *K8sExecutor) Create(ctx context.Context, task *spec.PipelineTask) (data interface{}, err error)
func (*K8sExecutor) Exist ¶
func (k *K8sExecutor) Exist(ctx context.Context, task *spec.PipelineTask) (created bool, started bool, err error)
func (*K8sExecutor) Remove ¶
func (k *K8sExecutor) Remove(ctx context.Context, task *spec.PipelineTask) (data interface{}, err error)
func (*K8sExecutor) Update ¶
func (k *K8sExecutor) Update(ctx context.Context, task *spec.PipelineTask) (interface{}, error)
type Kind ¶
type Kind string
Kind represents an executor's type.
func (Kind) GetClusterNameByExecutorName ¶
func (Kind) MakeK8sKindExecutorName ¶
Click to show internal directories.
Click to hide internal directories.