Documentation
¶
Index ¶
- Constants
- Variables
- func CompareFileMD5(filePath string, expectedMD5 string) error
- func DownloadPackage(url string, savePath string, timeout time.Duration) error
- func ExecuteUpdateScript(updateScriptPath string) error
- func ExtractPackage(filePath string, destination string) error
- func ExtractVersionStringFromURL(url string) (string, error)
- func GetAgentName() string
- func GetAgentPathByVersion(version string) string
- func GetInstallDir() string
- func GetInstallDirByCurrentProcess() (string, error)
- func GetUpdateScript() string
- func GetUpdateScriptPathByVersion(version string) string
- func GetUpdatorName() string
- func GetUpdatorPathByCurrentProcess() string
- func RemoveOldVersion(multipleVersionDir string) error
- func RemoveUpdatePackage(tempSavePath string) error
- func ReportCheckMD5Failed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
- func ReportDownloadPackageFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
- func ReportExecuteUpdateScriptFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
- func ReportExecuteUpdateScriptRunnerFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
- func ReportExecuteUpdateScriptRunnerTimeout(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
- func ReportExtractPackageFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
- func ReportValidateExecutableFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
- func ValidateExecutable(executablePath string) error
- type UpdateCheckReport
- type UpdateCheckResp
Constants ¶
View Source
const ( DefaultUnixInstallDir = "/usr/local/share/aliyun-assist" DefaultUnixAgentName = "aliyun-service" DefaultUnixUpdateScript = "update_install" DefaultUnixUpdatorName = "aliyun_assist_update" DefaultWindowsInstallDir = "C:\\ProgramData\\aliyun\\assist" DefaultWindowsAgentName = "aliyun_assist_service.exe" DefaultWindowsUpdateScript = "install.bat" DefaultWindowsUpdatorName = "aliyun_assist_update.exe" )
Variables ¶
View Source
var ( ErrInvalidELF = errors.New("Invalid ELF-format executable") ErrELFUnsupportedOSABI = errors.New("Unsupported OSABI identifier of ELF executable") ErrELFUnsupportedArchitecture = errors.New("Unsupported architecture identifier of ELF executable") ErrInvalidPE = errors.New("Invalid PE-format executable") ErrPEUnsupportedArchitecture = errors.New("Unsupported architecture identifier of PE executable") )
Functions ¶
func CompareFileMD5 ¶
func DownloadPackage ¶
func ExecuteUpdateScript ¶
func ExtractPackage ¶
func GetAgentName ¶
func GetAgentName() string
func GetAgentPathByVersion ¶
func GetInstallDir ¶
func GetInstallDir() string
func GetInstallDirByCurrentProcess ¶
GetInstallDirByCurrentProcess returns normal install direcotry of agent. When agent is installed as **/a/b/aliyun-service, it would return **/a . The "normal install directory" on most Linux distribution: /usr/local/share/aliyun-assist on CoreOS specially: /opt/local/share/aliyun-assist on Windows: C:\ProgramData\aliyun\assist
func GetUpdateScript ¶
func GetUpdateScript() string
func GetUpdatorName ¶
func GetUpdatorName() string
func GetUpdatorPathByCurrentProcess ¶
func GetUpdatorPathByCurrentProcess() string
func RemoveOldVersion ¶
func RemoveUpdatePackage ¶
func ReportCheckMD5Failed ¶
func ReportCheckMD5Failed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
func ReportDownloadPackageFailed ¶
func ReportDownloadPackageFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
func ReportExecuteUpdateScriptFailed ¶
func ReportExecuteUpdateScriptFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
func ReportExecuteUpdateScriptRunnerFailed ¶
func ReportExecuteUpdateScriptRunnerFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
func ReportExecuteUpdateScriptRunnerTimeout ¶
func ReportExecuteUpdateScriptRunnerTimeout(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
func ReportExtractPackageFailed ¶
func ReportExtractPackageFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
func ReportValidateExecutableFailed ¶
func ReportValidateExecutableFailed(err error, updateInfo *UpdateCheckResp, failureContext map[string]interface{})
func ValidateExecutable ¶
Types ¶
type UpdateCheckReport ¶
type UpdateCheckResp ¶
type UpdateCheckResp struct { Flag int64 `json:"flag"` InstanceID string `json:"instanceId"` NeedUpdate int64 `json:"need_update"` NextInterval int64 `json:"next_interval"` UpdateInfo struct { FileName string `json:"file_name"` Md5 string `json:"md5"` URL string `json:"url"` } `json:"update_info"` }
func FetchUpdateInfo ¶
func FetchUpdateInfo() (*UpdateCheckResp, error)
Click to show internal directories.
Click to hide internal directories.