glesys

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: MIT Imports: 11 Imported by: 6 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Glesys for libdns

This package implements the libdns interfaces for Glesys, allowing you to manage DNS records. It utilizes glesys-go for API communication.

Usage

include (
    glesys "github.com/libdns/glesys"
)
p := &glesys.Provider{
    Project: "your project/username usually clXXXXXX",
    ApiKey: "api-key",
}

zone := "example.org"
records, err := p.GetRecords(ctx, zone)

For more examples check the _examples folder in the source.

Noteworthy

To do everything this library can do the Glesys API user needs permissions to the following...

  • Domain.addrecord
  • Domain.deleterecord
  • Domain.listrecords
  • Domain.updaterecord

Development

Testing
make test

If you have a domain available at glesys and want to do integration testing then set 3 environment variables first.

export GLESYS_PROJECT="<your glesys project id>"
export GLESYS_KEY="<your glesys api-key>"
export GLESYS_ZONE="<yourdomain.touse>"

This will leave a TXT record called _libdns-test with the text of the current date and time in your DNS settings.

There is a "secret" way of enabling some debug output from libdns. If you set the environment key LIBDNS_GLESYS_DEBUG to true (or something parsable to a boolean true) then you will see som classic debug prints.

Documentation

Overview

SPDX-FileCopyrightText: 2022 Peter Magnusson <me@kmpm.se> SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Project string `json:"project,omitempty"`
	APIKey  string `json:"api_key,omitempty"`
	// contains filtered or unexported fields
}

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. In RFC 9499 terms, SetRecords appends, modifies, or deletes records in the zone so that for each RRset in the input, the records provided in the input are the only members of their RRset in the output zone. Calls to SetRecords are presumed to be atomic; It returns the updated records.

Directories

Path Synopsis
_examples
acme-like command
internal
impl
SPDX-License-Identifier: MIT SPDX-FileCopyrightText: 2017 GleSYS Internet Services AB
SPDX-License-Identifier: MIT SPDX-FileCopyrightText: 2017 GleSYS Internet Services AB

Jump to

Keyboard shortcuts

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