Documentation ¶
Overview ¶
A config Store able to load and store configs via simple HTTP requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DNS ¶
type DNS struct { DNSFlags // contains filtered or unexported fields }
func NewDNS ¶
func NewDNS(domain string, mods ...DNSModifier) *DNS
func (*DNS) GetEndpoints ¶
type DNSFlags ¶
func DefaultDNSFlags ¶
func DefaultDNSFlags() *DNSFlags
type DNSModifier ¶
type DNSModifier func(*DNS)
func FromDNSFlags ¶
func FromDNSFlags(flags *DNSFlags) DNSModifier
func WithLogger ¶
func WithLogger(log logger.Logger) DNSModifier
func WithPrefix ¶
func WithPrefix(prefix string) DNSModifier
func WithRetry ¶
func WithRetry(retry *retry.Options) DNSModifier
func WithTimeout ¶
func WithTimeout(duration time.Duration) DNSModifier
type DNSModifiers ¶
type DNSModifiers []DNSModifier
type DNSOptions ¶
func ParseDNSOptions ¶
func ParseDNSOptions(value string) (DNSOptions, error)
func ParseTXTRecord ¶
func ParseTXTRecord(record string) (DNSOptions, *url.URL, error)
ParseTXTRecord decodes the content of a TXT record.
TXT records are expected to either be a simple URL, like "http://mydomain.com/configs/", or a set of options followed by |, followed by the URL.
For example:
timeout=3 retries=5|http://mydomain.com/configs/
If the option needs to contain the | or any other forbidden character, the option can be URL path encoded, with characters replaced by % notation. % itself needs to be escaped.
func (DNSOptions) Apply ¶
func (do DNSOptions) Apply(target interface{}, fns ...mapstructure.DecodeHookFunc) ([]string, error)
type NotFoundError ¶
type NotFoundError struct {
Record string
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type WritePolicy ¶
type WritePolicy int
const ( // Attempts to write to all endpoints. Succeeds if all succeed. WriteSucceedAll WritePolicy = iota // Attempts to write to all endpoints. Succeeds if at least one write succeeds. WriteSucceedOne // Attempts to write until a write succeeds. Not all endpoints will be written to. WriteFirst )
Click to show internal directories.
Click to hide internal directories.