ddns

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileRegExps

func CompileRegExps(rawRegExps []string) ([]*regexp.Regexp, error)

func CreateIPv4Record

func CreateIPv4Record(ctx context.Context, zone *Zone, record *Record, content string) error

func CreateIPv6Record

func CreateIPv6Record(ctx context.Context, zone *Zone, record *Record, content string) error

func CreateRecord

func CreateRecord(ctx context.Context, zone *Zone, record *Record, typ, content string) error

func DeleteAllRecords

func DeleteAllRecords(ctx context.Context, zone *Zone, recordName string) error

func FilterAddrs

func FilterAddrs(addrs []netip.Addr, patterns []*regexp.Regexp) (filtered []netip.Addr)

func UpdateRecord

func UpdateRecord(ctx context.Context, zone *Zone, record *Record, addrs []netip.Addr) error

Types

type Env

type Env struct {
	Zones []*Zone
}

func LoadConfig

func LoadConfig(file *config.File) (*Env, error)

func (*Env) UpdateAllZones

func (e *Env) UpdateAllZones(ctx context.Context) error

type EnvUpdateReport

type EnvUpdateReport struct {
	ZoneUpdateReports []*ZoneUpdateReport
}

type NetIfAddrFilter

type NetIfAddrFilter struct {
	NetIfName string

	Ip4Ignore, Ip6Ignore []*regexp.Regexp
}

func LoadNetIfAddrFilter

func LoadNetIfAddrFilter(netIfName string, netIf *config.NetIf) (*NetIfAddrFilter, error)

func (*NetIfAddrFilter) Filter

func (f *NetIfAddrFilter) Filter() ([]netip.Addr, error)

type Record

type Record struct {
	Raw *config.Record

	NetIfAddrFilters []*NetIfAddrFilter
}

func LoadRecord

func LoadRecord(record *config.Record) (*Record, error)

type RecordUpdateReport

type RecordUpdateReport struct {
	Record *Record

	Err error
}

type Zone

type Zone struct {
	Raw *config.Zone

	API *cloudflare.API

	Records []*Record

	ZoneKey string
}

func LoadZone

func LoadZone(zoneKey string, zone *config.Zone) (*Zone, error)

func (*Zone) UpdateAll

func (z *Zone) UpdateAll(ctx context.Context) error

func (*Zone) UpdateRecord

func (z *Zone) UpdateRecord(ctx context.Context, record *Record) error

type ZoneUpdateReport

type ZoneUpdateReport struct {
	Zone *Zone

	RecordUpdateReports []*RecordUpdateReport
}

Jump to

Keyboard shortcuts

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