Documentation

Index

Constants

View Source
const (
	EnvEndpoint          = envNamespace + "ENDPOINT"
	EnvApplicationKey    = envNamespace + "APPLICATION_KEY"
	EnvApplicationSecret = envNamespace + "APPLICATION_SECRET"
	EnvConsumerKey       = envNamespace + "CONSUMER_KEY"

	EnvTTL                = envNamespace + "TTL"
	EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
	EnvPollingInterval    = envNamespace + "POLLING_INTERVAL"
	EnvHTTPTimeout        = envNamespace + "HTTP_TIMEOUT"
)

Environment variables names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIEndpoint        string
	ApplicationKey     string
	ApplicationSecret  string
	ConsumerKey        string
	PropagationTimeout time.Duration
	PollingInterval    time.Duration
	TTL                int
	HTTPClient         *http.Client
}

Config is used to configure the creation of the DNSProvider

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a default configuration for the DNSProvider

type OVHApi

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

OVHApi is an implementation of the acme.ChallengeProvider interface that uses OVH's REST API to manage TXT records for a domain.

func NewDNSProvider

func NewDNSProvider() (*OVHApi, error)

NewDNSProvider returns a OVHApi instance configured for OVH Credentials must be passed in the environment variable: OVH_ENDPOINT : it must be ovh-eu or ovh-ca OVH_APPLICATION_KEY OVH_APPLICATION_SECRET OVH_CONSUMER_KEY

func NewDNSProviderConfig

func NewDNSProviderConfig(config *Config) (*OVHApi, error)

NewDNSProviderConfig return a OVHApi instance configured for OVH.

func (*OVHApi) ExtractAuthZone

func (o *OVHApi) ExtractAuthZone(fqdn string) (string, error)

func (*OVHApi) ExtractRecordName

func (o *OVHApi) ExtractRecordName(fqdn, domain string) string

func (*OVHApi) Refresh

func (api *OVHApi) Refresh(fqdn string) error

func (*OVHApi) RemoveRecords

func (api *OVHApi) RemoveRecords(fqdn string) error

func (*OVHApi) SetRecord

func (api *OVHApi) SetRecord(fqdn, fieldtype, target string) error

type Record

type Record struct {
	ID        int64  `json:"id,omitempty"`
	FieldType string `json:"fieldType,omitempty"`
	SubDomain string `json:"subDomain,omitempty"`
	Target    string `json:"target,omitempty"`
	TTL       int    `json:"ttl,omitempty"`
	Zone      string `json:"zone,omitempty"`
}

Record a DNS record

Source Files