config

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

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

Go to latest
Published: May 24, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Mail                    MailConfig    `koanf:"mail"`
	Retry                   RetryConfig   `koanf:"retry"`
	DiffMethod              string        `koanf:"diff_method"`
	Useragent               string        `koanf:"useragent"`
	Timeout                 time.Duration `koanf:"timeout"`
	Database                string        `koanf:"database"`
	NoErrorMailOnStatusCode []int         `koanf:"no_errormail_on_statuscode"`
	RetryOnMatch            []string      `koanf:"retry_on_match"`
	Watches                 []WatchConfig `koanf:"watches"`
}

func GetConfig

func GetConfig(f string) (Configuration, error)

type MailConfig

type MailConfig struct {
	Server string `koanf:"server"`
	Port   int    `koanf:"port"`
	From   struct {
		Name string `koanf:"name"`
		Mail string `koanf:"mail"`
	} `koanf:"from"`
	To       []string `koanf:"to"`
	User     string   `koanf:"user"`
	Password string   `koanf:"password"`
	SkipTLS  bool     `koanf:"skiptls"`
	Retries  int      `koanf:"retries"`
}

type ReplaceConfig

type ReplaceConfig struct {
	Pattern     string `koanf:"pattern"`
	ReplaceWith string `koanf:"replace_with"`
}

type RetryConfig

type RetryConfig struct {
	Count int           `koanf:"count"`
	Delay time.Duration `koanf:"delay"`
}

type WatchConfig

type WatchConfig struct {
	Cron                    string            `koanf:"cron"`
	Name                    string            `koanf:"name"`
	Description             string            `koanf:"description"`
	URL                     string            `koanf:"url"`
	Method                  string            `koanf:"method"`
	Body                    string            `koanf:"body"`
	Header                  map[string]string `koanf:"header"`
	AdditionalTo            []string          `koanf:"additional_to"`
	NoErrorMailOnStatusCode []int             `koanf:"no_errormail_on_statuscode"`
	Disabled                bool              `koanf:"disabled"`
	Pattern                 string            `koanf:"pattern"`
	Replaces                []ReplaceConfig   `koanf:"replaces"`
	RetryOnMatch            []string          `koanf:"retry_on_match"`
	SkipSofterrorPatterns   bool              `koanf:"skip_soft_error_patterns"`
	JQ                      string            `koanf:"jq"`
}

Jump to

Keyboard shortcuts

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