cloudflare

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RecordAlreadyExists = errors.New("Record already exists")
	RecordNotFound      = errors.New("Record not found")
)

Functions

This section is empty.

Types

type Cloudflare

type Cloudflare interface {
	// CreateRecord Creates a new DNS record
	CreateRecord(subdomain, ip string) error

	// UpdateRecord Updates an existing DNS record
	UpdateRecord(subdomain, ip string) error

	// DeleteRecord Deletes a DNS record
	DeleteRecord(subdomain string) error
}

func New

func New(cfg *Config, domain string, lg *zap.Logger) Cloudflare

type Config

type Config struct {
	CloudflareURL string `koanf:"cloudflare_url"`
	Token         string `koanf:"token"`
	ZoneID        string `koanf:"zone_id"`
}

type DNSRecord

type DNSRecord struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Content string `json:"content"`
	Proxied bool   `json:"proxied"`
	Type    string `json:"type"`
	TTL     int    `json:"ttl"`
}

DNSRecord is a partial request and response model for working with Cloudflare API

Jump to

Keyboard shortcuts

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