dns

package
v0.0.0-...-37e8452 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2016 License: BSD-2-Clause Imports: 4 Imported by: 105

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNS

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

DNS represents the interface to the DNS portion of Linode's API.

func FromLinode

func FromLinode(l *linode.Linode) *DNS

FromLinode returns a pointer to a new DNS object, using the provided Linode instance as backing.

func New

func New(apiKey string) *DNS

New returns a pointer to a new DNS object.

func (*DNS) CreateDomainResource

func (d *DNS) CreateDomainResource(r *Resource) (*ResourceResponse, error)

CreateDomainResource executes the "domain.resource.create" API call. This will create a new resource using the values specified in the resource.

func (*DNS) CreateDomainResourceA

func (d *DNS) CreateDomainResourceA(domainID int, name, target string, ttlSeconds int) (*ResourceResponse, error)

CreateDomainResourceA executes the "domain.resource.create" API call. This will create a new "A" resource using the specified parameters.

func (*DNS) CreateDomainResourceAAAA

func (d *DNS) CreateDomainResourceAAAA(domainID int, name, target string, ttlSeconds int) (*ResourceResponse, error)

CreateDomainResourceAAAA executes the "domain.resource.create" API call. This will create a new "AAAA" resource using the specified parameters.

func (*DNS) CreateDomainResourceCNAME

func (d *DNS) CreateDomainResourceCNAME(domainID int, name, target string, ttlSeconds int) (*ResourceResponse, error)

CreateDomainResourceCNAME executes the "domain.resource.create" API call. This will create a new "CNAME" resource using the specified parameters.

func (*DNS) CreateDomainResourceMX

func (d *DNS) CreateDomainResourceMX(domainID int, name, target string, priority, ttlSeconds int) (*ResourceResponse, error)

CreateDomainResourceMX executes the "domain.resource.create" API call. This will create a new "MX" resource using the specified parameters.

func (*DNS) CreateDomainResourceNS

func (d *DNS) CreateDomainResourceNS(domainID int, name, target string, ttlSeconds int) (*ResourceResponse, error)

CreateDomainResourceNS executes the "domain.resource.create" API call. This will create a new "NS" resource using the specified parameters.

func (*DNS) CreateDomainResourceSRV

func (d *DNS) CreateDomainResourceSRV(domainID int, name, target, protocol string, priority, ttlSeconds int) (*ResourceResponse, error)

CreateDomainResourceSRV executes the "domain.resource.create" API call. This will create a new "SRV" resource using the specified parameters.

func (*DNS) CreateDomainResourceTXT

func (d *DNS) CreateDomainResourceTXT(domainID int, name, target string, ttlSeconds int) (*ResourceResponse, error)

CreateDomainResourceTXT executes the "domain.resource.create" API call. This will create a new "TXT" resource using the specified parameters.

func (*DNS) DeleteDomain

func (d *DNS) DeleteDomain(domainID int) (*DomainResponse, error)

DeleteDomain executes the "domain.delete" API call. This will delete the domain specified by domainID.

func (*DNS) DeleteDomainResource

func (d *DNS) DeleteDomainResource(domainID, resourceID int) (*ResourceResponse, error)

DeleteDomainResource executes the "domain.resource.delete" API call. This will delete the resource specified by resourceID under the domain specified by domainID.

func (*DNS) GetDomain

func (d *DNS) GetDomain(domain string) (*Domain, error)

GetDomain returns the specified domain. This search is not case-sensitive.

func (*DNS) GetDomainResources

func (d *DNS) GetDomainResources(domainID int) ([]*Resource, error)

GetDomainResources executes the "domain.resource.list" API call. This will return a list of domain resources associated with the specified domainID.

func (*DNS) GetDomains

func (d *DNS) GetDomains(domainId interface{}) ([]*Domain, error)

GetDomains executes the "domain.list" API call. When domainID is nil, this will return a list of domains. Otherwise, it will return only the domain specified by domainID.

func (*DNS) GetResourcesByType

func (d *DNS) GetResourcesByType(domainID int, res_type string) ([]*Resource, error)

GetResourceByType returns a list of domain resources that match the specified type. This search is not case-sensitive.

func (*DNS) ToLinode

func (d *DNS) ToLinode() *linode.Linode

ToLinode returns a pointer to the internal Linode object.

type Domain

type Domain struct {
	AXFR_IPs         string `json:"AXFR_IPS"`
	Description      string `json:"DESCRIPTION"`
	Domain           string `json:"DOMAIN"`
	DomainID         int    `json:"DOMAINID"`
	Expire_Sec       int    `json:"EXPIRE_SEC"`
	LPM_DisplayGroup string `json:"LPM_DISPLAYGROUP"`
	Master_IPs       string `json:"MASTER_IPS"`
	Refresh_Sec      int    `json:"REFRESH_SEC"`
	Retry_Sec        int    `json:"RETRY_SEC"`
	SOA_Email        string `json:"SOA_EMAIL"`
	Status           int    `json:"STATUS"`
	TTL_Sec          int    `json:"TTL_SEC"`
	Type             string `json:"TYPE"`
}

Domain represents a domain.

type DomainResponse

type DomainResponse struct {
	DomainID int `json:"DomainID"`
}

DomainResponse represents the response to a create, update, or delete domain API call.

type Resource

type Resource struct {
	DomainID   int         `json:"DOMAINID"`
	Name       string      `json:"NAME"`
	Port       interface{} `json:"PORT"`
	Priority   interface{} `json:"PRIORITY"`
	Protocol   string      `json:"PROTOCOL"`
	ResourceID int         `json:"RESOURCEID"`
	Target     string      `json:"TARGET"`
	TTL_Sec    int         `json:"TTL_SEC"`
	Type       string      `json:"TYPE"`
	Weight     interface{} `json:"WEIGHT"`
}

Resource represents a domain resource.

type ResourceResponse

type ResourceResponse struct {
	ResourceID int `json:"ResourceID"`
}

ResourceResponse represents the response to a create, update, or delete resource API call.

Jump to

Keyboard shortcuts

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