package
0.0.0-20221218020924-d28c3694b56e
Repository: https://github.com/zalgonoise/dns.git
Documentation: pkg.go.dev
# Functions
AutostartDNS creates a ConfigOption which will set the UDP server (DNS) to start listening when the app is executed (alongside the HTTP server), or to wait for a HTTP request against /dns/start.
ConfigPath creates a ConfigOption setting the Config's path to string `t`
It tries to call os.Stat() on string `p` to evaluate if the file exists.
ConfigType creates a ConfigOption setting the Config's type to string `t`
It defaults to `yaml`.
Default returns a pointer to a Config, initialized with sane defaults and ready for automatic start-up.
DNSAddress creates a ConfigOption setting the Config's DNS address to string `a`
It the string `a` is an invalid IP address, it returns `nil`.
DNSFallback creates a ConfigOption setting the Config's fallback DNS address(es) to string `f`
It the string `f` is empty, it returns `nil`.
DNSPrefix creates a ConfigOption setting the Config's DNS prefix to string `p`
It the string `p` is longer than one character, the first rune is converted to a string and that one is used.
DNSProto creates a ConfigOption setting the Config's DNS proto to string `p`
It defaults to `udp`.
DNSType creates a ConfigOption setting the Config's DNS type to string `t`
It defaults to `miekgdns`.
HealthType creates a ConfigOption setting the Config's health check type to string `t`
It defaults to `simplehealth`.
HTTPPort creates a ConfigOption setting the Config's HTTP port to int `p`
It returns nil if the input port `p` is 0 or over 65535, otherwise it will return a ConfigOption to update the HTTP port.
LoggerPath creates a ConfigOption setting the Config's logfile path to string `p`
It tries to call os.Stat() on string `p` to evaluate if the file exists.
LoggerType creates a ConfigOption setting the Config's logger type to string `t`
It defaults to `text`.
Merge combines Configs `main` with `input`, returning a merged version of the two
All set elements in `input` will be applied to `main`, and the unset elements will be ignored (keeps `main`'s data).
New initializes a new config with default settings, and then iterates through all input ConfigOption `opts` applying them to the Config, which is returned to the caller.
StorePath creates a ConfigOption setting the Config's store path to string `p`
It tries to call os.Stat() on string `p` to evaluate if the file exists.
StoreType creates a ConfigOption setting the Config's store type to string `t`
It defaults to `memmap`.
# Structs
No description provided by the author
Config structures the setup of the DNS app, according to the caller's needs
This information can also be stored and loaded in a file for quicker access in future executions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
ConfigOption describes setter types for a Config
As new options / elements are added to the Config, new data structures can implement the ConfigOption interface to allow setting these options in the Config.