Skip to content

libdns/selectel

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/selectel"
)

func main() {

	provider = selectel.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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages