Skip to content

selectel/private-dns-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

Installation

You can install needed private-dns-go packages via go get command:

go get github.com/selectel/private-dns-go

Authentication

To work with the Selectel Cloud Private DNS API you first need to:

Endpoints

You can find available endpoints here.

Usage example

package main

import (
	"context"
	"fmt"
	"log"

	privatedns "github.com/selectel/private-dns-go/pkg/v1"
)

func main() {

	// Create the client.
    cfg := &privatedns.Config{
        // Token to work with Selectel Cloud project.
        AuthToken: "..."
        // Cloud private dns endpoint to work with.
        URL: "https://ru-3.cloud.api.selcloud.ru/private-dns/"
    }
	client := privatedns.NewPrivateDNSClient(cfg)

	// Get zones for project.
	zones, err := client.ListZones(context.Background(), nil)
	if err != nil {
		log.Fatal(err)
	}

	// Print the zones.
	for idx, zone := range zones {
		fmt.Printf("Zone %d: %+v", idx, zone)
	}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published