agentutils

package
v0.0.0-...-3fc719c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrMsg

func ErrMsg(err error) string

ErrMsg returns the error message if err is not nil, otherwise returns an empty string.

func GetHostname

func GetHostname() string

GetHostname returns the system hostname, or "unknown" if it can't be determined.

func Keys

func Keys(m map[string]bool) []string

func LoadCursor

func LoadCursor(path string) (string, error)

LoadCursor reads the last saved journald cursor from a file. It returns an empty string and nil error if the file does not exist.

func LoadTLSConfig

func LoadTLSConfig(cfg *config.Config) (*tls.Config, error)

LoadTLSConfig loads the TLS configuration for the agent. It reads the CA certificate and client certificate/key from the specified paths. It returns a tls.Config object that can be used for secure communication.

func Metric

func Metric(ns, sub, name string, value interface{}, typ, unit string, dims map[string]string, ts time.Time) model.Metric

func SaveCursor

func SaveCursor(path, cursor string) error

SaveCursor writes the given journald cursor to a file.

func ToFloat64

func ToFloat64(v interface{}) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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