installinfo

package
v0.0.0-...-e3b314e Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFilePath

func GetFilePath(conf model.Reader) string

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

func WriteInstallInfo(tool, toolVersion, installType string) error

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

func Get

func Get(conf model.Reader) (*InstallInfo, error)

Get returns information about 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

Jump to

Keyboard shortcuts

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