config

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	Version         kong.VersionFlag
	Cfgfile         string        `kong:"name='config',env='CONFIG',help='ddns-route53 configuration file.'"`
	Schedule        string        `kong:"name='schedule',env='SCHEDULE',help='CRON expression format.'"`
	Ifname          string        `` /* 132-byte string literal not displayed */
	MaxRetries      int           `` /* 133-byte string literal not displayed */
	MaxBackoffDelay time.Duration `` /* 158-byte string literal not displayed */
	LogLevel        string        `kong:"name='log-level',env='LOG_LEVEL',default='info',help='Set log level.'"`
	LogJSON         bool          `kong:"name='log-json',env='LOG_JSON',default='false',help='Enable JSON logging output.'"`
	LogCaller       bool          `kong:"name='log-caller',env='LOG_CALLER',default='false',help='Add file:line of the caller to log output.'"`
	LogNoColor      bool          `kong:"name='log-nocolor',env='LOG_NOCOLOR',default='false',help='Disables the colorized output.'"`
}

Cli holds command line args, flags and cmds

type Config

type Config struct {
	Cli Cli `yaml:"-" json:"-" label:"-" file:"-"`

	Credentials *Credentials `yaml:"credentials,omitempty" json:"credentials,omitempty" validate:"omitempty"`
	Route53     *Route53     `yaml:"route53,omitempty" json:"route53,omitempty" validate:"required"`
}

Config holds configuration details

func Load

func Load(cli Cli) (*Config, error)

Load returns Configuration struct

func (*Config) String

func (cfg *Config) String() string

String returns the string representation of configuration

type Credentials

type Credentials struct {
	AccessKeyID         string `yaml:"accessKeyID,omitempty" json:"accessKeyID,omitempty" validate:"omitempty"`
	AccessKeyIDFile     string `yaml:"accessKeyIDFile,omitempty" json:"accessKeyIDFile,omitempty" validate:"omitempty,file"`
	SecretAccessKey     string `yaml:"secretAccessKey,omitempty" json:"secretAccessKey,omitempty" validate:"omitempty"`
	SecretAccessKeyFile string `yaml:"secretAccessKeyFile,omitempty" json:"secretAccessKeyFile,omitempty" validate:"omitempty,file"`
}

Credentials holds data necessary for AWS configuration

func (*Credentials) GetDefaults

func (s *Credentials) GetDefaults() *Credentials

GetDefaults gets the default values

func (*Credentials) SetDefaults

func (s *Credentials) SetDefaults()

SetDefaults sets the default values

type RecordSet

type RecordSet struct {
	Name string          `yaml:"name,omitempty" json:"name,omitempty" validate:"required"`
	Type r53types.RRType `yaml:"type,omitempty" json:"type,omitempty" validate:"required,oneof=A AAAA"`
	TTL  int64           `yaml:"ttl,omitempty" json:"ttl,omitempty" validate:"required,min=1"`
}

RecordSet holds data necessary for record set configuration

func (*RecordSet) GetDefaults

func (s *RecordSet) GetDefaults() *RecordSet

GetDefaults gets the default values

func (*RecordSet) SetDefaults

func (s *RecordSet) SetDefaults()

SetDefaults sets the default values

type RecordsSet

type RecordsSet []RecordSet

RecordsSet holds slice of record set configuration

type Route53

type Route53 struct {
	HostedZoneID string     `yaml:"hostedZoneID,omitempty" json:"hostedZoneID,omitempty" validate:"required"`
	RecordsSet   RecordsSet `yaml:"recordsSet,omitempty" json:"recordsSet,omitempty" validate:"dive"`
	HandleIPv4   *bool      `yaml:"-" json:"-" label:"-" file:"-"`
	HandleIPv6   *bool      `yaml:"-" json:"-" label:"-" file:"-"`
}

Route53 holds AWS Route53 data

func (*Route53) GetDefaults

func (s *Route53) GetDefaults() *Route53

GetDefaults gets the default values

func (*Route53) SetDefaults

func (s *Route53) SetDefaults()

SetDefaults sets the default values

Jump to

Keyboard shortcuts

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