cloudflare

package module
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 9 Imported by: 3

Documentation

Overview

This is a simple example

This is a simple example

This is a simple example

This is a simple example

This is a simple example

This is a simple example

This is a simple example

Index

Constants

This section is empty.

Variables

View Source
var CFdialog dialogT

CFdialog is everything you need forcreating a new record: name, TTL, type (CNAME, A, etc)

View Source
var CURL *log.LogFlag
View Source
var Config map[string]*ConfigT
View Source
var INFO *log.LogFlag
View Source
var SPEW *log.LogFlag
View Source
var WARN *log.LogFlag
View Source
var ZONE *log.LogFlag

Functions

func Create

func Create(zone string, hostname string, value string) bool

func CreateRR

func CreateRR(myGui *gui.Node, zone string, zoneID string) *gadgets.BasicWindow

func Delete

func Delete(zone string, hostname string, value string) (bool, string)

func FormatJSON

func FormatJSON(unformattedJSON string) (string, error)

formatJSON takes an unformatted JSON string and returns a formatted version.

func LoadZoneWindow

func LoadZoneWindow(n *gui.Node, c *ConfigT)

func MakeCloudflareWindow

func MakeCloudflareWindow(n *gui.Node) *gadgets.BasicWindow

This creates a window

func SetRow

func SetRow(dnsRow *RRT)

Types

type ConfigT

type ConfigT struct {
	Domain string
	ZoneID string
	Auth   string
	Email  string
}

type DNSRecords

type DNSRecords struct {
	Result []struct {
		ID        string `json:"id"`
		Type      string `json:"type"`
		Name      string `json:"name"`
		Content   string `json:"content"`
		Proxied   bool   `json:"proxied"`
		Proxiable bool   `json:"proxiable"`
		TTL       int    `json:"ttl"`
	} `json:"result"`
}

Define a struct to match the JSON structure of the response. This structure should be adjusted based on the actual format of the response.

func GetZonefile

func GetZonefile(c *ConfigT) *DNSRecords

type RRT

type RRT struct {
	ID        string
	Type      string
	Name      string
	Content   string
	ProxyS    string
	Proxied   bool
	Proxiable bool
	Ttl       string

	Domain string
	ZoneID string
	Auth   string
	Email  string
	// contains filtered or unexported fields
}

Resource Record (used in a DNS zonefile)

func DoChange

func DoChange() *RRT

This function should run each time the user chanegs anything in the GUi or each time something in general changes

It returns a RR record which then can be turned into JSON and sent via http to cloudflare's API

Jump to

Keyboard shortcuts

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