dnsimple

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 7

README

dnsimple for libdns

Go Reference

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

Configuration

This provider expects the following configuration:

Required
Optional
  • ACCOUNT_ID: identifier for the account (only needed if using a user access token), see accounts documentation
  • API_URL: hostname for the API to use (defaults to api.dnsimple.com), only useful for testing purposes, see sandox documentation

Testing

In order to run the tests, you need to create an account on the DNSimple sandbox environment. After setup, create a new DNS zone, and create an API_ACCESS_TOKEN and take note of both. You will need both these values to run tests.

$ TEST_ZONE=example.com TEST_API_ACCESS_TOKEN=you_api_access_token go test -v
=== RUN   Test_AppendRecords
--- PASS: Test_AppendRecords (1.23s)
=== RUN   Test_DeleteRecords
--- PASS: Test_DeleteRecords (0.59s)
=== RUN   Test_GetRecords
--- PASS: Test_GetRecords (0.58s)
=== RUN   Test_SetRecords
--- PASS: Test_SetRecords (1.14s)
PASS
ok  	github.com/libdns/dnsimple	3.666s

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	APIAccessToken string `json:"api_access_token,omitempty"`
	AccountID      string `json:"account_id,omitempty"`
	APIURL         string `json:"api_url,omitempty"`
	// contains filtered or unexported fields
}

Provider facilitates DNS record manipulation with DNSimple.

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.

Jump to

Keyboard shortcuts

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