Go to file
Sighery 023a8ba939 Switch to native Dependabot
Previously Dependabot was a third-party service. Now that Dependabot
has been bought by GitHub, it's being integrated into GitHub itself as
a native service. To make use of the native version, the configuration
changes slightly, and it goes under a new directory.
2020-08-12 03:22:45 +02:00
.github Switch to native Dependabot 2020-08-12 03:22:45 +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_test.go Initial commit 2020-05-07 11:31:10 +02:00
domains.go Initial commit 2020-05-07 11:31:10 +02:00
go.mod Bump github.com/stretchr/testify from 1.6.0 to 1.6.1 2020-06-08 10:21:20 +02:00
go.sum Bump github.com/stretchr/testify from 1.6.0 to 1.6.1 2020-06-08 10:21:20 +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_test.go 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

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)
}