agent

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package agent provides a long-running MyDynDNS agent for keeping DNS records up-to-date with a Client-reported apparent IP address. An Agent process is configured to check the apparent IP address at regular intervals. At each interval, the latest-retrieved IP address is compared to the previously-retrieved IP address. When the compared values differ, the Agent attempts to update DNS records accordingly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, logger log.Logger, client Client, pollInterval time.Duration) error

Run executes the agent until the provided context.Context is cancelled. When the agent fails to start, Run returns an error.

Types

type Client

type Client interface {
	UpdateAliasWithContext(ctx context.Context) (net.IP, error)
	MyIPWithContext(ctx context.Context) (net.IP, error)
}

The Client interface is satisfied by the client struct type from the MyDynDNS SDK.

Jump to

Keyboard shortcuts

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