gehirndns

package module
Version: v0.0.0-...-31fa039 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2014 License: MIT Imports: 11 Imported by: 0

README

golang-gehirndns
================

-----
About
-----
This is a API client of `Gehirn DNS`_ written in Go.


-------
Caution
-------
I am a engineer at `Gehirn Inc`_ now, but this project is a personal, NOT OFFICIAL.

-------
License
-------
golang-gehirndns is licensed under the MIT LICENSE.
See `./LICENSE.rst <./LICENSE.rst>`_.

.. _Gehirn DNS: http://www.gehirn.jp/dns.html
.. _Gehirn Inc: http://www.gehirn.co.jp/

Documentation

Index

Constants

View Source
const (
	APIENDPOINT = "https://cp.gehirn.jp/api/dns/"
)

Variables

View Source
var (
	ErrMaybeRegistered = errors.New("This record is maybe registered at Gehirn DNS.  Use `UpdateResource(IRecord) error` insted of this method")
	ErrIdUnset         = errors.New("Record id is unset")
)

Functions

This section is empty.

Types

type AAAARecord

type AAAARecord struct {
	IPAddress IPv6 `json:"IPAddress"`
	// contains filtered or unexported fields
}

func (*AAAARecord) GetHostName

func (r *AAAARecord) GetHostName() HostName

func (*AAAARecord) GetId

func (r *AAAARecord) GetId() RecordId

func (*AAAARecord) GetName

func (r *AAAARecord) GetName() HostName

func (*AAAARecord) GetTTL

func (r *AAAARecord) GetTTL() Seconds

func (*AAAARecord) GetType

func (r *AAAARecord) GetType() RecordType

func (*AAAARecord) SetHostName

func (r *AAAARecord) SetHostName(name HostName)

func (*AAAARecord) SetTTL

func (r *AAAARecord) SetTTL(ttl Seconds)

type ARecord

type ARecord struct {
	IPAddress IPv4 `json:"IPAddress"`
	// contains filtered or unexported fields
}

func (*ARecord) GetHostName

func (r *ARecord) GetHostName() HostName

func (*ARecord) GetId

func (r *ARecord) GetId() RecordId

func (*ARecord) GetName

func (r *ARecord) GetName() HostName

func (*ARecord) GetTTL

func (r *ARecord) GetTTL() Seconds

func (*ARecord) GetType

func (r *ARecord) GetType() RecordType

func (*ARecord) SetHostName

func (r *ARecord) SetHostName(name HostName)

func (*ARecord) SetTTL

func (r *ARecord) SetTTL(ttl Seconds)

type ApiKey

type ApiKey struct {
	Token  string
	Secret string
}

type CNAMERecord

type CNAMERecord struct {
	AliasTo HostName `json:"AliasTo"`
	// contains filtered or unexported fields
}

func (*CNAMERecord) GetHostName

func (r *CNAMERecord) GetHostName() HostName

func (*CNAMERecord) GetId

func (r *CNAMERecord) GetId() RecordId

func (*CNAMERecord) GetName

func (r *CNAMERecord) GetName() HostName

func (*CNAMERecord) GetTTL

func (r *CNAMERecord) GetTTL() Seconds

func (*CNAMERecord) GetType

func (r *CNAMERecord) GetType() RecordType

func (*CNAMERecord) SetHostName

func (r *CNAMERecord) SetHostName(name HostName)

func (*CNAMERecord) SetTTL

func (r *CNAMERecord) SetTTL(ttl Seconds)

type Client

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

func NewClient

func NewClient(apiKey *ApiKey) *Client

func (*Client) GetZone

func (c *Client) GetZone(id ZoneId) (zone *Zone, err error)

type HostName

type HostName string

func (HostName) String

func (host HostName) String() string

type IPv4

type IPv4 string

type IPv6

type IPv6 string

type IRecord

type IRecord interface {
	GetId() RecordId
	GetHostName() HostName
	SetHostName(HostName)

	GetName() HostName

	GetType() RecordType
	GetTTL() Seconds
	SetTTL(Seconds)
	// contains filtered or unexported methods
}

type MXRecord

type MXRecord struct {
	MailServer HostName
	Priority   Priority
	// contains filtered or unexported fields
}

func (*MXRecord) GetHostName

func (r *MXRecord) GetHostName() HostName

func (*MXRecord) GetId

func (r *MXRecord) GetId() RecordId

func (*MXRecord) GetName

func (r *MXRecord) GetName() HostName

func (*MXRecord) GetTTL

func (r *MXRecord) GetTTL() Seconds

func (*MXRecord) GetType

func (r *MXRecord) GetType() RecordType

func (*MXRecord) SetHostName

func (r *MXRecord) SetHostName(name HostName)

func (*MXRecord) SetTTL

func (r *MXRecord) SetTTL(ttl Seconds)

type MailAddress

type MailAddress string

type NSRecord

type NSRecord struct {
	NameServer HostName
	// contains filtered or unexported fields
}

func (*NSRecord) GetHostName

func (r *NSRecord) GetHostName() HostName

func (*NSRecord) GetId

func (r *NSRecord) GetId() RecordId

func (*NSRecord) GetName

func (r *NSRecord) GetName() HostName

func (*NSRecord) GetTTL

func (r *NSRecord) GetTTL() Seconds

func (*NSRecord) GetType

func (r *NSRecord) GetType() RecordType

func (*NSRecord) SetHostName

func (r *NSRecord) SetHostName(name HostName)

func (*NSRecord) SetTTL

func (r *NSRecord) SetTTL(ttl Seconds)

type Priority

type Priority uint64

type RecordId

type RecordId string

func (RecordId) String

func (id RecordId) String() string

type RecordType

type RecordType string

type SOARecord

type SOARecord struct {
	Mname            HostName    `json:"MNAME"`
	Rname            MailAddress `json:"RNAME"`
	Serial           uint
	Refresh          Seconds
	Retry            Seconds
	Expire           Seconds
	NegativeCacheTTL Seconds
	// contains filtered or unexported fields
}

func (*SOARecord) GetHostName

func (r *SOARecord) GetHostName() HostName

func (*SOARecord) GetId

func (r *SOARecord) GetId() RecordId

func (*SOARecord) GetName

func (r *SOARecord) GetName() HostName

func (*SOARecord) GetTTL

func (r *SOARecord) GetTTL() Seconds

func (*SOARecord) GetType

func (r *SOARecord) GetType() RecordType

func (*SOARecord) SetHostName

func (r *SOARecord) SetHostName(name HostName)

func (*SOARecord) SetTTL

func (r *SOARecord) SetTTL(ttl Seconds)

type SRVRecord

type SRVRecord struct {
	Priority Priority
	Weight   uint
	Port     uint
	Target   HostName
	// contains filtered or unexported fields
}

func (*SRVRecord) GetHostName

func (r *SRVRecord) GetHostName() HostName

func (*SRVRecord) GetId

func (r *SRVRecord) GetId() RecordId

func (*SRVRecord) GetName

func (r *SRVRecord) GetName() HostName

func (*SRVRecord) GetTTL

func (r *SRVRecord) GetTTL() Seconds

func (*SRVRecord) GetType

func (r *SRVRecord) GetType() RecordType

func (*SRVRecord) SetHostName

func (r *SRVRecord) SetHostName(name HostName)

func (*SRVRecord) SetTTL

func (r *SRVRecord) SetTTL(ttl Seconds)

type Seconds

type Seconds int64

func (Seconds) Duration

func (s Seconds) Duration() time.Duration

type TXTRecord

type TXTRecord struct {
	Value string
	// contains filtered or unexported fields
}

func (*TXTRecord) GetHostName

func (r *TXTRecord) GetHostName() HostName

func (*TXTRecord) GetId

func (r *TXTRecord) GetId() RecordId

func (*TXTRecord) GetName

func (r *TXTRecord) GetName() HostName

func (*TXTRecord) GetTTL

func (r *TXTRecord) GetTTL() Seconds

func (*TXTRecord) GetType

func (r *TXTRecord) GetType() RecordType

func (*TXTRecord) SetHostName

func (r *TXTRecord) SetHostName(name HostName)

func (*TXTRecord) SetTTL

func (r *TXTRecord) SetTTL(ttl Seconds)

type Zone

type Zone struct {
	SOA   *SOARecord
	NS    []*NSRecord
	A     []*ARecord
	AAAA  []*AAAARecord
	CNAME []*CNAMERecord
	MX    []*MXRecord
	TXT   []*TXTRecord
	SRV   []*SRVRecord
	// contains filtered or unexported fields
}

func (*Zone) AddA

func (z *Zone) AddA(name HostName, addr IPv4, ttl Seconds) (resource *ARecord, err error)

func (*Zone) AddAAAA

func (z *Zone) AddAAAA(name HostName, addr IPv6, ttl Seconds) (resource *AAAARecord, err error)

func (*Zone) AddCNAME

func (z *Zone) AddCNAME(name, to HostName, ttl Seconds) (resource *CNAMERecord, err error)

func (*Zone) AddMX

func (z *Zone) AddMX(name, mailServer HostName, priority Priority, ttl Seconds) (resource *MXRecord, err error)

func (*Zone) AddNS

func (z *Zone) AddNS(name, ns HostName, ttl Seconds) (resource *NSRecord, err error)

func (*Zone) AddResource

func (z *Zone) AddResource(record IRecord) (err error)

func (*Zone) AddSRV

func (z *Zone) AddSRV(name, target HostName, port, weight uint, priority Priority, ttl Seconds) (resource *SRVRecord, err error)

func (*Zone) AddTXT

func (z *Zone) AddTXT(name HostName, value string, ttl Seconds) (resource *TXTRecord, err error)

func (*Zone) DeleteResource

func (z *Zone) DeleteResource(record IRecord) (err error)

func (*Zone) GetId

func (z *Zone) GetId() ZoneId

func (*Zone) UpdateResource

func (z *Zone) UpdateResource(record IRecord) (err error)

type ZoneId

type ZoneId int

func (ZoneId) Int

func (id ZoneId) Int() int

func (ZoneId) String

func (id ZoneId) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL