config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config is a parser for tower config files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckConfig

type CheckConfig struct {
	Type string `yaml:"type"`

	// TCP / TLS
	IP   string `yaml:"ip"`
	Port int    `yaml:"port"`

	// HTTPS
	Host                 string        `yaml:"host"`
	WarnIfExpiringWithin time.Duration `yaml:"warn_if_expiring"`
	InsecureSkipVerify   bool          `yaml:"insecure_skip_verify"`

	// DNS
	Addr string `yaml:"addr"`

	// Ping
	Count int `yaml:"count"`

	// HTTP / Trace
	URL    string `yaml:"url"`
	Method string `yaml:"method"`

	// Common
	Timeout time.Duration `yaml:"timeout"`
}

CheckConfig is a single check entry in a tower config file. The Type field determines which libtower check to run.

type Config

type Config struct {
	Checks []CheckConfig `yaml:"checks"`
}

Config is the root tower config file.

func Parse

func Parse(filepath string) (Config, error)

Parse config file

type PING

type PING struct {
	Host    string           `yaml:"host"`    // IPv4 or IPv6
	Count   int              `yaml:"count"`   // Number of pings
	Timeout libtower.Timeout `yaml:"timeout"` // Timeout
}

PING config type

type TCP

type TCP struct {
	IP      string           `yaml:"ip"`      // IPv4 or IPv6
	Port    int              `yaml:"port"`    // Port number
	Timeout libtower.Timeout `yaml:"timeout"` // Timeout
}

TCP config type

Jump to

Keyboard shortcuts

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