kubekey/pkg/core/module/interface.go
24sama 949297d110 dev-v2.0.0: add desc for moduels
Signed-off-by: 24sama <leo@kubesphere.io>
2021-11-01 18:15:33 +08:00

27 lines
657 B
Go

package module
import (
"github.com/kubesphere/kubekey/pkg/core/cache"
"github.com/kubesphere/kubekey/pkg/core/connector"
"github.com/kubesphere/kubekey/pkg/core/ending"
)
type Module interface {
IsSkip() bool
Default(runtime connector.Runtime, pipelineCache *cache.Cache, moduleCache *cache.Cache)
Init()
Is() string
Run(result *ending.ModuleResult)
Until() (*bool, error)
Slogan()
AutoAssert()
AppendPostHook(h PostHookInterface)
CallPostHook(result *ending.ModuleResult) error
}
type Task interface {
GetDesc() string
Init(runtime connector.Runtime, moduleCache *cache.Cache, pipelineCache *cache.Cache)
Execute() *ending.TaskResult
}