provider/rcode0.go
func NewRcodeZeroProvider(domainFilter DomainFilter, dryRun bool, txtEnc bool) (*RcodeZeroProvider, error) {

	client, err := rc0.NewClient(os.Getenv("RC0_API_KEY"))

	if err != nil {
		return nil, err
	}

	value := os.Getenv("RC0_BASE_URL")
	if len(value) != 0 {
		client.BaseURL, err = url.Parse(os.Getenv("RC0_BASE_URL"))
	}

	if err != nil {
		return nil, fmt.Errorf("failed to initialize rcodezero provider: %v", err)
	}

	provider := &RcodeZeroProvider{
		Client:       client,
		DomainFilter: domainFilter,
		DryRun:       dryRun,
		TXTEncrypt:   txtEnc,
	}

	if txtEnc {
		provider.Key = []byte(os.Getenv("RC0_ENC_KEY"))
	}

	return provider, nil
}
func NewRcodeZeroProvider(domainFilter DomainFilter, dryRun bool, txtEnc bool) (*RcodeZeroProvider, error) {

	client, err := rc0.NewClient(os.Getenv("RC0_API_KEY"))

	if err != nil {
		return nil, err
	}

	value := os.Getenv("RC0_BASE_URL")
	if len(value) != 0 {
		client.BaseURL, err = url.Parse(os.Getenv("RC0_BASE_URL"))
	}

	if err != nil {
		return nil, fmt.Errorf("failed to initialize rcodezero provider: %v", err)
	}

	provider := &RcodeZeroProvider{
		Client:       client,
		DomainFilter: domainFilter,
		DryRun:       dryRun,
		TXTEncrypt:   txtEnc,
	}

	if txtEnc {
		provider.Key = []byte(os.Getenv("RC0_ENC_KEY"))
	}

	return provider, nil
}
func NewRcodeZeroProvider ( domainFilter DomainFilter , dryRun bool , txtEnc bool ) ( * RcodeZeroProvider , error ) { client , err := rc0 . NewClient ( os . Getenv ( " " ) ) if err != nil { return nil , err } value := os . Getenv ( " " ) if len ( value ) != 0 { client . BaseURL , err = url . Parse ( os . Getenv ( " " ) ) } if err != nil { return nil , fmt . Errorf ( " " , err ) } provider := & RcodeZeroProvider { Client : client , DomainFilter : domainFilter , DryRun : dryRun , TXTEncrypt : txtEnc , } if txtEnc { provider . Key = [ ] byte ( os . Getenv ( " " ) ) } return provider , nil }
// NewRcodeZeroProvider creates a new RcodeZero Anycast DNS provider.
//
// Returns the provider or an error if a provider could not be created.
NewRcodeZeroProvider creates a new RcodeZero Anycast DNS provider . Returns the provider or an error if a provider could not be created .