Go to file
Sighery dfc29cba51 Store and export the valid Priority values
This will be useful later on for validation purposes in the Terraform
provider plugin.
2020-05-10 18:16:19 +02:00
.dependabot Initial commit 2020-05-07 11:31:10 +02:00
.github/workflows Initial commit 2020-05-07 11:31:10 +02:00
mocks Initial commit 2020-05-07 11:31:10 +02:00
.gitignore Initial commit 2020-05-07 11:31:10 +02:00
domains.go Initial commit 2020-05-07 11:31:10 +02:00
domains_test.go Initial commit 2020-05-07 11:31:10 +02:00
go.mod Initial commit 2020-05-07 11:31:10 +02:00
go.sum Initial commit 2020-05-07 11:31:10 +02:00
LICENSE Initial commit 2020-05-07 11:31:10 +02:00
provider.go Initial commit 2020-05-07 11:31:10 +02:00
README.md Initial commit 2020-05-07 11:31:10 +02:00
records.go Store and export the valid Priority values 2020-05-10 18:16:19 +02:00
records_test.go Initial commit 2020-05-07 11:31:10 +02:00

Unofficial Golang library for the Njalla API

Njalla is a privacy-oriented domain name registration service. Recently they released their official API.

This Golang library covers some methods of that API. For the moment, those are:

  • list-domains
  • get-domain
  • list-records
  • add-record
  • edit-record
  • remove-record

TO NOTE: Even though record methods are implemented, I'm fairly certain they'll fail (silently or not) in some cases. I deal mostly with TXT, MX, A and AAAA DNS records. Some records have different/more variables, and since I don't use them I decided against implementing them. Chances are the methods will fail when trying to deal with those types of records (like SSH records).

The code is fairly simple, and all the methods are tested by using mocks on the API request. The mocked returned data is based on the same data the API returns.

These methods cover my needs, but feel free to send in a PR to add more (or to cover all types of DNS records), as long as they're all tested and documented.

Usage

package main

import (
	"fmt"

	"github.com/Sighery/gonjalla"
)

func main() {
	token := "api-token"
	domain := "your-domain"

	records, err := ListRecords(token, domain)
	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(records)
}