api

package module
v0.0.0-...-607e537 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvOrDefault

func GetEnvOrDefault(variable string, defaultValue string) string

Types

type Domain

type Domain struct {
	Name   string
	ZoneID int64
	Txt    string
	// contains filtered or unexported fields
}

func NewDomain

func NewDomain(domain string, zone Zone) Domain

type IPv4

type IPv4 string

type IPv6

type IPv6 string

type MySqlReader

type MySqlReader struct {
	// contains filtered or unexported fields
}

func BuildMySqlReader

func BuildMySqlReader(username string, password string, hostname string, database string) (MySqlReader, error)

func NewMySqlReader

func NewMySqlReader() (MySqlReader, error)

func (*MySqlReader) FetchZones

func (m *MySqlReader) FetchZones() (z []Zone, err error)

This methods retrieves list of Zones from the database server

func (*MySqlReader) LookupDomain

func (m *MySqlReader) LookupDomain(domain string) (d Domain, err error)

This method retrieves Zone id from the database server. This ZoneID can be converted to A or AAAA record.

type MySqlStorage

type MySqlStorage struct {
	// contains filtered or unexported fields
}

func BuildMySqlStorage

func BuildMySqlStorage(username string, password string, hostname string, database string) (s MySqlStorage, err error)

func NewMySqlStorage

func NewMySqlStorage() (MySqlStorage, error)

func (MySqlStorage) AddDomain

func (m MySqlStorage) AddDomain(domain Domain) (d Domain, err error)

This method adds specified domain to the database

func (MySqlStorage) AddDomainAsString

func (m MySqlStorage) AddDomainAsString(domain string, zoneId int64) (d Domain, err error)

This method adds specified domain

func (MySqlStorage) AddZone

func (m MySqlStorage) AddZone(zone Zone) (z Zone, err error)

func (MySqlStorage) DeleteDomain

func (m MySqlStorage) DeleteDomain(domain Domain) (err error)

This method allows to delete specified domain from the database

func (MySqlStorage) DeleteDomainById

func (m MySqlStorage) DeleteDomainById(domainId int64) (err error)

This method allows to delete domain with specified ID from the database

func (MySqlStorage) DeleteZone

func (m MySqlStorage) DeleteZone(zone Zone) (err error)

func (MySqlStorage) DeleteZoneById

func (m MySqlStorage) DeleteZoneById(zoneId int64) (err error)

func (MySqlStorage) FetchZones

func (m MySqlStorage) FetchZones() (z []Zone, err error)

func (MySqlStorage) LookupDomain

func (m MySqlStorage) LookupDomain(domain string) (d Domain, err error)

func (MySqlStorage) UpdateDomain

func (m MySqlStorage) UpdateDomain(d Domain) (dom Domain, err error)

This method updates specified domain in the database.

func (MySqlStorage) UpdateZone

func (m MySqlStorage) UpdateZone(zone Zone) (z Zone, err error)

type Zone

type Zone struct {
	Name string
	A    []IPv4
	AAAA []IPv6
	// contains filtered or unexported fields
}

type ZoneReader

type ZoneReader interface {
	FetchZones() (z []Zone, err error)
	LookupDomain(domain string) (d Domain, err error)
}

type ZoneStorage

type ZoneStorage interface {
	FetchZones() (z []Zone, err error)
	AddZone(zone Zone) (z Zone, err error)
	UpdateZone(zone Zone) (z Zone, err error)
	DeleteZone(zone Zone) (err error)
	DeleteZoneById(zoneId int64) (err error)

	LookupDomain(domain string) (d Domain, err error)
	AddDomainAsString(domain string, zoneId int64) (d Domain, err error)
	AddDomain(domain Domain) (d Domain, err error)
	UpdateDomain(domain Domain) (d Domain, err error)
	DeleteDomain(domain Domain) (err error)
	DeleteDomainById(domainId int64) (err error)
}

Jump to

Keyboard shortcuts

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