Skip to content

Alfschmalf/inwx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INWX for libdns

godoc reference

This package implements the libdns interfaces for the INWX API

Authenticating

To authenticate you need to supply your INWX Username and Password.

Example

Here's a minimal example of how to get all DNS records for zone. See also: provider_test.go

package main

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

	"github.com/libdns/libdns/inwx"
)

func main() {
	user := os.Getenv("LIBDNS_INWX_USER")
	if user == "" {
		fmt.Printf("LIBDNS_INWX_USER not set\n")
		return
	}

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

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

	p := &inwx.Provider{
		AuthUsername: user,
		AuthPassword: pass,
	}

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

	fmt.Println(records)
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages