Documentation
¶
Index ¶
- Constants
- func CreateCacheDir(cacheRootDir string) error
- type CacheFile
- type Entry
- type NameSrvInfo
- type Request
- func (zcr *Request) Domain() string
- func (zcr *Request) Equal(other *Request) bool
- func (zcr *Request) Exceptions() tools.Exceptions
- func (zcr *Request) RequestTopic() RequestTopic
- func (zcr *Request) Result() (*Entry, *errors.ErrorStack)
- func (zcr *Request) ResultWithSpecificTimeout(dur time.Duration) (*Entry, *errors.ErrorStack)
- func (zcr *Request) SetResult(res *Entry, err *errors.ErrorStack)
- type RequestTopic
Constants ¶
const CACHE_DIRNAME = "zonecut"
CACHE_DIRNAME is the name of the directory under the cache root directory for storage of zone cut cache files
Variables ¶
This section is empty.
Functions ¶
func CreateCacheDir ¶
CreateCacheDir creates the cache dir for storage of zone cut cache files. It may return an error if the directory cannot be created. If the directory already exists, this function does nothing.
Types ¶
type CacheFile ¶
type CacheFile struct {
// contains filtered or unexported fields
}
CacheFile represents just that.
func NewCacheFile ¶
func NewCacheFile(cacheRootDir string, topic RequestTopic) *CacheFile
NewCacheFile initializes a new CacheFile struct, based on the cache root dir, and the name of the domain that is the subject of this cache file.
func NewExistingCacheFile ¶
func NewExistingCacheFile(cacheRootDir string, topic RequestTopic) (*CacheFile, error)
NewCacheFile initializes a new CacheFile struct and ensures that this file exists or else returns an error.
func (*CacheFile) Result ¶
func (cf *CacheFile) Result() (entry *Entry, resultError *errors.ErrorStack, err error)
Result returns the entry or the error that were stored in the cache file. An error may also be returned, if an
incident happens during retrieval/interpretation of the cache file.
entry is the entry that was stored in the cache file.
resultError is the resolution error that was stored in the cache file.
err is the error that may happen during retrieval of the value in the cache file.
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry contains the response to a zonecut request when no error occurred. It contains information about the delegation of a zone,
func NewEntry ¶
func NewEntry(domain string, DNSSECEnabled bool, nameServers []*NameSrvInfo) *Entry
NewEntry builds a new entry, and performs some normalization on the input values.
func (*Entry) MarshalJSON ¶
func (*Entry) NameServers ¶
func (e *Entry) NameServers() []*NameSrvInfo
func (*Entry) SetDNSSEC ¶
SetDNSSEC allows modification of the DNSSEC status relative to that entry, if need be afterwards
func (*Entry) UnmarshalJSON ¶
type NameSrvInfo ¶
type NameSrvInfo struct {
// contains filtered or unexported fields
}
func NewNameSrv ¶
func NewNameSrv(name string, addrs []net.IP) *NameSrvInfo
func (*NameSrvInfo) Addrs ¶
func (n *NameSrvInfo) Addrs() []net.IP
func (*NameSrvInfo) MarshalJSON ¶
func (n *NameSrvInfo) MarshalJSON() ([]byte, error)
func (*NameSrvInfo) Name ¶
func (n *NameSrvInfo) Name() string
func (*NameSrvInfo) UnmarshalJSON ¶
func (n *NameSrvInfo) UnmarshalJSON(bstr []byte) error
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request contains the elements of a request for a delegation information
func NewRequest ¶
func NewRequest(name string, exceptions tools.Exceptions) *Request
NewRequest builds a new request instance
func (*Request) Exceptions ¶
func (zcr *Request) Exceptions() tools.Exceptions
func (*Request) RequestTopic ¶
func (zcr *Request) RequestTopic() RequestTopic
func (*Request) Result ¶
func (zcr *Request) Result() (*Entry, *errors.ErrorStack)
Result returns the result of this request. It blocks for the default timeout duration or until an answer is provided. An error is returned upon timeout or if an incident occurred during the discovery of the delegation information. The entry might value nil even if error is nil too, if the request topic is not a zone apex.
func (*Request) ResultWithSpecificTimeout ¶
ResultWithSpecificTimeout is identical to Result except a timeout duration may be specified.
type RequestTopic ¶
type RequestTopic struct { // domain is the topic of the request: the name whose delegation info is sought. Domain string // exceptions is the list of exceptions we are willing to make for this request w.r.t to the DNS standard Exceptions tools.Exceptions }