Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetServerVersion ¶ added in v1.5.0
func GetServerVersion() string
ServerVersion retrieves the server version from the configured server URL. It uses the resty library to make an HTTP GET request to the "/v1/version" endpoint. If authentication is configured (username and password), it sets the Basic Auth header. On success, it returns the server version string. On failure (including network errors or invalid server response), it returns "unknown".
func LatestAgentVersion ¶ added in v1.4.0
func LatestAgentVersion() string
LatestAgentVersion retrieves the latest agent version from a remote server. It checks the 'agent.check_version' configuration to determine if version checking is enabled. If enabled, it makes an HTTP GET request to "https://txlog.rda.run/docs/agent/version". If the request is successful and returns a 200 status code, the function returns the body of the response as a string, which represents the latest agent version. If there is an error during the request or the status code is not 200, or if version checking is disabled, the function returns an empty string.
Types ¶
type Package ¶
type Package struct {
Action string `json:"action"`
Name string `json:"name"`
Version string `json:"version"`
Release string `json:"release"`
Epoch string `json:"epoch"`
Arch string `json:"arch"`
Repo string `json:"repo"`
FromRepo string `json:"from_repo,omitempty"`
}
Package represents a single package in a transaction entry.
type ServerVersion ¶ added in v1.1.1
type ServerVersion struct {
Version string `json:"version"`
}
type TransactionDetail ¶
type TransactionDetail struct {
TransactionID string `json:"transaction_id"`
BeginTime string `json:"begin_time"`
BeginRPMDB string `json:"begin_rpmdb"`
EndTime string `json:"end_time"`
EndRPMDB string `json:"end_rpmdb"`
User string `json:"user"`
ReturnCode string `json:"return_code"`
Releasever string `json:"releasever"`
CommandLine string `json:"command_line"`
Comment string `json:"comment"`
PackagesAltered []Package `json:"packages_altered"`
ScriptletOutput []string `json:"scriptlet_output"`
}
TransactionDetail represents a detailed transaction entry, as shown in the 'dnf history info' command.