Skip to content

Core interfaces for universal DNS record manipulation across providers

License

Notifications You must be signed in to change notification settings

jjazzme/libdns-selectelv2

 
 

Repository files navigation

Selectel DNS v2 for libdns

Go Reference

This package implements the libdns interfaces for Selectel DNS v2 API, allowing you to manage DNS records.

Authorize

To authorize you need to use Selectel Authorization.

Example

Minimal working example of getting DNS zone records.

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/libdns/libdns/selectelv2"
)

func main() {

	provider = selectelv2.Provider{
		User:        os.Getenv("SELECTEL_USER"),
		Password:    os.Getenv("SELECTEL_PASSWORD"),
		AccountId:   os.Getenv("SELECTEL_ACCOUNT_ID"),
		ProjectName: os.Getenv("SELECTEL_PROJECT_NAME"),
		ZonesCache:  make(map[string]string),
	}
	zone = os.Getenv("SELECTEL_ZONE")
	ctx = context.Background()

	records, err := provider.GetRecords(ctx, zone)
	if err != nil {
        fmt.Printf("Error: %s", err)
        return
	}

	fmt.Println(records)
}

See also: provider_test.go

Always yours @jjazzme

About

Core interfaces for universal DNS record manipulation across providers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%