Go to file
kayos@tcp.direct 20bc1faef7 go mod 2021-08-28 02:29:15 -07:00
.github Bump actions/checkout from 2 to 2.3.4 2021-05-15 09:19:15 +02:00
mocks Initial commit 2020-05-07 11:31:10 +02:00
.gitignore Initial commit 2020-05-07 11:31:10 +02:00
LICENSE Initial commit 2020-05-07 11:31:10 +02:00
README.md Initial commit 2020-05-07 11:31:10 +02:00
domains.go Add find-domains query 2021-08-27 21:37:04 -07:00
domains_test.go go mod 2021-08-28 02:29:15 -07:00
go.mod go mod 2021-08-28 02:29:15 -07:00
go.sum Bump github.com/stretchr/testify from 1.6.1 to 1.7.0 2021-05-08 18:04:53 +02:00
provider.go Add find-domains query 2021-08-27 21:37:04 -07:00
records.go Store and export the valid Priority values 2020-05-10 18:16:19 +02:00
records_test.go go mod 2021-08-28 02:29:15 -07: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)
}