dnsproviders

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package googleclouddns provides functions to manage Google Cloud DNS entries

Index

Constants

View Source
const (
	CredentialKeyRegion     = "region"
	CredentialKeyTenantName = "tenantName"
	CredentialKeyDomainName = "domainName"
	CredentialKeyUsername   = "username"
	CredentialKeyPassword   = "password"
)
View Source
const Cloudflare = "cloudflare"
View Source
const GoogleCloudDNS = "googleclouddns"

Variables

View Source
var (
	ErrZoneNotFound   = errors.New("could not find zone by the given name")
	ErrRecordNotFound = errors.New("could not find record by the given name")
)

Functions

func GetProvider

func GetProvider(ctx context.Context, typ api.ProviderType, zone string, credentialsData map[string]string, logger api.Logger, ops ...Option) (api.Provider, error)

Types

type CloudDNS

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

func NewGoogleCloudDNSProvider

func NewGoogleCloudDNSProvider(ctx context.Context, zone string, credentialsData map[string]string, logger api.Logger, ops ...Option) (*CloudDNS, error)

NewGoogleCloudDNS creates a new Google Cloud DNS provider

func (*CloudDNS) CreateOrUpdateDNSRecord

func (s *CloudDNS) CreateOrUpdateDNSRecord(ctx context.Context, zone, name, rtype, content string, ttl int, proxy bool) error

func (*CloudDNS) DeleteDNSRecord

func (s *CloudDNS) DeleteDNSRecord(ctx context.Context, zone, name string) error

func (*CloudDNS) GetDNSRecords

func (s *CloudDNS) GetDNSRecords(ctx context.Context, zone, name string) ([]api.Record, error)

type CloudflareAPI

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

func NewCloudflareProvider

func NewCloudflareProvider(ctx context.Context, zone string, credentialsData map[string]string, logger api.Logger, ops ...Option) (*CloudflareAPI, error)

NewCloudflareProvider creates a new Cloudflare DNS provider.

func (*CloudflareAPI) CreateOrUpdateDNSRecord

func (s *CloudflareAPI) CreateOrUpdateDNSRecord(ctx context.Context, zone, name, rtype, content string, ttl int, proxy bool) error

CreateOrUpdateDNSRecord changes the existing record if found, or adds a new one

func (*CloudflareAPI) DeleteDNSRecord

func (s *CloudflareAPI) DeleteDNSRecord(ctx context.Context, zone, name string) error

DeleteDNSRecord deletes DNS record specified by recordID in zone.

func (*CloudflareAPI) GetDNSRecords

func (s *CloudflareAPI) GetDNSRecords(ctx context.Context, zone, name string) ([]api.Record, error)

GetDNSRecords returns a list of DNS records for the given domain name. Error returned otherwise. if name is provided, that is used as a filter

type OTC added in v0.0.2

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

func NewOtcProvider added in v0.0.2

func NewOtcProvider(_ context.Context, _ string, credentialsData map[string]string, logger api.Logger, ops ...Option) (*OTC, error)

func (OTC) CreateOrUpdateDNSRecord added in v0.0.2

func (o OTC) CreateOrUpdateDNSRecord(ctx context.Context, zone, name, rtype, content string, ttl int, proxy bool) error

func (OTC) DeleteDNSRecord added in v0.0.2

func (o OTC) DeleteDNSRecord(ctx context.Context, zone, name string) error

func (OTC) GetDNSRecords added in v0.0.2

func (o OTC) GetDNSRecords(ctx context.Context, zone, name string) ([]api.Record, error)

type Option added in v0.0.2

type Option func(opts *options)

func WithHTTPClient added in v0.0.2

func WithHTTPClient(client *http.Client) Option

Directories

Path Synopsis
Package api defines the common API interface for DNS managers
Package api defines the common API interface for DNS managers

Jump to

Keyboard shortcuts

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