options

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricsPath = kingpin.Flag(
		"web.telemetry-path",
		"Path under which to expose metrics.",
	).Default("/metrics").String()
	DisableExporterMetrics = kingpin.Flag(
		"web.disable-exporter-metrics",
		"Exclude metrics about the exporter itself (promhttp_*, process_*, go_*).",
	).Envar("OPNSENSE_EXPORTER_DISABLE_EXPORTER_METRICS").Bool()
	MaxProcs = kingpin.Flag(
		"runtime.gomaxprocs",
		"The target number of CPUs that the Go runtime will run on (GOMAXPROCS)",
	).Envar("GOMAXPROCS").Default("2").Int()
	InstanceLabel = kingpin.Flag(
		"exporter.instance-label",
		"Label to use to identify the instance in every metric. "+
			"If you have multiple instances of the exporter, you can differentiate them by using "+
			"different value in this flag, that represents the instance of the target OPNsense.",
	).Envar("OPNSENSE_EXPORTER_INSTANCE_LABEL").Required().String()

	WebConfig = kingpinflag.AddFlags(kingpin.CommandLine, ":8080")
)

Functions

func Init

func Init()

func Logger

func Logger() (log.Logger, error)

Types

type CollectorsDisableSwitch

type CollectorsDisableSwitch struct {
	ARP       bool
	Cron      bool
	Wireguard bool
	Unbound   bool
}

CollectorsDisableSwitch hold the enabled/disabled state of the collectors

func CollectorsSwitches

func CollectorsSwitches() CollectorsDisableSwitch

CollectorsSwitches returns configured instances of CollectorsDisableSwitch

type OPNSenseConfig

type OPNSenseConfig struct {
	Protocol  string
	Host      string
	APIKey    string
	APISecret string
	Insecure  bool
}

OPNSenseConfig holds the configuration for the OPNsense API.

func OPNSense

func OPNSense() (*OPNSenseConfig, error)

func (*OPNSenseConfig) Validate

func (c *OPNSenseConfig) Validate() error

Validate checks if the configuration is valid. returns an error on any missing value

Jump to

Keyboard shortcuts

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