provider

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: Apache-2.0 Imports: 5 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 interface {
	SetRecord(ctx context.Context, record DNSRecord) error
}

API is an interface for all providers.

func SetupCloudflareAPI

func SetupCloudflareAPI() (API, error)

SetupCloudflareAPI setups CloudflareAPI.

type CloudflareAPI

type CloudflareAPI struct {
	// contains filtered or unexported fields
}

CloudflareAPI is API entrypoint for Cloudflare.

func NewCloudflareAPI

func NewCloudflareAPI(client CloudflareAPIInterface) *CloudflareAPI

NewCloudflareAPI is a factory for NewCloudflareAPI.

func (CloudflareAPI) SetRecord

func (a CloudflareAPI) SetRecord(ctx context.Context, record DNSRecord) error

SetRecord sets a record in Cloudflare.

type CloudflareAPIInterface

type CloudflareAPIInterface interface {
	ZoneIDByName(zoneName string) (string, error)
	DNSRecords(ctx context.Context, zoneID string, rr cloudflare.DNSRecord) ([]cloudflare.DNSRecord, error)
	UpdateDNSRecord(ctx context.Context, zoneID, recordID string, rr cloudflare.DNSRecord) error
	CreateDNSRecord(ctx context.Context, zoneID string, rr cloudflare.DNSRecord) (*cloudflare.DNSRecordResponse, error)
}

CloudflareAPIInterface is an interface for Cloudflare api for mocking.

type DNSRecord

type DNSRecord struct {
	Name  string
	Value string
	Zone  DNSZone
}

DNSRecord is record struct for all providers.

type DNSZone

type DNSZone struct {
	Name string
}

DNSZone is zone struct for all providers.

type NotSupported

type NotSupported struct {
	Name string
}

NotSupported errors when a given provider is not supported.

func (*NotSupported) Error

func (e *NotSupported) Error() string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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