freedns

package module
v0.0.0-...-b7c699b Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: GPL-3.0 Imports: 12 Imported by: 4

README

go-freedns

This library manages DNS records on freedns.afraid.org

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigAuth

type ConfigAuth struct {
	Login       string `envconfig:"AUTH_LOGIN"`
	Password    string `envconfig:"AUTH_PASSWORD"`
	CookieName  string `envconfig:"AUTH_COOKIE_NAME"`
	CookieValue string `envconfig:"AUTH_COOKIE_VALUE"`
}

type ConfigUrls

type ConfigUrls struct {
	Base             string `envconfig:"URLS_BASE"`
	Login            string `envconfig:"URLS_LOGIN"`
	GetDomains       string `envconfig:"URLS_GET_DOMAINS"`
	CreateDomain     string `envconfig:"URLS_CREATE_DOMAIN"`
	DeleteDomain     string `envconfig:"URLS_DELETE_DOMAIN"`
	GetRecords       string `envconfig:"URLS_GET_RECORDS"`
	GetRecordDetails string `envconfig:"URLS_GET_RECORD_DETAILS"`
	UpdateRecord     string `envconfig:"URLS_UPDATE_RECORD"`
	DeleteRecord     string `envconfig:"URLS_DELETE_RECORD"`
}

type FreeDNS

type FreeDNS struct {
	Urls   ConfigUrls
	Auth   ConfigAuth
	Client *http.Client
}

func NewFreeDNS

func NewFreeDNS() (*FreeDNS, error)

func (*FreeDNS) Authenticate

func (ctx *FreeDNS) Authenticate() (string, error)

func (*FreeDNS) ConfigEnv

func (ctx *FreeDNS) ConfigEnv() error

func (*FreeDNS) ConfigFile

func (ctx *FreeDNS) ConfigFile() error

func (*FreeDNS) CreateDomain

func (ctx *FreeDNS) CreateDomain(domain string) error

func (*FreeDNS) CreateRecord

func (ctx *FreeDNS) CreateRecord(domain_id string, name string, t string, value string, ttl string) error

func (*FreeDNS) DeleteDomain

func (ctx *FreeDNS) DeleteDomain(domain_id string) error

func (*FreeDNS) DeleteRecord

func (ctx *FreeDNS) DeleteRecord(record_id string) error

func (*FreeDNS) FindRecordIds

func (ctx *FreeDNS) FindRecordIds(m map[string]Record, name string) (ids []string, ok bool)

func (*FreeDNS) GetDomains

func (ctx *FreeDNS) GetDomains() (map[string]string, map[string]string, error)

func (*FreeDNS) GetRecordDetails

func (ctx *FreeDNS) GetRecordDetails(record_id string) (*RecordDetails, error)

func (*FreeDNS) GetRecords

func (ctx *FreeDNS) GetRecords(domain_id string) (map[string]Record, error)

func (*FreeDNS) UpdateRecord

func (ctx *FreeDNS) UpdateRecord(domain_id string, record_id string, name string, t string, value string, ttl string) error

type Record

type Record struct {
	Id    string
	Name  string
	Type  string
	Value string
}

type RecordDetails

type RecordDetails struct {
	Id       string
	Fqdn     string
	Type     string
	Host     string
	DomainId string
	Domain   string
	Value    string
	Ttl      string
	Wildcard string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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