config

package
v0.0.0-...-b72711b Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPublicIPHTTPProvider = errors.New("no public IP HTTP provider specified")
	ErrURLIsNotValidHTTPS     = errors.New("URL is not valid or not HTTPS")
)
View Source
var (
	ErrAddressHostEmpty = errors.New("address host is empty")
	ErrAddressPortEmpty = errors.New("address port is empty")
	ErrTimeoutTooLow    = errors.New("timeout is too low")
)
View Source
var ErrFetcherNotValid = errors.New("fetcher is not valid")
View Source
var (
	ErrNoPublicIPDNSProvider = errors.New("no public IP DNS provider specified")
)

Functions

This section is empty.

Types

type Backup

type Backup struct {
	Period    *time.Duration
	Directory *string
}

func (Backup) String

func (b Backup) String() string

func (Backup) Validate

func (b Backup) Validate() (err error)

type Client

type Client struct {
	Timeout time.Duration
}

func (Client) String

func (c Client) String() string

func (Client) Validate

func (c Client) Validate() (err error)

type Config

type Config struct {
	Client   Client
	Update   Update
	PubIP    PubIP
	Resolver Resolver
	Server   Server
	Health   Health
	Paths    Paths
	Backup   Backup
	Logger   Logger
	Shoutrrr Shoutrrr
}

func (*Config) Read

func (c *Config) Read(reader *reader.Reader,
	warner Warner) (err error)

func (*Config) SetDefaults

func (c *Config) SetDefaults()

func (Config) String

func (c Config) String() string

func (Config) Validate

func (c Config) Validate() (err error)

type Health

type Health struct {
	ServerAddress      *string
	HealthchecksioUUID *string
}

func (*Health) Read

func (h *Health) Read(reader *reader.Reader)

func (*Health) SetDefaults

func (h *Health) SetDefaults()

func (Health) String

func (h Health) String() string

func (Health) Validate

func (h Health) Validate() (err error)

type Logger

type Logger struct {
	Level  string
	Caller string
}

func (Logger) String

func (l Logger) String() string

func (Logger) ToOptions

func (l Logger) ToOptions() (options []log.Option)

func (Logger) Validate

func (l Logger) Validate() (err error)

type Paths

type Paths struct {
	DataDir *string
}

func (Paths) String

func (p Paths) String() string

func (Paths) Validate

func (p Paths) Validate() (err error)

type PubIP

type PubIP struct {
	HTTPEnabled       *bool
	HTTPIPProviders   []string
	HTTPIPv4Providers []string
	HTTPIPv6Providers []string
	DNSEnabled        *bool
	DNSProviders      []string
	DNSTimeout        time.Duration
}

func (*PubIP) String

func (p *PubIP) String() string

func (*PubIP) ToDNSPOptions

func (p *PubIP) ToDNSPOptions() (options []dns.Option)

ToDNSPOptions assumes the settings have been validated.

func (*PubIP) ToHTTPOptions

func (p *PubIP) ToHTTPOptions() (options []http.Option)

ToHTTPOptions assumes the settings have been validated.

func (PubIP) Validate

func (p PubIP) Validate() (err error)

type Resolver

type Resolver struct {
	Address *string
	Timeout time.Duration
}

func (Resolver) String

func (r Resolver) String() string

func (Resolver) ToLinesNode

func (r Resolver) ToLinesNode() *gotree.Node

func (Resolver) Validate

func (r Resolver) Validate() (err error)

type Server

type Server struct {
	ListeningAddress string
	RootURL          string
}

func (Server) String

func (s Server) String() string

func (Server) Validate

func (s Server) Validate() (err error)

type Shoutrrr

type Shoutrrr struct {
	Addresses    []string
	DefaultTitle string
}

func (Shoutrrr) String

func (s Shoutrrr) String() string

func (Shoutrrr) ToLinesNode

func (s Shoutrrr) ToLinesNode() *gotree.Node

func (Shoutrrr) Validate

func (s Shoutrrr) Validate() (err error)

type Update

type Update struct {
	Period   time.Duration
	Cooldown time.Duration
}

func (Update) String

func (u Update) String() string

func (Update) Validate

func (u Update) Validate() (err error)

type Warner

type Warner interface {
	Warnf(format string, a ...interface{})
}

Jump to

Keyboard shortcuts

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