DNS

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	ZoneID        string
	CloudflareAPI *cloudflare.API
}

API is a custom type that is used as a wrapper for the actual Cloudflare API instance

func New

func New(apiKey, email, zoneName string) (*API, error)

New creates a new instance of the type *API which takes a Config type as an argument and returns an *API and an error

func (*API) GetDNSRecords

func (api *API) GetDNSRecords(recordNames []string) ([]Record, error)

GetDNSRecords pulls all DNS Records associated with each element of the recordNames slice passed to this method as a parameter and returns a [][]cloudflare.DNSRecord and an error

func (*API) UpdateDNSRecords

func (api *API) UpdateDNSRecords(ipAddress string, recordID string) error

func (*API) ZoneIDByName

func (api *API) ZoneIDByName(zoneName string) (string, error)

type Getter

type Getter interface {
	ZoneIDByName(zoneName string) (string, error)
	GetDNSRecords(recordNames []string) ([]Record, error)
}

type InvalidParamError

type InvalidParamError struct {
	Param string
}

func (InvalidParamError) Error

func (e InvalidParamError) Error() string

type Manager

type Manager interface {
	Getter
	Updater
}

type Record

type Record struct {
	ID      string
	Name    string
	Type    string
	Content string
}

type Updater

type Updater interface {
	UpdateDNSRecords(ipAddress string, recordID string) error
}

Jump to

Keyboard shortcuts

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