Skip to content

libdns/domainnameshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference

This package implements the libdns interfaces for Domainname.shop DNS.

Domainname.shop API reference

Side note: This provider has ended up with a few different names so just a bit of clarification.
The company name is Domeneshop AS (Norwegian company).
The main name in Norwegian is "Domeneshop" while in most English context they go by "Domainnameshop".
Some known URLs are domeneshop.no, domene.shop, domainnameshop.com, domainname.shop.
Package has used the name domainnameshop as reference.

Authentication

You will need a API token and API secret to use this module.
You can get tokens and secrets from the admin panel here:
https://domene.shop/admin?view=api

Example

This is a minimal example, but you can also check provider_test.go for more usage.

package main

import (
	"context"
	"fmt"
	"os"
	"time"

	"github.com/libdns/domainnameshop"
)

func main() {

	token := os.Getenv("LIBDNS_DOMAINNAMESHOP_TOKEN")
	if token == "" {
		fmt.Printf("LIBDNS_DOMAINNAMESHOP_TEST_TOKEN not set\n")
		return
	}

	secret := os.Getenv("LIBDNS_DOMAINNAMESHOP_SECRET")
	if secret == "" {
		fmt.Printf("LIBDNS_DOMAINNAMESHOP_SECRET not set\n")
		return
	}

	zone := os.Getenv("LIBDNS_DOMAINNAMESHOP_ZONE")
	if zone == "" {
		fmt.Printf("LIBDNS_DOMAINNAMESHOP_ZONE not set\n")
		return
	}

	p := &domainnameshop.Provider{
		APIToken:  token,
		APISecret: secret,
	}

	ctx, ctxcancel := context.WithTimeout(context.Background(), time.Duration(15*time.Second))
	records, err := p.GetRecords(ctx, zone)
	if err != nil {
		fmt.Printf("Error: %s", err.Error())
		return
	}
	_ = ctxcancel

	fmt.Println(records)
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages