yandex

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthorizationTypeInstanceServiceAccount is the authorization type describes that
	// Compute Instance Service Account credentials should be used for authorizing requests to Yandex Cloud
	AuthorizationTypeInstanceServiceAccount = "instance-service-account"

	// AuthorizationTypeOAuthToken is the authorization type describes that
	// OAuth token should be used for authorizing requests to Yandex Cloud
	AuthorizationTypeOAuthToken = "iam-token"

	// AuthorizationTypeKey is the authorization type describes that
	// Service Account authorization key file used for authorizing requests to Yandex Cloud
	AuthorizationTypeKey = "iam-key"
)
View Source
const (
	// EnvironmentNamespace is a shared prefix for all environment configuration values
	EnvironmentNamespace = "YANDEX_"

	EnvironmentAuthorizationType       = EnvironmentNamespace + "AUTHORIZATION_TYPE"
	EnvironmentAuthorizationOAuthToken = EnvironmentNamespace + "AUTHORIZATION_OAUTH_TOKEN"
	EnvironmentAuthorizationKey        = EnvironmentNamespace + "AUTHORIZATION_KEY"
	EnvironmentFolderId                = EnvironmentNamespace + "FOLDER_ID"
	EnvironmentDNSRecordSetTTL         = EnvironmentNamespace + "DNS_RECORDSET_TTL"
)
View Source
const (
	// DefaultDNSRecordSetTTL is the default TTL for record sets
	DefaultDNSRecordSetTTL = 60

	// DefaultAuthorizationType is the default authorization type for dns api
	DefaultAuthorizationType = AuthorizationTypeInstanceServiceAccount
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSProvider

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

DNSProvider is an implementation of the solver interface.

func NewDNSProvider

func NewDNSProvider(cfg *DNSProviderConfig) (*DNSProvider, error)

NewDNSProvider returns a DNSProvider instance configured with specified *DNSProviderConfig.

func (*DNSProvider) CleanUp

func (p *DNSProvider) CleanUp(zone, fqdn, key string) error

CleanUp removes a TXT record used for DNS-01 challenge.

func (*DNSProvider) Present

func (p *DNSProvider) Present(zone, fqdn, key string) error

Present creates a TXT record to fulfill DNS-01 challenge.

type DNSProviderConfig

type DNSProviderConfig struct {
	AuthorizationType       string
	AuthorizationOAuthToken string
	AuthorizationKey        string
	FolderId                string
	DNSRecordSetTTL         int
}

DNSProviderConfig is used to configure the creation of the DNSProvider.

func NewProviderConfig

func NewProviderConfig(authorizationType, folderId string) *DNSProviderConfig

NewProviderConfig returns a new instance of DNSProviderConfig with specified AuthorizationType and FolderId.

func NewProviderConfigFromEnv

func NewProviderConfigFromEnv() *DNSProviderConfig

NewProviderConfigFromEnv returns a new instance of DNSProviderConfig configured from environment variables.

func (*DNSProviderConfig) SetSecret

func (cfg *DNSProviderConfig) SetSecret(secret string)

SetSecret sets corresponding secret for DNSProvider depending on AuthorizationType.

func (*DNSProviderConfig) Validate

func (cfg *DNSProviderConfig) Validate() error

Validate checks invariants of DNSProviderConfig if any required field is missing or incorrect will return error, otherwise nil.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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