summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-18 01:33:28 -0600
committerJeff Carr <[email protected]>2024-01-18 01:33:28 -0600
commitf0b712faf865b460b8be7a9edfd78e1b3852cae5 (patch)
treea20ae083ec79e99ba1c2cbe828edbee12c9d8911 /structs.go
parent586494505bb57aa1c4383641c6693a7021e1621d (diff)
fix pathsv0.12.3
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go108
1 files changed, 54 insertions, 54 deletions
diff --git a/structs.go b/structs.go
index 2f33532..8ac9a34 100644
--- a/structs.go
+++ b/structs.go
@@ -1,9 +1,9 @@
// This is a simple example
package cloudflare
-import (
+import (
"go.wit.com/gui/gui"
- "go.wit.com/gui/gadgets"
+ "go.wit.com/lib/gadgets"
)
var cloudflareURL string = "https://api.cloudflare.com/client/v4/zones/"
@@ -12,95 +12,95 @@ var cloudflareURL string = "https://api.cloudflare.com/client/v4/zones/"
// This structure should be adjusted based on the actual format of the response.
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"`
+ 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"`
}
-// CFdialog is everything you need forcreating
+// CFdialog is everything you need forcreating
// a new record: name, TTL, type (CNAME, A, etc)
var CFdialog dialogT
type dialogT struct {
- rootGui *gui.Node // the root node
- mainWindow *gadgets.BasicWindow // the window node
- zonedrop *gui.Node // the drop down menu of zones
+ rootGui *gui.Node // the root node
+ mainWindow *gadgets.BasicWindow // the window node
+ zonedrop *gui.Node // the drop down menu of zones
domainWidget *gui.Node
- zoneWidget *gui.Node
- authWidget *gui.Node
- emailWidget *gui.Node
+ zoneWidget *gui.Node
+ authWidget *gui.Node
+ emailWidget *gui.Node
loadButton *gui.Node
saveButton *gui.Node
- cloudflareW *gadgets.BasicWindow // the window node
- cloudflareB *gui.Node // the cloudflare button
+ cloudflareW *gadgets.BasicWindow // the window node
+ cloudflareB *gui.Node // the cloudflare button
- TypeNode *gui.Node // CNAME, A, AAAA, ...
- NameNode *gui.Node // www, mail, ...
- ValueNode *gui.Node // 4.2.2.2, "dkim stuff", etc
+ TypeNode *gui.Node // CNAME, A, AAAA, ...
+ NameNode *gui.Node // www, mail, ...
+ ValueNode *gui.Node // 4.2.2.2, "dkim stuff", etc
- rrNode *gui.Node // cloudflare Resource Record ID
- proxyNode *gui.Node // If cloudflare is a port 80 & 443 proxy
- ttlNode *gui.Node // just set to 1 which means automatic to cloudflare
- curlNode *gui.Node // shows you what you could run via curl
- resultNode *gui.Node // what the cloudflare API returned
- SaveNode *gui.Node // button to send it to cloudflare
+ rrNode *gui.Node // cloudflare Resource Record ID
+ proxyNode *gui.Node // If cloudflare is a port 80 & 443 proxy
+ ttlNode *gui.Node // just set to 1 which means automatic to cloudflare
+ curlNode *gui.Node // shows you what you could run via curl
+ resultNode *gui.Node // what the cloudflare API returned
+ SaveNode *gui.Node // button to send it to cloudflare
- zoneNode *gui.Node // "wit.com"
- zoneIdNode *gui.Node // cloudflare zone ID
- apiNode *gui.Node // cloudflare API key (from environment var CF_API_KEY)
- emailNode *gui.Node // cloudflare email (from environment var CF_API_EMAIL)
- urlNode *gui.Node // the URL to POST, PUT, DELETE, etc
+ zoneNode *gui.Node // "wit.com"
+ zoneIdNode *gui.Node // cloudflare zone ID
+ apiNode *gui.Node // cloudflare API key (from environment var CF_API_KEY)
+ emailNode *gui.Node // cloudflare email (from environment var CF_API_EMAIL)
+ urlNode *gui.Node // the URL to POST, PUT, DELETE, etc
}
// Resource Record (used in a DNS zonefile)
type RRT struct {
- ID string
- Type string
- Name string
- Content string
- ProxyS string
- Proxied bool
+ ID string
+ Type string
+ Name string
+ Content string
+ ProxyS string
+ Proxied bool
Proxiable bool
- Ttl string
+ Ttl string
Domain string
ZoneID string
- Auth string
- Email string
- url string
- data string
+ Auth string
+ Email string
+ url string
+ data string
}
/*
- This is a structure of all the RR's (Resource Records)
- in the DNS zonefiile for a hostname. For example:
+This is a structure of all the RR's (Resource Records)
+in the DNS zonefiile for a hostname. For example:
- For the host test.wit.com:
+For the host test.wit.com:
- test.wit.com A 127.0.0.1
- test.wit.com AAAA
- test.wit.com TXT email [email protected]
- test.wit.com TXT phone 212-555-1212
- test.wit.com CNAME real.wit.com
+test.wit.com A 127.0.0.1
+test.wit.com AAAA
+test.wit.com TXT email [email protected]
+test.wit.com TXT phone 212-555-1212
+test.wit.com CNAME real.wit.com
*/
type hostT struct {
hostname string
- RRs []ConfigT
+ RRs []ConfigT
}
type ConfigT struct {
Domain string
ZoneID string
- Auth string
- Email string
+ Auth string
+ Email string
}
var Config map[string]*ConfigT