gcdnsp

package
v0.0.0-...-d8123f7 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 14 Imported by: 1

Documentation

Overview

Package gcdnsp provides a Google Cloud DNS client that satisfies autocertdns.Provisioner.

Index

Constants

View Source
const (

	// DefaultPropagationWait is the default propagation waiting time.
	DefaultPropagationWait = 60 * time.Second

	// DefaultCheckDelay is the default check delay
	DefaultCheckDelay = 100 * time.Millisecond

	// DefaultProvisionDelay is the default after provision wait delay.
	DefaultProvisionDelay = 10 * time.Second
)

Variables

This section is empty.

Functions

func IgnorePropagationErrors

func IgnorePropagationErrors(c *Client) error

IgnorePropagationErrors is a Client option to ignore propagation errors.

Types

type Client

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

Client wraps a Google Cloud DNS service.

func New

func New(opts ...Option) (*Client, error)

New wraps a Google Cloud DNS Service in order to handle DNS provisioning requests (for use with the autocertdns.Manager).

func (*Client) Provision

func (c *Client) Provision(ctxt context.Context, typ, name, token string) error

Provision creates a DNS record of typ, for the specified domain name and with the value in token.

func (*Client) Unprovision

func (c *Client) Unprovision(ctxt context.Context, typ, name, token string) error

Unprovision deletes the DNS record of typ, for the specified domain name, and for the record with the specified token as the value.

type Option

type Option func(*Client) error

Option represents a Google Cloud DNS Client option.

func CheckDelay

func CheckDelay(d time.Duration) Option

CheckDelay is a Client option to set the delay between DNS name propagation checks.

func DNSService

func DNSService(dnsService *dns.Service) Option

DNSService is an option that sets the Google Cloud DNS service to use.

func Domain

func Domain(domain string) Option

Domain is a Client option to set the domain.

func Errorf

func Errorf(f func(string, ...interface{})) Option

Errorf is a Client option to specify the error logging function used.

func GoogleComputeCredentials

func GoogleComputeCredentials(serviceAccount string) Option

GoogleComputeCredentials is an option that loads the Google Service Account credentials from the GCE metadata associated with the GCE compute instance.

If serviceAccount is empty, then the default service account credentials associated with the GCE instance will be used.

func GoogleServiceAccountCredentialsFile

func GoogleServiceAccountCredentialsFile(path string) Option

GoogleServiceAccountCredentialsFile is an option that loads Google Service Account credentials for use with the Client from the specified file.

Google Service Account credentials can be downloaded from the Google Cloud console: https://console.cloud.google.com/iam-admin/serviceaccounts/

func GoogleServiceAccountCredentialsJSON

func GoogleServiceAccountCredentialsJSON(buf []byte) Option

GoogleServiceAccountCredentialsJSON is an option that creates the Google Cloud DNS service using the supplied Google service account credentials.

Google Service Account credentials can be downloaded from the Google Cloud console: https://console.cloud.google.com/iam-admin/serviceaccounts/

func HTTPClient

func HTTPClient(client *http.Client) Option

HTTPClient is a Client option that sets the http.Client used.

func Logf

func Logf(f func(string, ...interface{})) Option

Logf is a Client option to specify the logging function used.

func ManagedZone

func ManagedZone(managedZone string) Option

ManagedZone is a Client option to set the managed zone.

func Nameservers

func Nameservers(nameservers ...string) Option

Nameservers is a Client option to set the nameservers to check.

func ProjectID

func ProjectID(projectID string) Option

ProjectID is an option that sets the project ID.

func PropagationWait

func PropagationWait(d time.Duration) Option

PropagationWait is a Client option to set the propagation wait timeout.

func ProvisionDelay

func ProvisionDelay(d time.Duration) Option

ProvisionDelay is a Client option to set the delay after a successful provision and name propagation.

Jump to

Keyboard shortcuts

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