Documentation
¶
Overview ¶
Package installinfo offers helpers to interact with the 'install_info' file.
The install_info files is present next to the agent configuration and contains information about how the agent was// installed and its version history. The file is automatically updated by installation tools (MSI installer, Chef, Ansible, DPKG, ...).
Package installinfo offers helpers to interact with the 'install_info' file.
The install_info files is present next to the agent configuration and contains information about how the agent was// installed and its version history. The file is automatically updated by installation tools (MSI installer, Chef, Ansible, DPKG, ...).
Index ¶
- func GetFilePath(conf model.Reader) string
- func HandleGetInstallInfo(w http.ResponseWriter, _ *http.Request)
- func HandleSetInstallInfo(w http.ResponseWriter, r *http.Request)
- func LogVersionHistory()
- func RmInstallInfo()
- func WriteInstallInfo(tool, toolVersion, installType string) error
- type InstallInfo
- type SetInstallInfoRequest
- type SetInstallInfoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFilePath ¶
GetFilePath returns the path of the 'install_info' directory relative to the loaded coinfiguration file. The 'install_info' directory contains information about how the agent was installed.
func HandleGetInstallInfo ¶
func HandleGetInstallInfo(w http.ResponseWriter, _ *http.Request)
HandleGetInstallInfo is an HTTP handler for getting current install info
func HandleSetInstallInfo ¶
func HandleSetInstallInfo(w http.ResponseWriter, r *http.Request)
HandleSetInstallInfo is an HTTP handler for setting install info at runtime
func LogVersionHistory ¶
func LogVersionHistory()
LogVersionHistory loads version history file, append new entry if agent version is different than the last entry in the JSON file, trim the file if too many entries then save the file.
func RmInstallInfo ¶
func RmInstallInfo()
RmInstallInfo removes the install info and signature files
func WriteInstallInfo ¶
WriteInstallInfo write install info and signature files
Types ¶
type InstallInfo ¶
type InstallInfo struct {
Tool string `json:"tool" yaml:"tool"`
ToolVersion string `json:"tool_version" yaml:"tool_version"`
InstallerVersion string `json:"installer_version" yaml:"installer_version"`
}
InstallInfo contains metadata on how the Agent was installed
type SetInstallInfoRequest ¶
type SetInstallInfoRequest struct {
Tool string `json:"tool"`
ToolVersion string `json:"tool_version"`
InstallerVersion string `json:"installer_version"`
}
SetInstallInfoRequest represents the JSON payload for setting install info
type SetInstallInfoResponse ¶
type SetInstallInfoResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
}
SetInstallInfoResponse represents the response after setting install info