sdk

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkHeartbeatTick    = 5 * time.Second
	WorkHeartbeatTimeout = 10 * WorkHeartbeatTick
)
View Source
const (
	MinFileDescPriority FileDescPriority = 100
	MaxFileDescPriority FileDescPriority = 0

	// 优先级先只定3个
	PriorityLow     = 0
	PriorityMiddle  = 1
	PriorityHight   = 2
	PriorityUnKnown = 99
)
View Source
const (
	ControllerBinary = "bk-dist-controller"
)
View Source
const (
	EmptyWorkerID = "EMPTY_0123456789"
)

Variables

View Source
var (
	ErrControllerNotAvailable   = fmt.Errorf("controller not available")
	ErrControllerNeedBeLaunched = fmt.Errorf("controller need be launched")
	ErrControllerNotReady       = fmt.Errorf("controller not ready")
	ErrControllerKilled         = fmt.Errorf("controller killed")
)

define errors when launch controller

View Source
var (
	FilterErrorUnknownRuleType     = fmt.Errorf("unknown rule type")
	FilterErrorUnknownOperatorType = fmt.Errorf("unknown operator type")
	FilterErrorFileNotExisted      = fmt.Errorf("file not existed")
	FilterErrorStandardInvalid     = fmt.Errorf("input standard parameter is invalid")
)

deinf vars

Functions

func GetControllerConfigToEnv

func GetControllerConfigToEnv(config ControllerConfig) map[string]string

GetControllerConfigToEnv encode controller config to environment variables

func GetJsonToolChainKey

func GetJsonToolChainKey(origiralfullexepath string) string

GetJsonToolChainKey get key from original full exe path, fit json format

func ResolveToolchainEnvValue

func ResolveToolchainEnvValue(value string) (map[string]string, error)

ResolveToolchainEnvValue receive generated env value and return the k-v map

func StatsTimeNow

func StatsTimeNow(t *StatsTime)

StatsTimeNow get a StatsTime from current time

Types

type BKCommand

type BKCommand struct {
	WorkDir         string     `json:"work_dir"`
	ExePath         string     `json:"exe_path"`
	ExeName         string     `json:"exe_name"`
	ExeToolChainKey string     `json:"exe_toolchain_key"`
	Params          []string   `json:"params"`
	Inputfiles      []FileDesc `json:"input_files"`
	ResultFiles     []string   `json:"result_files"`
	Env             []string   `json:"env"`
}

BKCommand command to execute

type BKDistCommand

type BKDistCommand struct {
	Commands []BKCommand `json:"commands"`

	// messages are the raw command ready-to-send data
	Messages []protocol.Message `json:"messages"`

	CustomSave bool `json:"custom_save"` // whether save result file custom
}

BKDistCommand set by handler

type BKDistFileSender

type BKDistFileSender struct {
	Files []FileDesc `'json:"file"`

	Messages []protocol.Message `json:"messages"`
}

BKDistFileSender describe the files sending to worker

type BKDistResult

type BKDistResult struct {
	Results []Result `json:"results"`
}

BKDistResult return to handler

type BKQuerySlot

type BKQuerySlot struct {
	Priority         int32  `json:"priority"`
	WaitTotalTaskNum int32  `json:"wait_total_task_num"`
	TaskType         string `json:"task_type"`
}

BKQuerySlot

type BKQuerySlotResult

type BKQuerySlotResult struct {
	Host             *dcProtocol.Host `json:"host"`
	Priority         int32            `json:"priority"`
	AvailableSlotNum int32            `json:"available_slot_num"`
	Refused          int32            `json:"refused"`
	Message          string           `json:"message"`
}

BKQuerySlotResult

type BKSendFileResult

type BKSendFileResult struct {
	Results []FileResult `json:"file_results"`
}

BKSendFileResult return to handler

type BKSlotRspAck

type BKSlotRspAck struct {
	Consumeslotnum int32 `json:"consume_slot_num"`
}

BKSlotRspAck

type CommonConfigKey

type CommonConfigKey string
const (
	CommonConfigKeyToolChain CommonConfigKey = "common_config_key_tool_chain"
)

type CommonControllerConfig

type CommonControllerConfig struct {
	Configkey CommonConfigKey `json:"config_key"`
	WorkerKey WorkerKeyConfig `json:"worker_key"`
	//Config    interface{}     `json:"config"`
	Data []byte `json:"data"`
}

CommonControllerConfig describe the common config of controller which can be set after controller is launched

type ControllerConfig

type ControllerConfig struct {
	// 需要传递给executor的信息
	NoLocal     bool
	Scheme      string
	IP          string
	Port        int
	DynamicPort bool

	// controller参数
	Timeout             time.Duration
	LogVerbosity        int
	LogDir              string
	TotalSlots          int
	PreSlots            int
	ExeSlots            int
	PostSlots           int
	RemainTime          int
	Sudo                bool
	NoWait              bool
	UseLocalCPUPercent  int
	DisableFileLock     bool
	AutoResourceMgr     bool
	ResIdleSecsForFree  int
	SendCork            bool
	SendFileMemoryLimit int64
	SendMemoryCache     bool
	NetErrorLimit       int
	RemoteRetryTimes    int
	EnableLink          bool
	EnableLib           bool
	LongTCP             bool
	UseDefaultWorker    bool
	WorkerOfferSlot     bool
}

ControllerConfig describe the config of controller

func GetControllerConfigFromEnv

func GetControllerConfigFromEnv() ControllerConfig

GetControllerConfigFromEnv generate the controller config from environment variables

func (ControllerConfig) Address

func (cc ControllerConfig) Address() string

Address return the http address of controller

func (ControllerConfig) Target

func (cc ControllerConfig) Target() string

Target return the server ip and port of controller

type ControllerFileInfo

type ControllerFileInfo struct {
	Fullpath       string
	Size           int64
	Lastmodifytime int64
	Md5            string
	Sendstatus     ControllerFileSendStatus
}

ControllerFileInfo record file info

func (*ControllerFileInfo) Equal

func (f *ControllerFileInfo) Equal(other *ControllerFileInfo) bool

Equal compare two ControllerFileInfo and check if it is equal

type ControllerFileSendStatus

type ControllerFileSendStatus int

ControllerFileSendStatus save file send status

const (
	FileSendInit ControllerFileSendStatus = iota
	FileSending
	FileSendSucceed
	FileSendFailed
	FileSendUnknown = 99
)

define file send status

func (ControllerFileSendStatus) String

func (f ControllerFileSendStatus) String() string

String return the string if file send status

type ControllerFilesByServer

type ControllerFilesByServer struct {
	Server string
	Files  []*ControllerFileInfo
}

ControllerFilesByServer record files info to send for one server

type ControllerJobStats

type ControllerJobStats struct {
	ID                       string `json:"id"`
	Pid                      int    `json:"pid"`
	WorkID                   string `json:"work_id"`
	TaskID                   string `json:"task_id"`
	BoosterType              string `json:"booster_type"`
	RemoteWorker             string `json:"remote_worker"`
	RemoteTryTimes           int    `json:"remote_try_times"`
	RemoteWorkTimeoutSec     int    `json:"remote_work_timeout_sec"`
	RemoteWorkTimeoutSetting int    `json:"remote_work_timeout_setting"`

	Success                         bool `json:"success"`
	PreWorkSuccess                  bool `json:"pre_work_success"`
	RemoteWorkSuccess               bool `json:"remote_work_success"`
	PostWorkSuccess                 bool `json:"post_work_success"`
	FinalWorkSuccess                bool `json:"final_work_success"`
	LocalWorkSuccess                bool `json:"local_work_success"`
	RemoteWorkTimeout               bool `json:"remote_work_timeout"`
	RemoteWorkFatal                 bool `json:"remote_work_fatal"`
	RemoteWorkTimeoutUseSuggest     bool `json:"remote_work_timeout_use_suggest"`
	RemoteWorkOftenRetryAndDegraded bool `json:"remote_work_often_retry_and_degraded"`

	OriginArgs         []string `json:"origin_args"`
	RemoteErrorMessage string   `json:"remote_error_message"`

	EnterTime StatsTime `json:"enter_time"`
	LeaveTime StatsTime `json:"leave_time"`

	PreWorkEnterTime  StatsTime `json:"pre_work_enter_time"`
	PreWorkLeaveTime  StatsTime `json:"pre_work_leave_time"`
	PreWorkLockTime   StatsTime `json:"pre_work_lock_time"`
	PreWorkUnlockTime StatsTime `json:"pre_work_unlock_time"`
	PreWorkStartTime  StatsTime `json:"pre_work_start_time"`
	PreWorkEndTime    StatsTime `json:"pre_work_end_time"`

	PostWorkEnterTime  StatsTime `json:"post_work_enter_time"`
	PostWorkLeaveTime  StatsTime `json:"post_work_leave_time"`
	PostWorkLockTime   StatsTime `json:"post_work_lock_time"`
	PostWorkUnlockTime StatsTime `json:"post_work_unlock_time"`
	PostWorkStartTime  StatsTime `json:"post_work_start_time"`
	PostWorkEndTime    StatsTime `json:"post_work_end_time"`

	FinalWorkStartTime StatsTime `json:"final_work_start_time"`
	FinalWorkEndTime   StatsTime `json:"final_work_end_time"`

	RemoteWorkEnterTime           StatsTime `json:"remote_work_enter_time"`
	RemoteWorkLeaveTime           StatsTime `json:"remote_work_leave_time"`
	RemoteWorkLockTime            StatsTime `json:"remote_work_lock_time"`
	RemoteWorkUnlockTime          StatsTime `json:"remote_work_unlock_time"`
	RemoteWorkStartTime           StatsTime `json:"remote_work_start_time"`
	RemoteWorkEndTime             StatsTime `json:"remote_work_end_time"`
	RemoteWorkPackStartTime       StatsTime `json:"remote_work_pack_start_time"`
	RemoteWorkPackEndTime         StatsTime `json:"remote_work_pack_end_time"`
	RemoteWorkSendStartTime       StatsTime `json:"remote_work_send_start_time"`
	RemoteWorkSendEndTime         StatsTime `json:"remote_work_send_end_time"`
	RemoteWorkPackCommonStartTime StatsTime `json:"remote_work_pack_common_start_time"`
	RemoteWorkPackCommonEndTime   StatsTime `json:"remote_work_pack_common_end_time"`
	RemoteWorkSendCommonStartTime StatsTime `json:"remote_work_send_common_start_time"`
	RemoteWorkSendCommonEndTime   StatsTime `json:"remote_work_send_common_end_time"`
	RemoteWorkProcessStartTime    StatsTime `json:"remote_work_process_start_time"`
	RemoteWorkProcessEndTime      StatsTime `json:"remote_work_process_end_time"`
	RemoteWorkReceiveStartTime    StatsTime `json:"remote_work_receive_start_time"`
	RemoteWorkReceiveEndTime      StatsTime `json:"remote_work_receive_end_time"`
	RemoteWorkUnpackStartTime     StatsTime `json:"remote_work_unpack_start_time"`
	RemoteWorkUnpackEndTime       StatsTime `json:"remote_work_unpack_end_time"`

	LocalWorkEnterTime  StatsTime `json:"local_work_enter_time"`
	LocalWorkLeaveTime  StatsTime `json:"local_work_leave_time"`
	LocalWorkLockTime   StatsTime `json:"local_work_lock_time"`
	LocalWorkUnlockTime StatsTime `json:"local_work_unlock_time"`
	LocalWorkStartTime  StatsTime `json:"local_work_start_time"`
	LocalWorkEndTime    StatsTime `json:"local_work_end_time"`
}

ControllerJobStats describe a single job's stats info

type ControllerProcessInfo

type ControllerProcessInfo struct {
	ProcessID  int    `json:"process_id"`
	ListenPort int    `json:"listen_port"`
	Success    bool   `json:"success"`
	Message    string `json:"message"`
}

ControllerProcessInfo describe the running controller process info

type ControllerRegisterConfig

type ControllerRegisterConfig struct {
	BatchMode        bool
	ServerHost       string
	SpecificHostList []string
	NeedApply        bool
	Apply            *v2.ParamApply
}

ControllerRegisterConfig describe the register config

type ControllerSDK

type ControllerSDK interface {
	// support dinamic listen port,return pid,port,error
	EnsureServer() (int, int, error)
	Register(config ControllerRegisterConfig) (ControllerWorkSDK, error)
	GetWork(workID string) ControllerWorkSDK
	SetConfig(config *CommonControllerConfig) error
}

ControllerSDK describe the controller handler SDK

type ControllerUnregisterConfig

type ControllerUnregisterConfig struct {
	Force   bool
	Release *v2.ParamRelease
}

ControllerUnregisterConfig describe the unregister config

type ControllerWorkSDK

type ControllerWorkSDK interface {
	ID() string
	Job(stats *ControllerJobStats) WorkJob
	Unregister(config ControllerUnregisterConfig) error
	LockLocalSlot(usage JobUsage) error
	UnLockLocalSlot(usage JobUsage) error
	Start() error
	End() error
	Status() (*WorkStatusDetail, error)
	SetSettings(settings *ControllerWorkSettings) error
	GetSettings() (*ControllerWorkSettings, error)
	UpdateJobStats(stats *ControllerJobStats) error
	RecordWorkStats(stats *ControllerWorkStats) error
	IsBatchLeader() bool
}

ControllerWorkSDK describe the controller work handler SDK this is working under a existing work, which is registered by ControllerSDK

type ControllerWorkSettings

type ControllerWorkSettings struct {
	TaskID          string
	ProjectID       string
	Scene           string
	UsageLimit      map[JobUsage]int
	LocalTotalLimit int
	Preload         *PreloadConfig
	FilterRules     []FilterRuleItem
	Degraded        bool
	GlobalSlots     bool
}

ControllerWorkSettings describe the work config which can be set after work is registered

type ControllerWorkStats

type ControllerWorkStats struct {
	Success bool `json:"success"`
}

ControllerWorkStats describe the work stats info

type FileDesc

type FileDesc struct {
	FilePath           string                `json:"file_path"`
	FileSize           int64                 `json:"file_size"`
	Lastmodifytime     int64                 `json:"last_modify_time"`
	Md5                string                `json:"md5"`
	Compresstype       protocol.CompressType `json:"compress_type"`
	Buffer             []byte                `json:"buffer"`
	CompressedSize     int64                 `json:"compressed_size"`
	Targetrelativepath string                `json:"target_relative_path"`
	Filemode           uint32                `json:"file_mode"`
	LinkTarget         string                `json:"link_target"`
	NoDuplicated       bool                  `json:"no_duplicated"`
	AllDistributed     bool                  `json:"all_distributed"`
	Priority           FileDescPriority      `json:"priority"`
}

FileDesc desc file base info

func (*FileDesc) UniqueKey

func (f *FileDesc) UniqueKey() string

UniqueKey define the file unique key

type FileDescPriority

type FileDescPriority int

FileDescPriority from 0 ~ 100, from high to low

type FileResult

type FileResult struct {
	FilePath           string `json:"file_path"`
	RetCode            int32  `json:"ret_code"`
	Targetrelativepath string `json:"target_relative_path"`
}

FileResult desc file base info

type FilterRuleHandle

type FilterRuleHandle int
const (
	FilterRuleHandleDefault FilterRuleHandle = iota
	FilterRuleHandleDeduplication
	FilterRuleHandleAllDistribution
)

type FilterRuleItem

type FilterRuleItem struct {
	Rule       FilterRuleType
	Operator   FilterRuleOperator
	Standard   interface{}
	HandleType FilterRuleHandle
}

FilterRuleItem define rule item

func (*FilterRuleItem) Satisfy

func (f *FilterRuleItem) Satisfy(filepath string) (bool, error)

Satisfy check target satisfy rules

type FilterRuleOperator

type FilterRuleOperator int

FilterRuleOperator define filter rule operators

const (
	FilterRuleOperatorEqual FilterRuleOperator = iota
	FilterRuleOperatorLess
	FilterRuleOperatorGreater
)

const vars

type FilterRuleType

type FilterRuleType int

FilterRuleType define filter rule types

const (
	FilterRuleFileSize FilterRuleType = iota
	FilterRuleFileSuffix
	FilterRuleFilePath
)

const vars

type FilterRules

type FilterRules []FilterRuleItem

func (FilterRules) Satisfy

func (fr FilterRules) Satisfy(filePath string) (bool, FilterRuleHandle, error)

Satisfy check a provided file-path, if it matches the filter rule

type HookConfig

type HookConfig struct {
	SrcCommand    string `json:"src_command"`
	TargetCommand string `json:"target_command"`
}

HookConfig describe the single hook config in PreloadConfig

func (HookConfig) String

func (hc HookConfig) String() string

String return the string of hook config

type JobUsage

type JobUsage string

JobUsage desc executor local job usage

const (
	JobUsageRemoteExe JobUsage = "remote_exe"
	JobUsageLocalPre  JobUsage = "local_pre"
	JobUsageLocalExe  JobUsage = "local_exe"
	JobUsageLocalPost JobUsage = "local_post"
	JobUsageDefault   JobUsage = "default"
)

const for job usage

func (JobUsage) String

func (j JobUsage) String() string

String return the string of job usage

type LocalTaskResult

type LocalTaskResult struct {
	ExitCode int    `json:"exit_code"`
	Stdout   []byte `json:"stdout"`
	Stderr   []byte `json:"stderr"`
	Message  string `json:"message"`
}

LocalTaskResult

type LockMgr

type LockMgr interface {
	// lock local slot
	LockSlots(usage JobUsage, weight int32) bool

	// unlock local slot
	UnlockSlots(usage JobUsage, weight int32)
}

LockMgr to support lock

type OneToolChain

type OneToolChain struct {
	ToolKey                string     `json:"tool_key"`
	ToolName               string     `json:"tool_name"`
	ToolLocalFullPath      string     `json:"tool_local_full_path"`
	ToolRemoteRelativePath string     `json:"tool_remote_relative_path"`
	Files                  []ToolFile `json:"files"`
}

OneToolChain describe the single tool chain info

type PreloadConfig

type PreloadConfig struct {
	Hooks []*HookConfig `json:"hooks"`
}

PreloadConfig describe the preload config

func (PreloadConfig) GetContentRaw

func (pc PreloadConfig) GetContentRaw() string

GetContentRaw generate the hooks info as string

func (PreloadConfig) String

func (pc PreloadConfig) String() string

String return the preload hooks string

type RemoteWorker

type RemoteWorker interface {
	Handler(
		ioTimeout int,
		stats *ControllerJobStats,
		updateJobStatsFunc func(),
		sandbox *syscall.Sandbox) RemoteWorkerHandler
}

RemoteWorker describe the remote worker SDK

type RemoteWorkerHandler

type RemoteWorkerHandler interface {
	ExecuteSyncTime(server string) (int64, error)
	ExecuteTask(server *dcProtocol.Host, req *BKDistCommand) (*BKDistResult, error)
	ExecuteTaskWithoutSaveFile(server *dcProtocol.Host, req *BKDistCommand) (*BKDistResult, error)
	ExecuteSendFile(server *dcProtocol.Host, req *BKDistFileSender, sandbox *syscall.Sandbox, mgr LockMgr) (*BKSendFileResult, error)
	ExecuteCheckCache(server *dcProtocol.Host, req *BKDistFileSender, sandbox *syscall.Sandbox) ([]bool, error)

	// with long tcp connection
	ExecuteTaskWithoutSaveFileLongTCP(server *dcProtocol.Host, req *BKDistCommand) (*BKDistResult, error)
	ExecuteTaskLongTCP(server *dcProtocol.Host, req *BKDistCommand) (*BKDistResult, error)
	ExecuteSendFileLongTCP(server *dcProtocol.Host, req *BKDistFileSender, sandbox *syscall.Sandbox, mgr LockMgr) (*BKSendFileResult, error)
	ExecuteCheckCacheLongTCP(server *dcProtocol.Host, req *BKDistFileSender, sandbox *syscall.Sandbox) ([]bool, error)
	ExecuteSyncTimeLongTCP(server string) (int64, error)

	ExecuteQuerySlot(server *dcProtocol.Host, req *BKQuerySlot, c chan *BKQuerySlotResult, timeout int) (*net.TCPConn, error)
}

RemoteWorkerHandler describe the remote worker handler SDK

type Result

type Result struct {
	RetCode       int32      `json:"ret_code"`
	OutputMessage []byte     `json:"output_message"`
	ErrorMessage  []byte     `json:"error_message"`
	ResultFiles   []FileDesc `json:"result_files"`
}

Result result after execute command

type StatsTime

type StatsTime time.Time

StatsTime 是专为stats中的time.Time字段使用的时间类型, 目的是让其在JSON序列化时, 将time.Time转为UnixNano int64

func (StatsTime) MarshalJSON

func (t StatsTime) MarshalJSON() ([]byte, error)

MarshalJSON generate []byte from StatsTime when json encoding

func (StatsTime) String

func (t StatsTime) String() string

String return the String of StatsTime

func (StatsTime) Time

func (t StatsTime) Time() time.Time

Time return the time.Time of StatsTime

func (StatsTime) Unix

func (t StatsTime) Unix() int64

Unix return the Unix of StatsTime

func (StatsTime) UnixNano

func (t StatsTime) UnixNano() int64

UnixNano return the UnixNano of StatsTime

func (*StatsTime) UnmarshalJSON

func (t *StatsTime) UnmarshalJSON(s []byte) (err error)

UnmarshalJSON parse StatsTime from []byte when json decoding

type ToolFile

type ToolFile struct {
	LocalFullPath      string `json:"local_full_path"`
	RemoteRelativePath string `json:"remote_relative_path"`
}

ToolFile describe tool file target

type Toolchain

type Toolchain struct {
	Toolchains []OneToolChain `json:"toolchains"`
}

Toolchain describe the toolchains

func (*Toolchain) GetToolchainEnvValue

func (t *Toolchain) GetToolchainEnvValue() (string, error)

GetToolchainEnvValue get the generated env value

func (*Toolchain) ToFileDesc

func (t *Toolchain) ToFileDesc() ([]FileDesc, error)

ToFileDesc parse toolchains to file targets

type WorkJob

type WorkJob interface {
	ExecuteRemoteTask(req *BKDistCommand) (*BKDistResult, error)
	// return http code / http message / execute result / execute error
	ExecuteLocalTask(commands []string, workdir string) (int, string, *LocalTaskResult, error)
	SendRemoteFile2All(req []FileDesc) error

	ExecuteLocalTaskWithWebSocket(commands []string, workdir string) (int, string, *LocalTaskResult, error)
}

WorkJob describe the single job handler SDK this is working under a single job

type WorkStatus

type WorkStatus int
const (
	WorkStatusUnknown WorkStatus = iota
	WorkStatusInit
	WorkStatusRegistered
	WorkStatusResourceApplying
	WorkStatusResourceApplied
	WorkStatusResourceApplyFailed
	WorkStatusWorking
	WorkStatusEnded
	WorkStatusUnregistered
	WorkStatusRemovable
)

func (*WorkStatus) CanBeEnd

func (ws *WorkStatus) CanBeEnd() bool

CanBeEnd check if work can be ended now

func (*WorkStatus) CanBeHeartbeat

func (ws *WorkStatus) CanBeHeartbeat() bool

CanBeHeartbeat check if work can be updated heartbeat from booster now

func (*WorkStatus) CanBeRegistered

func (ws *WorkStatus) CanBeRegistered() bool

CanBeRegistered check if work can be registered now

func (*WorkStatus) CanBeRemoved

func (ws *WorkStatus) CanBeRemoved() bool

CanBeRemoved check if work can be removed now

func (*WorkStatus) CanBeResourceApplied

func (ws *WorkStatus) CanBeResourceApplied() bool

CanBeResourceApplied check if work can be set resource applied now

func (*WorkStatus) CanBeResourceApplyFailed

func (ws *WorkStatus) CanBeResourceApplyFailed() bool

CanBeResourceApplyFailed check if work can be set resource apply failed now

func (*WorkStatus) CanBeResourceApplying

func (ws *WorkStatus) CanBeResourceApplying() bool

CanBeResourceApplying check if work can apply resource now

func (*WorkStatus) CanBeSetSettings

func (ws *WorkStatus) CanBeSetSettings() bool

CanBeSetSettings check if work can be set settings now

func (*WorkStatus) CanBeStart

func (ws *WorkStatus) CanBeStart() bool

CanBeStart check if work can be started now

func (*WorkStatus) CanBeUnregistered

func (ws *WorkStatus) CanBeUnregistered() bool

CanBeUnregistered check if work can be unregistered now

func (*WorkStatus) IsResourceApplied

func (ws *WorkStatus) IsResourceApplied() bool

IsResourceApplied check if work is under resource applied

func (*WorkStatus) IsResourceApplyFailed

func (ws *WorkStatus) IsResourceApplyFailed() bool

IsResourceApplyFailed check if work is under resource apply failed

func (*WorkStatus) IsUnregistered

func (ws *WorkStatus) IsUnregistered() bool

IsUnregistered check if work is unregistered

func (*WorkStatus) IsWorking

func (ws *WorkStatus) IsWorking() bool

IsWorking check if work is working

func (WorkStatus) String

func (ws WorkStatus) String() string

String return the string of work status

type WorkStatusDetail

type WorkStatusDetail struct {
	Status  WorkStatus       `json:"status"`
	Message string           `json:"message"`
	Task    *v2.RespTaskInfo `json:"task"`
}

WorkStatusDetail describe the work status

type WorkerKeyConfig

type WorkerKeyConfig struct {
	BatchMode bool
	ProjectID string
	Scene     string
}

WorkerKeyConfig describe the worker unique key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL