config

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name    string
	Desc    string
	URL     string
	Author  string
	Version string
}

App holds application details

type Cli added in v1.7.0

type Cli struct {
	Version    kong.VersionFlag
	Cfgfile    string `kong:"required,name='config',env='CONFIG',help='ddns-route53 configuration file.'"`
	Schedule   string `kong:"name='schedule',env='SCHEDULE',help='CRON expression format.'"`
	MaxRetries int    `kong:"name='max-retries',env='MAX_RETRIES',default='3',help='Number of retries in case of WAN IP retrieval failure.'"`
	Timezone   string `kong:"name='timezone',env='TZ',default='UTC',help='Timezone assigned to ddns-route53.'"`
	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.'"`
}

Cli holds command line args, flags and cmds

type Configuration

type Configuration struct {
	Cli         Cli
	App         App
	Credentials Credentials `yaml:"credentials,omitempty"`
	Route53     Route53     `yaml:"route53,omitempty"`
}

Configuration holds configuration details

func Load

func Load(cli Cli, version string) (*Configuration, error)

Load returns Configuration struct

func (*Configuration) Check

func (cfg *Configuration) Check() error

Check verifies Configuration values

type Credentials

type Credentials struct {
	AccessKeyID     string `yaml:"access_key_id,omitempty"`
	SecretAccessKey string `yaml:"secret_access_key,omitempty"`
}

Credentials holds data necessary for AWS configuration

type RecordSet

type RecordSet struct {
	Name string `yaml:"name,omitempty"`
	Type string `yaml:"type,omitempty"`
	TTL  int64  `yaml:"ttl,omitempty"`
}

RecordSet holds data necessary for record set configuration

type Route53

type Route53 struct {
	HostedZoneID string      `yaml:"hosted_zone_id,omitempty"`
	RecordsSet   []RecordSet `yaml:"records_set,omitempty"`
	HandleIPv4   bool
	HandleIPv6   bool
}

Route53 holds AWS Route53 data

Jump to

Keyboard shortcuts

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