records

package
v0.0.0-...-10117dc Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record interface {
	GetURLValues() url.Values
	GetID() int
}

Record is a common interface for all the specific record types

type RecordA

type RecordA struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordA represents Njalla's A record

func NewRecordA

func NewRecordA(name string, content string, ttl int) (RecordA, error)

NewRecordA validates and creates a new RecordA

func (RecordA) GetID

func (r RecordA) GetID() int

GetID exposes the internal ID

func (RecordA) GetURLValues

func (r RecordA) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordAAAA

type RecordAAAA struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordAAAA represents Njalla's AAAA record

func NewRecordAAAA

func NewRecordAAAA(name string, content string, ttl int) (RecordAAAA, error)

NewRecordAAAA validates and creates a new RecordAAAA

func (RecordAAAA) GetID

func (r RecordAAAA) GetID() int

GetID exposes the internal ID

func (RecordAAAA) GetURLValues

func (r RecordAAAA) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordCAA

type RecordCAA struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordCAA represents Njalla's CAA record

func NewRecordCAA

func NewRecordCAA(name string, content string, ttl int) (RecordCAA, error)

NewRecordCAA validates and creates a new RecordCAA

func (RecordCAA) GetID

func (r RecordCAA) GetID() int

GetID exposes the internal ID

func (RecordCAA) GetURLValues

func (r RecordCAA) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordCNAME

type RecordCNAME struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordCNAME represents Njalla's CNAME record

func NewRecordCNAME

func NewRecordCNAME(name string, content string, ttl int) (RecordCNAME, error)

NewRecordCNAME validates and creates a new RecordCNAME

func (RecordCNAME) GetID

func (r RecordCNAME) GetID() int

GetID exposes the internal ID

func (RecordCNAME) GetURLValues

func (r RecordCNAME) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordDynamic

type RecordDynamic struct {
	ID   int    `json:"id"`
	Type string `json:"type"`
	Name string `json:"name"`
	TTL  int    `json:"ttl"`
}

RecordDynamic represents Njalla's Dynamic record

func NewRecordDynamic

func NewRecordDynamic(name string, content string, ttl int) (RecordDynamic, error)

NewRecordDynamic validates and creates a new RecordDynamic

func (RecordDynamic) GetID

func (r RecordDynamic) GetID() int

GetID exposes the internal ID

func (RecordDynamic) GetURLValues

func (r RecordDynamic) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordMX

type RecordMX struct {
	ID       int    `json:"id"`
	Type     string `json:"type"`
	Name     string `json:"name"`
	Content  string `json:"content"`
	TTL      int    `json:"ttl"`
	Priority int    `json:"prio"`
}

RecordMX represents Njalla's MX record

func NewRecordMX

func NewRecordMX(name string, content string, ttl int, priority int) (RecordMX, error)

NewRecordMX validates and creates a new RecordMX

func (RecordMX) GetID

func (r RecordMX) GetID() int

GetID exposes the internal ID

func (RecordMX) GetURLValues

func (r RecordMX) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordNS

type RecordNS struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordNS represents Njalla's NS record

func NewRecordNS

func NewRecordNS(name string, content string, ttl int) (RecordNS, error)

NewRecordNS validates and creates a new RecordNS

func (RecordNS) GetID

func (r RecordNS) GetID() int

GetID exposes the internal ID

func (RecordNS) GetURLValues

func (r RecordNS) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordPTR

type RecordPTR struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordPTR represents Njalla's PTR record

func NewRecordPTR

func NewRecordPTR(name string, content string, ttl int) (RecordPTR, error)

NewRecordPTR validates and creates a new RecordPTR

func (RecordPTR) GetID

func (r RecordPTR) GetID() int

GetID exposes the internal ID

func (RecordPTR) GetURLValues

func (r RecordPTR) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordRedirect

type RecordRedirect struct {
	ID           int    `json:"id"`
	Type         string `json:"type"`
	Name         string `json:"name"`
	URL          string `json:"content"`
	RedirectType int    `json:"prio"`
}

RecordRedirect represents Njalla's Redirect record

func NewRecordRedirect

func NewRecordRedirect(name string, url string, redirectType int) (RecordRedirect, error)

NewRecordRedirect validates and creates a new RecordRedirect

func (RecordRedirect) GetID

func (r RecordRedirect) GetID() int

GetID exposes the internal ID

func (RecordRedirect) GetURLValues

func (r RecordRedirect) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordSRV

type RecordSRV struct {
	ID       int    `json:"id"`
	Type     string `json:"type"`
	Name     string `json:"name"`
	Content  string `json:"content"`
	TTL      int    `json:"ttl"`
	Priority int    `json:"prio"`
	Weight   uint   `json:"weight"`
	Port     uint   `json:"port"`
}

RecordSRV represents Njalla's SRV record

func NewRecordSRV

func NewRecordSRV(
	name string, content string, ttl int, priority int, weight uint,
	port uint,
) (RecordSRV, error)

NewRecordSRV validates and creates a new RecordSRV

func (RecordSRV) GetID

func (r RecordSRV) GetID() int

GetID exposes the internal ID

func (RecordSRV) GetURLValues

func (r RecordSRV) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordSSHFP

type RecordSSHFP struct {
	ID           int    `json:"id"`
	Type         string `json:"type"`
	Name         string `json:"name"`
	TTL          int    `json:"ttl"`
	SSHAlgorithm int    `json:"ssh_algorithm"`
	SSHType      int    `json:"ssh_type"`
	Content      string `json:"content"`
}

RecordSSHFP represents Njalla's SSHFP record

func NewRecordSSHFP

func NewRecordSSHFP(
	name string, content string, ttl int, sshAlgorithm int, sshType int,
) (RecordSSHFP, error)

NewRecordSSHFP validates and creates a new RecordSSHFP

func (RecordSSHFP) GetID

func (r RecordSSHFP) GetID() int

GetID exposes the internal ID

func (RecordSSHFP) GetURLValues

func (r RecordSSHFP) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordTLSA

type RecordTLSA struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordTLSA represents Njalla's TLSA record

func NewRecordTLSA

func NewRecordTLSA(name string, content string, ttl int) (RecordTLSA, error)

NewRecordTLSA validates and creates a new RecordTLSA

func (RecordTLSA) GetID

func (r RecordTLSA) GetID() int

GetID exposes the internal ID

func (RecordTLSA) GetURLValues

func (r RecordTLSA) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type RecordTXT

type RecordTXT struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordTXT represents Njalla's TXT record

func NewRecordTXT

func NewRecordTXT(name string, content string, ttl int) (RecordTXT, error)

NewRecordTXT validates and creates a new RecordTXT

func (RecordTXT) GetID

func (r RecordTXT) GetID() int

GetID exposes the internal ID

func (RecordTXT) GetURLValues

func (r RecordTXT) GetURLValues() url.Values

GetURLValues converts struct fields back into provider suitable values

type Records

type Records []Record

Records is an array of different record types that implement the Record interface

func (Records) String

func (r Records) String() string

func (*Records) UnmarshalJSON

func (r *Records) UnmarshalJSON(data []byte) error

UnmarshalJSON customises the default unmarshal behaviour to parse into specific record types

Jump to

Keyboard shortcuts

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