Documentation ¶
Index ¶
- func NewCustom() (handler.Handler, error)
- type Custom
- func (c *Custom) FinalExecute(command []string)
- func (c *Custom) GetFilterRules() ([]dcSDK.FilterRuleItem, error)
- func (c *Custom) GetPreloadConfig(config dcType.BoosterConfig) (*dcSDK.PreloadConfig, error)
- func (c *Custom) InitExtra(extra []byte)
- func (c *Custom) InitSandbox(sandbox *dcSyscall.Sandbox)
- func (c *Custom) LocalExecute(command []string) (int, error)
- func (c *Custom) LocalExecuteNeed(command []string) bool
- func (c *Custom) LocalLockWeight(command []string) int32
- func (c *Custom) NeedRemoteResource(command []string) bool
- func (c *Custom) OnRemoteFail(command []string) (*dcSDK.BKDistCommand, error)
- func (c *Custom) PostExecute(result *dcSDK.BKDistResult) error
- func (c *Custom) PostExecuteNeedLock(result *dcSDK.BKDistResult) bool
- func (c *Custom) PostLockWeight(result *dcSDK.BKDistResult) int32
- func (c *Custom) PostWork(config *dcType.BoosterConfig) error
- func (c *Custom) PreExecute(command []string) (*dcSDK.BKDistCommand, error)
- func (c *Custom) PreExecuteNeedLock(command []string) bool
- func (c *Custom) PreLockWeight(command []string) int32
- func (c *Custom) PreWork(config *dcType.BoosterConfig) error
- func (c *Custom) RemoteRetryTimes() int
- func (c *Custom) RenderArgs(config dcType.BoosterConfig, originArgs string) string
- func (c *Custom) ResultExtra() []byte
- type Settings
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Custom ¶
type Custom struct {
// contains filtered or unexported fields
}
Custom 定义一个总的custom handler, 转发actions到具体的实现上
func (*Custom) FinalExecute ¶
FinalExecute 收尾工作, 无论如何都会执行的步骤, 例如清理临时文件
func (*Custom) GetFilterRules ¶
func (c *Custom) GetFilterRules() ([]dcSDK.FilterRuleItem, error)
GetFilterRules 获取filter rules配置, 用来决定文件分发的策略
func (*Custom) GetPreloadConfig ¶
func (c *Custom) GetPreloadConfig(config dcType.BoosterConfig) (*dcSDK.PreloadConfig, error)
GetPreloadConfig 获取preload配置, 用来决定hook的对象和处理方法
func (*Custom) InitSandbox ¶
InitSandbox 在执行每个具体任务之前, 都会传入一个当前的执行环境sandbox
func (*Custom) LocalExecute ¶
LocalExecute 自定义本地执行
func (*Custom) LocalExecuteNeed ¶
LocalExecuteNeed 决定是否要自定义本地执行的内容
func (*Custom) LocalLockWeight ¶
LocalLockWeight decide local-execute lock weight, default 1
func (*Custom) NeedRemoteResource ¶
NeedRemoteResource check whether this command need remote resource
func (*Custom) OnRemoteFail ¶
func (c *Custom) OnRemoteFail(command []string) (*dcSDK.BKDistCommand, error)
OnRemoteFail give chance to try other way if failed to remote execute
func (*Custom) PostExecute ¶
func (c *Custom) PostExecute(result *dcSDK.BKDistResult) error
PostExecute 单个任务的后置处理, 需要处理远程任务执行的结果
func (*Custom) PostExecuteNeedLock ¶
func (c *Custom) PostExecuteNeedLock(result *dcSDK.BKDistResult) bool
PostExecuteNeedLock 决定是否需要在执行PostExecute之前获取一个post-lock
func (*Custom) PostLockWeight ¶
func (c *Custom) PostLockWeight(result *dcSDK.BKDistResult) int32
PostLockWeight decide post-execute lock weight, default 1
func (*Custom) PostWork ¶
func (c *Custom) PostWork(config *dcType.BoosterConfig) error
PostWork 处理整个任务的后置工作, 如缓存命中率统计
func (*Custom) PreExecute ¶
func (c *Custom) PreExecute(command []string) (*dcSDK.BKDistCommand, error)
PreExecute 单个任务的预处理, 如c/c++编译的pre-process, 决定了分发到远程处理的任务信息
func (*Custom) PreExecuteNeedLock ¶
PreExecuteNeedLock 决定是否需要在执行PreExecute之前获取一个pre-lock
func (*Custom) PreLockWeight ¶
PreLockWeight decide pre-execute lock weight, default 1
func (*Custom) PreWork ¶
func (c *Custom) PreWork(config *dcType.BoosterConfig) error
PreWork 处理整个任务的前置工作, 如工作空间初始化
func (*Custom) RemoteRetryTimes ¶
RemoteRetryTimes will return the remote retry times
func (*Custom) RenderArgs ¶
func (c *Custom) RenderArgs(config dcType.BoosterConfig, originArgs string) string
RenderArgs 在执行整个任务的指令之前, 会传入原始任务, 允许handler修改