gdns

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GoogleDomainsUpdateAPI is the endpoint to update Dynamic DNS records
	GoogleDomainsUpdateAPI string = "https://domains.google.com/nic/update"
)
View Source
const (
	// IpifyAPI is the endpoint to get the external IP
	IpifyAPI string = "https://api.ipify.org"
)

Variables

This section is empty.

Functions

func FetchExternalIP

func FetchExternalIP() (*net.IP, error)

func UpdateDNS

func UpdateDNS(ctx context.Context, ip net.IP, name string, credentials *Credentials) error

Types

type Credentials

type Credentials struct {
	Username string
	Password string
}

type Cron

type Cron interface {
	Start()
	Shutdown()
	Refresh(cfg *UpdateConfig) error
}

func NewCron

func NewCron(config *UpdateConfig, tickerRate time.Duration) Cron

type DNSRecord

type DNSRecord struct {
	Name     string
	Username string
	Password string
}

type IpifyResponse

type IpifyResponse struct {
	IP string `json:"ip"`
}

type UpdateConfig

type UpdateConfig struct {
	DNSRecords []DNSRecord
	IP         net.IP
}

Jump to

Keyboard shortcuts

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