libdnsfactory

package module
v0.0.0-...-1d97db1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 14 Imported by: 2

README

libdnsfactory

godoc reference

With libdnsfactory, you can create libdns providers by name.

This allows you to support all providers in a dynamic way. For example, if you want to let the user decide which provider to use with which configuration.

The factory and docs are generated from the provider repositories.

Install

go get -u github.com/matthiasng/libdnsfactory

Example

package main

import (
	"fmt"

	"github.com/matthiasng/libdnsfactory"
)

func main() {
    name := "hetzner"
    configMap := map[string]string{
		"AuthAPIToken": "<your token>",
    }
    
	provider, err := libdnsfactory.NewProvider(name, configMap)
	if err != nil {
		panic(err)
	}

    records, err := provider.AppendRecords(...)
    if err != nil {
		panic(err)
    }
    
    fmt.Println(records)
}

Dev

To update an existing provider or add a new one, run go get -u github.com/libdns/... and go run ./generate.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

Provider summarizes all libdns interfaces

func NewProvider

func NewProvider(name string, config map[string]string) (Provider, error)

NewProvider creates a new Provider. See https://github.com/matthiasng/libdnsfactory/blob/master/docs.md for a complete list of supported providers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL