https://github.com/selectel/private-dns-go
https://github.com/selectel/private-dns-go
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/selectel/private-dns-go
- Owner: selectel
- License: apache-2.0
- Created: 2025-12-11T09:34:53.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-05-28T15:48:08.000Z (about 2 months ago)
- Last Synced: 2026-05-28T17:23:24.461Z (about 2 months ago)
- Language: Go
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Getting started
### Installation
You can install needed `private-dns-go` packages via `go get` command:
```bash
go get github.com/selectel/private-dns-go
```
### Authentication
To work with the Selectel Cloud Private DNS API you first need to:
* Create a Selectel account: [registration page](https://my.selectel.ru/registration).
* Create a project in Selectel Cloud Platform [projects](https://my.selectel.ru/vpc/projects).
* Retrieve a token for your project via API or [go-selvpcclient](https://github.com/selectel/go-selvpcclient).
### Endpoints
You can find available endpoints [here](https://docs.selectel.ru/en/api/urls/).
### Usage example
```go
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)
}
}
```