config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config contains logic that is related with our application's configuration. Configuration can come from environmental variables or yaml config file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppPort         int
	LogLevel        string
	PromPushGateway string
	Endpoints       []*machinery.Endpoint
}

Config holds all our configuration coming from user that our app needs

func NewConfig

func NewConfig(path string) (*Config, error)

NewConfig constructs and returns the struct that will host all our configuration variables

type YamlEndpoint

type YamlEndpoint struct {
	Domain              string         `yaml:"domain"`
	Interval            *time.Duration `yaml:"interval"`
	HTTPS               bool           `yaml:"https"`
	Tag                 string         `yaml:"tag"`
	Retries             *int           `yaml:"retries"`
	Prober              string         `yaml:"prober"`
	ReuseConnection     bool           `yaml:"reuseConnection"`
	SkipTLSVerification bool           `yaml:"skipTLSVerification"`
}

YamlEndpoint encapsulates yaml objects that represent endpoints that we want to monitor.

type YamlEndpoints

type YamlEndpoints struct {
	Endpoints []YamlEndpoint `yaml:"endpoints"`
}

YamlEndpoints encapsulates yaml objects that represent the array that holds the endpoints with the monitoring domains.

Jump to

Keyboard shortcuts

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