config

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalConfig      = ".zadig-agent/agent_config.yaml"
	LocalLogFilePath = ".zadig-agent/log"
	JobArtifactsDir  = "/artifacts"
)
View Source
const AGENT_VERSION = "v1.8.0"

Variables

This section is empty.

Functions

func BatchUpdateAgentConfig

func BatchUpdateAgentConfig(config *AgentConfig) error

func CreateFileIfNotExist

func CreateFileIfNotExist(path string) error

func GetActiveWorkDirectory

func GetActiveWorkDirectory() string

func GetAgentConfigFilePath

func GetAgentConfigFilePath() (string, error)

func GetAgentConfigFilePathWithCheck

func GetAgentConfigFilePathWithCheck() (string, error)

func GetAgentLogFilePath

func GetAgentLogFilePath() (string, error)

func GetAgentLogPath

func GetAgentLogPath() (string, error)

func GetAgentStatus

func GetAgentStatus() string

func GetAgentToken

func GetAgentToken() string

func GetAgentVmName

func GetAgentVmName() string

func GetAgentWorkDir

func GetAgentWorkDir(dir string) (string, error)

func GetArtifactsDir

func GetArtifactsDir(workDir string) (string, error)

func GetCacheDir

func GetCacheDir(workDir string) (string, error)

func GetConcurrency

func GetConcurrency() int

func GetJobLogFilePath

func GetJobLogFilePath(workDir string, job types.ZadigJobTask) (string, error)

func GetJobOutputsTmpDir

func GetJobOutputsTmpDir(workDir string, job types.ZadigJobTask) (string, error)

func GetJobScriptTmpDir

func GetJobScriptTmpDir(workDir string, job types.ZadigJobTask) (string, error)

func GetScheduleWorkflow

func GetScheduleWorkflow() bool

func GetServerURL

func GetServerURL() string

func GetStopFilePath

func GetStopFilePath() (string, error)

func GetUserScriptFilePath

func GetUserScriptFilePath(workDir string) string

func GetWorkDirectory

func GetWorkDirectory() string

func GetZadigVersion

func GetZadigVersion() string

func Home

func Home() string

func InitConfig

func InitConfig() bool

func SetAgentConfig

func SetAgentConfig(config *AgentConfig)

func SetAgentErrMsg

func SetAgentErrMsg(errMsg string)

func SetAgentStatus

func SetAgentStatus(status string)

func SetAgentToken

func SetAgentToken(token string)

func SetAgentWorkDirectory

func SetAgentWorkDirectory(workDirectory string)

func SetConcurrency

func SetConcurrency(concurrency int)

func SetScheduleWorkflow

func SetScheduleWorkflow(scheduleWorkflow bool)

func SetServerURL

func SetServerURL(serverURL string)

func SetZadigVersion

func SetZadigVersion(version string)

func UpdateAgentConfigFile

func UpdateAgentConfigFile(config *AgentConfig, path string) error

Types

type AgentConfig

type AgentConfig struct {
	Token             string `yaml:"token"`
	ServerURL         string `yaml:"server_url"`
	VmName            string `yaml:"vm_name"`
	Description       string `yaml:"description"`
	Concurrency       int    `yaml:"concurrency"`
	CacheType         string `yaml:"cache_type"`
	CachePath         string `yaml:"cache_path"`
	AgentVersion      string `yaml:"agent_version"`
	ZadigVersion      string `yaml:"zadig_version"`
	AgentPlatform     string `yaml:"agent_platform"`
	AgentArchitecture string `yaml:"agent_architecture"`
	InstallTime       int64  `yaml:"install_time"`
	InstallUser       string `yaml:"install_user"`
	Status            string `yaml:"status"`
	ErrMsg            string `yaml:"err_msg"`
	ScheduleWorkflow  bool   `yaml:"schedule_workflow"`
	WorkDirectory     string `yaml:"work_directory"`
}

func GetAgentConfig

func GetAgentConfig() (*AgentConfig, error)

func NewAgentConfig

func NewAgentConfig() *AgentConfig

Jump to

Keyboard shortcuts

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