neoserv

package module
v0.0.0-...-cf59d32 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 12 Imported by: 1

README

Neoserv for libdns

Go Reference

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

Installation

go get github.com/libdns/neoserv

Usage

You can check out a minimal example of using this provider in the examples directory.

Run it with:

[email protected] NEOSERV_PASSWORD=your_password NEOSERV_ZONE=your.domain go run ./examples/neoserv.go

Supported TTL Values

Neoserv only supports specific TTL values. The following are the supported TTL values:

  • 1 minute
  • 5 minutes
  • 15 minutes
  • 30 minutes
  • 1 hour
  • 6 hours
  • 12 hours
  • 24 hours (1 day)
  • 2 days
  • 7 days
  • 14 days
  • 30 days

By default, if an unsupported TTL is provided, the provider will use the closest supported value that is greater than or equal to the provided value. If you want to treat unsupported TTL values as errors, set UnsupportedTTLisError to true when creating the provider:

provider := neoserv.Provider{
	Username:              "your-neoserv-email",
	Password:              "your-neoserv-password",
	UnsupportedTTLisError: true,
}

Documentation

Overview

Package neoserv implements a DNS record management client compatible with the libdns interfaces for Neoserv.

Index

Constants

View Source
const (
	TTL1m  = 1 * time.Minute
	TTL5m  = 5 * time.Minute
	TTL15m = 15 * time.Minute
	TTL30m = 30 * time.Minute
	TTL1h  = 1 * time.Hour
	TTL6h  = 6 * time.Hour
	TTL12h = 12 * time.Hour
	TTL24h = 24 * time.Hour
	TTL2d  = 2 * 24 * time.Hour
	TTL7d  = 7 * 24 * time.Hour
	TTL14d = 14 * 24 * time.Hour
	TTL30d = 30 * 24 * time.Hour
)

Neoserv API does not support all TTL values. The following are the supported TTL values. Check Provider.UnsupportedTTLisError to determine how unsupported TTL values are handled.

Variables

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// Email used to authenticate with moj.neoserv.si
	Username string `json:"username,omitempty"`
	// Password used to authenticate with moj.neoserv.si
	Password string `json:"password,omitempty"`

	// UnsupportedTTLisError determines whether an unsupported TTL value should be treated as an error.
	// If set to true, the provider will return an error if an unsupported TTL value is requested.
	// If set to false, the provider will set the TTL to the nearest supported value that is at least the requested
	// value.
	UnsupportedTTLisError bool `json:"unsupported_ttl_is_error,omitempty"`
	// contains filtered or unexported fields
}

Provider facilitates DNS record manipulation with Neoserv.si.

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