wedos

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 13 Imported by: 0

README

WEDOS DNS for libdns

Go Reference

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

Authentication

WEDOS API (WAPI) doesn't use API keys, but rather login username and password (precisely their SHA-1 hash). To get started, please see the official instructions here. Please note that your WAPI password is different from your Wedos account password.

When your WAPI account is ready, put your username (email) in the Username field and your WAPI password in the Password field. You can also use enviromental variables instaed of hardcoding your credentials.

Usage

package main

import (
	"context"
	"os"
	"log"

	"github.com/libdns/wedos"
)

func main() {
	provider := wedos.Provider{
		Username: os.Getenv("WEDOS_USERNAME"),
		Password: os.Getenv("WEDOS_PASSWORD"),
	}

	records, err := provider.GetRecords(context, "example.org")
	if err != nil {
		log.Fatalf("Unexpected error: %s", err)
	}

	fmt.Printf("%#v", records)
}

Known limitations

  • WEDOS allows TTL values from 300 to 172800. Setting your records with TTL=0 will fail.

Documentation

Overview

Package wedos implements a DNS record management client compatible with the libdns interfaces for WEDOS DNS.

Index

Constants

View Source
const (
	ARecord       = "A"
	AAAARecord    = "AAAA"
	AliasRecord   = "ALIAS"
	CNAMERecord   = "CNAME"
	MXRecord      = "MX"
	TXTRecord     = "TXT"
	SRVRecord     = "SRV"
	NSRecord      = "NS"
	SORARRecord   = "SOA"
	DNAMERecord   = "DNAME"
	NAPROOTRecord = "NAPTR"
	CAARecord     = "CAA"
	HTTPSRecord   = "HTTPS"
	SSHFPRecord   = "SSHFP"
	TLSARecord    = "TLSA"
)
View Source
const (
	GetRecords    = "dns-rows-list"
	AppendRecords = "dns-row-add"
	DeleteRecords = "dns-row-delete"
	UpdateRecords = "dns-row-update"
)
View Source
const (
	BaseURL        = "https://api.wedos.com/wapi/json"
	PragueTimezone = "Europe/Prague"
	TimezoneOffset = 1 * 60 * 60
)
View Source
const (
	OK = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Username string
	Password string
	// contains filtered or unexported fields
}

Provider implements libdns for Wedos using the WAPI hour‑based SHA‑1 token.

func NewProvider

func NewProvider(username, password string) *Provider

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 specified 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