hexonet

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 13 Imported by: 2

README

Hexonet provider for libdns

This package implements the libdns interfaces for Hexonet, allowing you to manage DNS records.

To configure this, simply specify the username and the password.

package main

import (
    "context"

    "github.com/libdns/libdns"
    "github.com/libdns/hexonet"
)

func main() {
    p := &hexonet.Provider{
        Username: "abcde12312312", // required
        Password:  "@#$#12312312",        // required
    }

    _, err := p.AppendRecords(context.Background(), "example.org.", []libdns.Record{
        {
            Name:  "_acme_whatever",
            Type:  "TXT",
            Value: "123456",
        },
    })
    if err != nil {
        panic(err)
    }

}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRR

func ParseRR(rr string) (name, ttl, typ, value string)

rr format "gomeing.com. 3600 IN NS ns1191.hexonet.net."

func TXTSanitize

func TXTSanitize(record libdns.Record) (value string)

Types

type Provider

type Provider struct {
	Username string `json:"username"`
	Password string `json:"password,omitempty"`

	// Debug - can set this to stdout or stderr to dump
	// debugging information about the API interaction with
	// hexonet.  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 Hexonet.

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