Skip to content

Commit

Permalink
Switch to using github.com/cloudflare/cloudflare-go for interacting w…
Browse files Browse the repository at this point in the history
…ith Cloudflare API.
  • Loading branch information
joshuar committed Feb 26, 2023
1 parent b868a2c commit 5ba54e9
Show file tree
Hide file tree
Showing 5 changed files with 793 additions and 222 deletions.
7 changes: 4 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ var rootCmd = &cobra.Command{
}
},
Run: func(cmd *cobra.Command, args []string) {
cfAccount := cloudflare.GetAccountDetails()
cfAccount.CheckForUpdates()
cfDetails := cloudflare.NewCloudflare()

cfDetails.CheckAndUpdate()

ticker := time.NewTicker(getIntervalFromConfig())
done := make(chan bool)
Expand All @@ -62,7 +63,7 @@ var rootCmd = &cobra.Command{
return
case <-ticker.C:
log.Debug("Checking for external IP update...")
cfAccount.CheckForUpdates()
cfDetails.CheckAndUpdate()
}
}
},
Expand Down
2 changes: 0 additions & 2 deletions configs/cf-ddns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ account:
zone: whatever.com
records:
- myserver.whatever.com


7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module github.com/joshuar/cf-ddns
go 1.16

require (
github.com/cloudflare/cloudflare-go v0.61.0
github.com/go-resty/resty/v2 v2.7.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.9.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.15.0
)
Loading

0 comments on commit 5ba54e9

Please sign in to comment.