mirror of
https://github.com/AmanTahiliani/cloudflare-dns-updater.git
synced 2026-08-07 19:56:16 -04:00
Initial Commit
This commit is contained in:
26
config.go
Normal file
26
config.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Email, Auth Key, Zone ID, Record Names
|
||||
|
||||
type Config struct {
|
||||
Email string
|
||||
AuthKey string
|
||||
ZoneID string
|
||||
RecordNames []string
|
||||
ForceIP string
|
||||
}
|
||||
|
||||
func LoadConfig() (*Config, error) {
|
||||
return &Config{
|
||||
Email: os.Getenv("CLOUDFLARE_EMAIL"),
|
||||
AuthKey: os.Getenv("CLOUDFLARE_AUTH_KEY"),
|
||||
ZoneID: os.Getenv("CLOUDFLARE_ZONE_ID"),
|
||||
RecordNames: strings.Split(os.Getenv("CLOUDFLARE_RECORD_NAMES"), ","),
|
||||
ForceIP: os.Getenv("CLOUDFLARE_FORCE_IP"),
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user