internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultIntervalMinutes = 15
	DefaultInterval        = time.Minute * DefaultIntervalMinutes
)

Variables

View Source
var (
	DefaultConfig = Config{
		Registrar:             "",
		RegistrarConfigPath:   "",
		Interval:              DefaultInterval,
		EdgeDNSContract:       "",
		EdgeDNSGroup:          0,
		EdgegridHost:          "",
		EdgegridClientToken:   "",
		EdgegridClientSecret:  "",
		EdgegridAccessToken:   "",
		EdgegridEdgercPath:    "",
		EdgegridEdgercSection: "",
		LogFilePath:           "",
		LogHandler:            "text",
		LogLevel:              "info",
		PluginLibPath:         "",
	}
)

Functions

func Monitor

func Monitor(ctx context.Context, err chan string, regname string, reg registrar.RegistrarProvider, edge *EdgeDNSHandler, interval time.Duration, dryrun bool, once bool)

func NewApp

func NewApp() *kingpin.Application

Types

type AkamaiDNSService

type AkamaiDNSService interface {
	GetZoneNames(ctx context.Context, queryArgs dns.ZoneListQueryArgs, stateFilter []string) ([]string, error)
	GetZones(ctx context.Context, queryArgs dns.ZoneListQueryArgs) (*dns.ZoneListResponse, error)
	GetZone(ctx context.Context, zone string) (*dns.ZoneResponse, error)
	CreateZone(ctx context.Context, zone *dns.ZoneCreate, zonequerystring dns.ZoneQueryString) error
	CreateBulkZones(ctx context.Context, bulkzones *dns.BulkZonesCreate, zonequerystring dns.ZoneQueryString) (*dns.BulkZonesResponse, error)
	DeleteBulkZones(ctx context.Context, zoneslist *dns.ZoneNameListResponse) (*dns.BulkZonesResponse, error)
}

edgeDNSClient is a proxy interface of the Akamai edgegrid configdns-v2 package that can be stubbed for testing.

type Config

type Config struct {
	Registrar           string
	RegistrarConfigPath string        // Registrar conffg file path. Parsed by Registrar Provider
	Interval            time.Duration // Default: 15 minutes
	DNSSEC              bool
	TSig                bool
	FailOnError         bool
	// Edge DNS Credentials
	EdgeDNSContract      string
	EdgeDNSGroup         int
	EdgegridHost         string
	EdgegridClientToken  string
	EdgegridClientSecret string
	EdgegridAccessToken  string
	// --OR--
	EdgegridEdgercPath    string
	EdgegridEdgercSection string
	// Optional
	LogFilePath string
	LogHandler  string
	LogLevel    string
	DryRun      bool
	Once        bool
	// Plugin Registrar
	PluginLibPath string
}

Internal master config. Reflects all accepted command line directives

func NewConfig

func NewConfig() *Config

func (*Config) ParseFlags

func (cfg *Config) ParseFlags(app *kingpin.Application, args []string) (string, error)

ParseFlags adds and parses flags from command line

func (*Config) Validate

func (cfg *Config) Validate() error

Validate config

type EdgeDNSHandler

type EdgeDNSHandler struct {
	Contract      string
	Group         int
	DNSSEC        bool
	TSig          bool
	Host          string
	ClientToken   string
	ClientSecret  string
	AccessToken   string
	EdgercPath    string
	EdgercSection string
	FailOnError   bool
	// contains filtered or unexported fields
}

func InitEdgeDNSHandler

func InitEdgeDNSHandler(ctx context.Context, config *Config, akaService AkamaiDNSService) (*EdgeDNSHandler, error)

NewAkamaiProvider initializes a new Akamai DNS based Provider.

func (*EdgeDNSHandler) CreateBulkZones

func (e *EdgeDNSHandler) CreateBulkZones(ctx context.Context, bulkzones *dns.BulkZonesCreate, zonequerystring dns.ZoneQueryString) (*dns.BulkZonesResponse, error)

func (*EdgeDNSHandler) CreateZone

func (e *EdgeDNSHandler) CreateZone(ctx context.Context, zone *dns.ZoneCreate, zonequerystring dns.ZoneQueryString) error

func (*EdgeDNSHandler) DeleteBulkZones

func (e *EdgeDNSHandler) DeleteBulkZones(ctx context.Context, zoneslist *dns.ZoneNameListResponse) (*dns.BulkZonesResponse, error)

func (*EdgeDNSHandler) GetZone

func (e *EdgeDNSHandler) GetZone(ctx context.Context, zone string) (*dns.ZoneResponse, error)

func (*EdgeDNSHandler) GetZoneNames

func (e *EdgeDNSHandler) GetZoneNames(ctx context.Context, queryArgs dns.ZoneListQueryArgs, stateFilter []string) ([]string, error)

func (*EdgeDNSHandler) GetZones

func (e *EdgeDNSHandler) GetZones(ctx context.Context, queryArgs dns.ZoneListQueryArgs) (*dns.ZoneListResponse, error)

Jump to

Keyboard shortcuts

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