driver

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package driver defines the interface for DNS service implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNS

type DNS interface {
	CreateZone(ctx context.Context, config ZoneConfig) (*ZoneInfo, error)
	DeleteZone(ctx context.Context, id string) error
	GetZone(ctx context.Context, id string) (*ZoneInfo, error)
	ListZones(ctx context.Context) ([]ZoneInfo, error)

	CreateRecord(ctx context.Context, config RecordConfig) (*RecordInfo, error)
	DeleteRecord(ctx context.Context, zoneID, name, recordType string) error
	GetRecord(ctx context.Context, zoneID, name, recordType string) (*RecordInfo, error)
	ListRecords(ctx context.Context, zoneID string) ([]RecordInfo, error)
	UpdateRecord(ctx context.Context, config RecordConfig) (*RecordInfo, error)
}

DNS is the interface that DNS provider implementations must satisfy.

type RecordConfig

type RecordConfig struct {
	ZoneID string
	Name   string
	Type   string // "A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "SRV"
	TTL    int
	Values []string
	Weight *int // for weighted routing, nil means not weighted
	SetID  string
}

RecordConfig describes a DNS record.

type RecordInfo

type RecordInfo struct {
	ZoneID string
	Name   string
	Type   string
	TTL    int
	Values []string
	Weight *int
	SetID  string
}

RecordInfo describes a DNS record.

type ZoneConfig

type ZoneConfig struct {
	Name    string
	Private bool
	Tags    map[string]string
}

ZoneConfig describes a DNS zone to create.

type ZoneInfo

type ZoneInfo struct {
	ID          string
	Name        string
	Private     bool
	RecordCount int
	Tags        map[string]string
}

ZoneInfo describes a DNS zone.

Jump to

Keyboard shortcuts

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