options

package
v2.0.0-...-c4c7eec Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func WithConfPath

func WithConfPath(path string) Option

func WithConfigPath

func WithConfigPath(path string) Option

type Options

type Options struct {
	Poller     string   // name of the Poller
	Daemon     bool     // if true, Poller is started as daemon
	Debug      bool     // if true, Poller is started with debug logging (same as -loglevel 1)
	PromPort   int      // HTTP port that is assigned to Poller and can be used by the Prometheus exporter
	Config     string   // filepath of Harvest config (defaults to "harvest.yml") can be relative or absolute path
	HomePath   string   // path to harvest home (usually "/opt/harvest")
	LogPath    string   // log files location (usually "/var/log/harvest")
	LogFormat  string   // log format to use (plain or json)
	LogLevel   int      // logging level, 0 for trace, 5 for fatal
	LogToFile  bool     // when running in the foreground, log to file instead of stdout
	Version    string   // harvest version
	Hostname   string   // hostname of the machine harvest is running
	Collectors []string // name of collectors to load (override poller config)
	Objects    []string // objects to load (overrides collector config)
	Profiling  int      // in case of profiling, the HTTP port used to display results
	Asup       bool     // if true, invoke autosupport at start-up
	IsTest     bool     // true when run from unit test
	ConfPath   string   // colon-separated paths to search for templates
	ConfPaths  []string // sliced version of `ConfPath`, list of paths to search for templates
}

func New

func New(opts ...Option) *Options

func (*Options) SetConfPath

func (o *Options) SetConfPath(colonSeperatedPath string)

func (*Options) SetDefaults

func (o *Options) SetDefaults() *Options

Jump to

Keyboard shortcuts

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