Documentation ¶
Index ¶
Constants ¶
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" )
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" )
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.