coredns

package module
v0.0.0-...-8dfec34 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 14 Imported by: 0

README

libdns-coredns

Build Status Go Reference

libdns-coredns is a libdns Go library and comman d-line tool for interacting with a CoreDNS setup backed by etcd.

This package implements the libdns interfaces for CoreDNS backed by etcd, allowing you to manage DNS records.

Installation

go get git.mills.io/prologic/libdns-coredns

usage

package main

import (
	"context"

	"git.mills.io/prologic/libdns-coredns"
)

func main() {
	ctx := context.Background()

	zone := "test."

	// configure the DNS provider (choose any from github.com/libdns)
	provider := coredns.Provider{
		Endpoints:  []string{"http://127.0.0.1:2379"},
		PathPrefix: "/coredns",
	}

	// ...
}

See example for a full example.

License

libdns-coredns is licensed under the terms of the MIT License

Documentation

Overview

Package coredns implements a DNS record management client compatible with the libdns interfaces for CoreDNS backed by etcd.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// Endpoints if a list of etcd endpoints to use
	Endpoints []string `json:"endpoints,omitempty"`

	// PathPrefix is the etcd path prefix used for records
	PathPrefix string `json:"path_prefix,omitempty"`

	// Debug - can set this to stdout or stderr to dump
	// debugging information about the API interaction with
	// powerdns.  This will dump your auth token in plain text
	// so be careful.
	Debug string `json:"debug,omitempty"`
	// contains filtered or unexported fields
}

Provider facilitates DNS record manipulation with CoreDNS backed by etcd.

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

AppendRecords adds records to the zone. It returns the records that were added.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

DeleteRecords deletes the records from the zone. It returns the records that were deleted.

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

GetRecords lists all the records in the zone.

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

SetRecords sets the records in the zone, either by updating existing records or creating new ones. It returns the updated records.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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