Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInput = errors.New("bad program input") ErrPermissions = errors.New("bad permissions") ErrRegistered = errors.New("host is registered") ErrNotRegistered = errors.New("host is not registered") )
var ArchiveDirectoryParentPath = "/var/cache/insights-client/"
ArchiveDirectoryParentPath is a parent directory for archive directories.
var ConfigPath = "/etc/insights-client/insights-client.conf"
ConfigPath points to a file where a configuration file is stored.
var DefaultModuleName = "advisor"
DefaultModuleName is run when CLI did not specify anything else.
var DotRegisteredPath = "/etc/insights-client/.registered"
var DotUnregisteredPath = "/etc/insights-client/.unregistered"
var LogPath = "/var/log/insights-client/insights-client.log"
LogPath points to a file into which logs should be written.
var MachineIDFilePath = "/etc/insights-client/machine-id"
MachineIDFilePath points to a file where the client UUID is stored.
var TagsPath = "/etc/insights-client/tags.yaml"
var Version = "development"
Functions ¶
func ClearConfiguration ¶
func ClearConfiguration()
ClearConfiguration clears the configuration cached in memory.
func ParseFormat ¶
ParseFormat converts a string into a Format.
If parsing fails, returns `Human` and an error.
Types ¶
type ColorHandler ¶
func NewColorHandler ¶
func NewColorHandler(out io.Writer, opts *slog.HandlerOptions) *ColorHandler
type Configuration ¶
type Configuration struct { APIProtocol string `config:"api_protocol"` APIHost string `config:"api_host"` APIPort uint `config:"api_port"` HTTPTimeout time.Duration `config:"http_timeout"` LogLevel slog.Level `config:"loglevel"` IdentityCertificate string `config:"identity_certificate"` IdentityKey string `config:"identity_key"` CACertificate string `config:"ca_certificate"` }
func GetConfiguration ¶
func GetConfiguration() Configuration
GetConfiguration loads configuration from a filesystem.
It caches its value internally, so it can be called multiple times with no overhead. Call ClearConfiguration to force reload.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a complex, translatable error object.
func NewError ¶
NewError creates a high-level error object.
`typ` is the high-level error defined by the library itself.
`original` is the originally raised error; may be `nil`.
`human` is human-readable, translatable error message displayed to the user.
func (*Error) Error ¶
Error returns complex message created from both the internal type and external reason.
type FileHandler ¶
func NewFileHandler ¶
func NewFileHandler(out io.Writer, opts *slog.HandlerOptions) *FileHandler
type Format ¶
type Format uint8
func MustParseFormat ¶
MustParseFormat converts a string into a Format.
If parsing fails, returns `Human`.
type IError ¶
func CompressDirectory ¶
func CompressDirectoryToPath ¶
func ReadRHSMIdentity ¶
ReadRHSMIdentity reads the CommonName from x.509 certificate.
It loads the subscription-manager UUID.