Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "cfddns", Short: "Cloudflare Dynamic DNS daemon", Long: ``, Run: func(cmd *cobra.Command, args []string) { cfg := viper.GetViper() api, err := cloudflare.New(cfg.GetString("key"), cfg.GetString("email")) if err != nil { log.Fatal(err) } zoneID, err := api.ZoneIDByName(cfg.GetString("domain")) if err != nil { log.Fatal(err) } ctx, cancel := context.WithCancel(context.Background()) defer cancel() sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) go cfddns.Daemon(ctx, zoneID, api, cfg.GetDuration("interval")) <-sigChan }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.