Documentation
¶
Index ¶
- Constants
- Variables
- func AddDNSKEY(z ZoneInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator) error
- func AddZONEMDPlaceholder(z ZoneInterface, zonemdRRs []*dns.ZONEMD, generator RRSetGenerator) error
- func CalcZONEMD(z ZoneInterface, zonemd *dns.ZONEMD) (string, error)
- func CompareName(a, b string) (int, error)
- func CompareRR(a, b dns.RR) (int, error)
- func ConvertClassToString(i dns.Class) string
- func ConvertNumberToString[T constraints.Integer](def map[T]string, prefix string, i T) string
- func ConvertStringToClass(s string) (dns.Class, error)
- func ConvertStringToType(s string) (uint16, error)
- func ConvertToStringToNumber[T constraints.Integer](def map[string]T, prefix, s string) (T, error)
- func ConvertTypeToString(i uint16) string
- func CreateDoE(z ZoneInterface, opt SignOption, generator Generator) error
- func CreateOrReplaceRRSetFromRRs(ni NameNodeInterface, rrs []dns.RR, generator Generator) error
- func Equals(a, b string) bool
- func GetAllParentNames(name string, level uint) ([]string, bool)
- func GetRDATA(rr dns.RR) string
- func GetRDATASlice(rrset RRSetInterface) []string
- func GetSOA(z ZoneInterface) (*dns.SOA, error)
- func IsCompleteEqualsRRSet(a, b RRSetInterface) bool
- func IsENT(n NameNodeInterface) bool
- func IsEmptyRRSet(set RRSetInterface) bool
- func IsEqualsAllTree(a, b NameNodeInterface, ttl bool) bool
- func IsEqualsNode(a, b NameNodeInterface, ttl bool) bool
- func IsEqualsRRSet(a, b RRSetInterface) bool
- func IsHostname(name string) bool
- func IterateRRInZone(z ZoneInterface, f func(dns.RR) error) error
- func MakeRR(r RRSetInterface, rdata string) (dns.RR, error)
- func MarshalJSONRRSet(set RRSetInterface) ([]byte, error)
- func RemoveNameNode(n NameNodeInterface, name string) error
- func SetNameNode(n, nn NameNodeInterface, generator NameNodeGenerator) error
- func SetRdata(set RRSetInterface, rdata []string) error
- func Sign(z ZoneInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator) error
- func SignNode(nni NameNodeInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator, ...) error
- func SignRRSet(ri RRSetInterface, opt SignOption, dnskeys []*DNSKEY) ([]*dns.RRSIG, error)
- func SignZone(z ZoneInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator) error
- func SortNames(names []string) error
- func SortRRs(rrs []dns.RR) error
- func SortedIterateNameNode(nni NameNodeInterface, f func(NameNodeInterface) error) error
- func SortedIterateRR(set RRSetInterface, f func(dns.RR) error) error
- func SortedIterateRRset(nni NameNodeInterface, f func(RRSetInterface) error) error
- func SplitLabelsBytes(name string) (rawSlice, error)
- func UpdateZONEMDDigest(z ZoneInterface, generator RRSetGenerator) error
- func VerifyAnyZONEMDDigest(z ZoneInterface) (bool, error)
- func VerifyZONEMDDigest(z ZoneInterface, zonemd *dns.ZONEMD) (bool, error)
- func ZoneNormalize(z ZoneInterface) error
- func ZoneText(z ZoneInterface, w io.Writer) error
- type DNSKEY
- type DefaultGenerator
- type DenialOfExistenceMethod
- type Generator
- type NameNode
- func (n *NameNode) AddChildNameNode(nn NameNodeInterface) error
- func (n *NameNode) CopyChildNodes() map[string]NameNodeInterface
- func (n *NameNode) CopyRRSetMap() map[uint16]RRSetInterface
- func (n *NameNode) GetClass() dns.Class
- func (n *NameNode) GetName() string
- func (n *NameNode) GetNameNode(name string) (node NameNodeInterface, strict bool)
- func (n *NameNode) GetRRSet(rrtype uint16) RRSetInterface
- func (n *NameNode) IterateNameNode(f func(NameNodeInterface) error) error
- func (n *NameNode) IterateNameNodeWithValue(f func(NameNodeInterface, any) (any, error), v any) error
- func (n *NameNode) IterateNameRRSet(f func(RRSetInterface) error) error
- func (n *NameNode) RRSetLen() int
- func (n *NameNode) RemoveChildNameNode(name string) error
- func (n *NameNode) RemoveRRSet(rrtype uint16) error
- func (n *NameNode) SetRRSet(set RRSetInterface) error
- func (n *NameNode) SetValue(nn NameNodeInterface) error
- type NameNodeGenerator
- type NameNodeInterface
- type RRSet
- func (r *RRSet) AddRR(rr dns.RR) error
- func (r *RRSet) Copy() RRSetInterface
- func (r *RRSet) GetClass() dns.Class
- func (r *RRSet) GetName() string
- func (r *RRSet) GetRRs() []dns.RR
- func (r *RRSet) GetRRtype() uint16
- func (r *RRSet) GetTTL() uint32
- func (r *RRSet) Len() int
- func (r *RRSet) MarshalJSON() ([]byte, error)
- func (r *RRSet) RemoveRR(rr dns.RR) error
- func (r *RRSet) SetTTL(ttl uint32) error
- func (r *RRSet) UnmarshalJSON(bs []byte) error
- type RRSetGenerator
- type RRSetInterface
- func GetRRSetOrCreate(n NameNodeInterface, rrtype uint16, ttl uint32, generator RRSetGenerator) (RRSetInterface, error)
- func NewRRSetFromRRWithGenerator(rr dns.RR, generator RRSetGenerator) (RRSetInterface, error)
- func NewRRSetFromRRsWithGenerator(rrs []dns.RR, generator RRSetGenerator) (RRSetInterface, error)
- type SignOption
- func (o *SignOption) GetBeforSign() time.Duration
- func (o *SignOption) GetCDNSKEYEnabled() bool
- func (o *SignOption) GetCDSEnabled() bool
- func (o *SignOption) GetDNSKEYTTL() uint32
- func (o *SignOption) GetExpiration() uint32
- func (o *SignOption) GetExpiry() time.Duration
- func (o *SignOption) GetInception() uint32
- func (o *SignOption) GetNSEC3Iterate() uint16
- func (o *SignOption) GetNSEC3Salt() string
- func (o *SignOption) GetZONEMDEnabled() bool
- type Zone
- func (z *Zone) GetClass() dns.Class
- func (z *Zone) GetGenerator() Generator
- func (z *Zone) GetName() string
- func (z *Zone) GetRootNode() NameNodeInterface
- func (z *Zone) ImportRRs(rrs []dns.RR) error
- func (z *Zone) MarshalJSON() ([]byte, error)
- func (z *Zone) Read(r io.Reader) error
- func (z *Zone) Text(w io.Writer) error
- func (z *Zone) UnmarshalJSON(bs []byte) error
- type ZoneInterface
Constants ¶
const ( DenialOfExistenceMethodNSEC = "NSEC" DenialOfExistenceMethodNSEC3 = "NSEC3" )
Variables ¶
var ( // ErrNotSupport returns when method is not implemented. ErrNotSupport = fmt.Errorf("not support") // ErrNotChangeAble returns by change methods when can not change values. ErrNotChangeAble = fmt.Errorf("not changeable") )
var ( // ErrBadName returns when name is not domain name. ErrBadName = fmt.Errorf("bad name") // ErrNotDirectlyName returns by AddChildNode when arg node is not child name ErrNotDirectlyName = fmt.Errorf("add name's label count must be equals to parent label count +1") // ErrNotInDomain returns when arg node is in-domain. ErrNotInDomain = fmt.Errorf("name is not subdomain") // ErrChildExist returns when already exist arg node's name node. ErrChildExist = fmt.Errorf("child name is exist") // ErrNameNotEqual returns when arg name node's name is not equal. ErrNameNotEqual = fmt.Errorf("name not equals") // ErrClassNotEqual returns when arg name node's class is not equal. ErrClassNotEqual = fmt.Errorf("class not equals") // ErrConflictCNAME returns by SetRRSet when there is more than one SOA RDATA. ErrConflictCNAME = fmt.Errorf("name node can't set both CNAME and other") // ErrConflictDNAME returns by SetRRSet when there is more than one RDATA RDATA. ErrConflictDNAME = fmt.Errorf("name node can't set both DNAME and other") // ErrRemoveItself by RemoveChildNameNode when remove itself. ErrRemoveItself = fmt.Errorf("can not remove itself") )
var ( // ErrTTL returns when rrset's ttl and rr's ttl are not equals. ErrTTLNotEqual = fmt.Errorf("not equals ttl") // ErrRRType returns when rrset's rrtype and rr's rrtype are not equals. ErrRRTypeNotEqual = fmt.Errorf("not equals rrtype") // ErrConflict returns when there is more than one SOA RDATA or CNAME RDATA. ErrConflict = fmt.Errorf("conflict RR") // ErrInvalid returns when class or type is invalid format. ErrInvalid = fmt.Errorf("invalid data") // ErrFormat returns when input invalid format data. ErrFormat = fmt.Errorf("input format error") )
var ( DefaultBeforeSign time.Duration = time.Hour DefaultExpiry time.Duration = time.Hour * 24 * 14 )
var ( // ErrRdata returns when rdata is invalid while parsing RDATA. ErrRdata = dns.ErrRdata // ErrNotTreeBroken returns tree is broken ErrNameTreeBroken = fmt.Errorf("name tree broken") // ErrBadZone ErrBadZone = fmt.Errorf("invalid zone") // Err ErrEmptyRRs = fmt.Errorf("rrs is empty") )
var ( ErrZONEMDUnknownSchema = fmt.Errorf("unknown ZONEMD schema") ErrZONEMDUnknownHash = fmt.Errorf("unknown ZONEMD hash") ErrZONEMDVerifySkip = fmt.Errorf("skip ZONEMD verify") )
var (
ErrCollision = fmt.Errorf("hash collision detected")
)
Functions ¶
func AddDNSKEY ¶ added in v1.12.1
func AddDNSKEY(z ZoneInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator) error
func AddZONEMDPlaceholder ¶ added in v1.14.1
func AddZONEMDPlaceholder(z ZoneInterface, zonemdRRs []*dns.ZONEMD, generator RRSetGenerator) error
Add a ZONEMD placeholder. If there is already a ZONEMD record, delete it.
func CalcZONEMD ¶ added in v1.14.1
func CalcZONEMD(z ZoneInterface, zonemd *dns.ZONEMD) (string, error)
Calculate ZONEMD digst.
func CompareName ¶ added in v1.12.1
The result will be 0 if a == b, -1 if a < b, and +1 if a > b.
func ConvertClassToString ¶ added in v0.4.0
ConvertClassToString returns DNS Class string by dns.Class
func ConvertNumberToString ¶ added in v1.1.0
func ConvertNumberToString[T constraints.Integer](def map[T]string, prefix string, i T) string
func ConvertStringToClass ¶ added in v0.4.0
ConvertStringToClass returns dns.Class by string If it failed to parse, returns ErrInvalid
func ConvertStringToType ¶ added in v0.4.0
ConvertStringToType returns uint16 dns rrtype by string If it failed to parse, returns ErrInvalid
func ConvertToStringToNumber ¶ added in v1.1.0
func ConvertToStringToNumber[T constraints.Integer](def map[string]T, prefix, s string) (T, error)
func ConvertTypeToString ¶ added in v0.4.0
ConvertTypeToString returns RRType string by uint16 dns rrtype.
func CreateDoE ¶ added in v1.12.1
func CreateDoE(z ZoneInterface, opt SignOption, generator Generator) error
func CreateOrReplaceRRSetFromRRs ¶ added in v1.13.0
func CreateOrReplaceRRSetFromRRs(ni NameNodeInterface, rrs []dns.RR, generator Generator) error
func GetAllParentNames ¶ added in v1.6.0
GetAllParentNames returns a name slice containing parent names and itself.
func GetRDATASlice ¶ added in v0.4.0
func GetRDATASlice(rrset RRSetInterface) []string
GetRDATASlice returns RDATA from rrset
func IsCompleteEqualsRRSet ¶ added in v0.2.2
func IsCompleteEqualsRRSet(a, b RRSetInterface) bool
IsCompleteEqualsRRSet check that both rrset equal.
func IsEmptyRRSet ¶
func IsEmptyRRSet(set RRSetInterface) bool
IsEmptyRRSet check that rrset is empty. if rrset is nil, it returns false. if radata is empty, return false. other than that return true.
func IsEqualsAllTree ¶ added in v1.12.1
func IsEqualsAllTree(a, b NameNodeInterface, ttl bool) bool
IsEqualsNode check that both tree equal. However ttl value will be ignored.
func IsEqualsNode ¶ added in v1.12.1
func IsEqualsNode(a, b NameNodeInterface, ttl bool) bool
IsEqualsNode check that both node equal. However ttl value will be ignored.
func IsEqualsRRSet ¶
func IsEqualsRRSet(a, b RRSetInterface) bool
IsEqualsRRSet check that both rrset equal.However ttl value will be ignored.
func IsHostname ¶ added in v0.7.0
IsHostname checks if name is a valid RFC1123 hostname.
func IterateRRInZone ¶ added in v1.14.1
func IterateRRInZone(z ZoneInterface, f func(dns.RR) error) error
func MakeRR ¶
func MakeRR(r RRSetInterface, rdata string) (dns.RR, error)
MakeRR returns dns.RR by RRSet and rdata string
func MarshalJSONRRSet ¶ added in v0.4.0
func MarshalJSONRRSet(set RRSetInterface) ([]byte, error)
MarshalJSONRRset returns json.RawMessage by rrset.
func RemoveNameNode ¶ added in v0.4.0
func RemoveNameNode(n NameNodeInterface, name string) error
RemoveNameNode remove NameNodeInterface from tree.
func SetNameNode ¶ added in v0.4.0
func SetNameNode(n, nn NameNodeInterface, generator NameNodeGenerator) error
SetNameNode adds NameNode into tree. if not exist parent, create ENT NameNodeInterface by newFunc.s if exist same node, it overrides children and rrests.
func SetRdata ¶ added in v0.4.0
func SetRdata(set RRSetInterface, rdata []string) error
SetRdata set rdata into rrset
func Sign ¶ added in v1.14.1
func Sign(z ZoneInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator) error
func SignNode ¶ added in v1.14.1
func SignNode(nni NameNodeInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator, apex, auth bool) error
func SignRRSet ¶ added in v1.12.1
func SignRRSet(ri RRSetInterface, opt SignOption, dnskeys []*DNSKEY) ([]*dns.RRSIG, error)
func SignZone ¶ added in v1.12.1
func SignZone(z ZoneInterface, opt SignOption, dnskeys []*DNSKEY, generator Generator) error
func SortNames ¶ added in v1.12.1
https://datatracker.ietf.org/doc/html/rfc4034#section-6.1 SortNamesFunc returns sorted names
func SortedIterateNameNode ¶ added in v1.14.1
func SortedIterateNameNode(nni NameNodeInterface, f func(NameNodeInterface) error) error
func SortedIterateRR ¶ added in v1.14.1
func SortedIterateRR(set RRSetInterface, f func(dns.RR) error) error
func SortedIterateRRset ¶ added in v1.14.1
func SortedIterateRRset(nni NameNodeInterface, f func(RRSetInterface) error) error
asc
func SplitLabelsBytes ¶ added in v1.12.1
func UpdateZONEMDDigest ¶ added in v1.14.1
func UpdateZONEMDDigest(z ZoneInterface, generator RRSetGenerator) error
func VerifyAnyZONEMDDigest ¶ added in v1.14.1
func VerifyAnyZONEMDDigest(z ZoneInterface) (bool, error)
Verifies the ZONEMD digst. If apex ZONEMD does not exist, return false and ErrZONEMDVerifySkip. If verification succeeds, return true and nil.
func VerifyZONEMDDigest ¶ added in v1.14.1
func VerifyZONEMDDigest(z ZoneInterface, zonemd *dns.ZONEMD) (bool, error)
Verifies the ZONEMD digst. If verification succeeds, return true
func ZoneNormalize ¶ added in v1.12.1
func ZoneNormalize(z ZoneInterface) error
Types ¶
type DefaultGenerator ¶ added in v0.4.0
type DefaultGenerator struct{}
func (DefaultGenerator) NewNameNode ¶ added in v0.4.0
func (DefaultGenerator) NewNameNode(name string, class dns.Class) (NameNodeInterface, error)
func (DefaultGenerator) NewRRSet ¶ added in v0.4.0
func (DefaultGenerator) NewRRSet(name string, ttl uint32, class dns.Class, rrtype uint16) (RRSetInterface, error)
type DenialOfExistenceMethod ¶ added in v1.12.1
type DenialOfExistenceMethod string
type Generator ¶ added in v0.4.0
type Generator interface { NameNodeGenerator RRSetGenerator }
type NameNode ¶
NameNode is implement of NameNodeInterface
func NewNameNode ¶
NewNameNode create NameNode
func (*NameNode) AddChildNameNode ¶ added in v0.4.0
func (n *NameNode) AddChildNameNode(nn NameNodeInterface) error
AddChildNameNode is implement of NameNodeInterface.AddChildNameNode
func (*NameNode) CopyChildNodes ¶
func (n *NameNode) CopyChildNodes() map[string]NameNodeInterface
CopyChildNodes is implement of NameNodeInterface.CopyChildNodes
func (*NameNode) CopyRRSetMap ¶
func (n *NameNode) CopyRRSetMap() map[uint16]RRSetInterface
CopyRRSetMap is implement of NameNodeInterface.CopyRRSetMap
func (*NameNode) GetNameNode ¶
func (n *NameNode) GetNameNode(name string) (node NameNodeInterface, strict bool)
GetNameNode is implement of NameNodeInterface.GetNameNode
func (*NameNode) GetRRSet ¶
func (n *NameNode) GetRRSet(rrtype uint16) RRSetInterface
GetRRSet is implement of NameNodeInterface.GetRRSet
func (*NameNode) IterateNameNode ¶
func (n *NameNode) IterateNameNode(f func(NameNodeInterface) error) error
IterateNameNode is implement of NameNodeInterface.IterateNameNode sort order using SortName (rfc4034#section6-1).
func (*NameNode) IterateNameNodeWithValue ¶ added in v1.12.1
func (n *NameNode) IterateNameNodeWithValue(f func(NameNodeInterface, any) (any, error), v any) error
IterateNameNodeWithValue is implement of NameNodeInterface.IterateNameNodeWithValue sort order using SortName (rfc4034#section6-1).
func (*NameNode) IterateNameRRSet ¶
func (n *NameNode) IterateNameRRSet(f func(RRSetInterface) error) error
IterateNameRRSet is implement of NameNodeInterface.IterateNameRRSet first order is SOA. Other than, sort order by ASC.
func (*NameNode) RemoveChildNameNode ¶ added in v0.4.0
RemoveChildNameNode is implement of NameNodeInterface.RemoveChildNameNode
func (*NameNode) RemoveRRSet ¶
RemoveRRSet is implement of NameNodeInterface.RemoveRRSet
func (*NameNode) SetRRSet ¶
func (n *NameNode) SetRRSet(set RRSetInterface) error
SetRRSet is implement of NameNodeInterface.SetRRSet
func (*NameNode) SetValue ¶
func (n *NameNode) SetValue(nn NameNodeInterface) error
SetValue is implement of NameNodeInterface.SetValue
type NameNodeGenerator ¶ added in v0.4.0
type NameNodeGenerator interface {
NewNameNode(name string, class dns.Class) (NameNodeInterface, error)
}
type NameNodeInterface ¶
type NameNodeInterface interface { // GetName returns canonical name GetName() string // GetName returns class GetClass() dns.Class // GetNameNode returns NameNode by target name // if return value isStrict is true, NameNode is target name NameNode. (strict match) // if isStrict is false and node nos it nil, node is nearly parrent path node. (loose match) // if isStrict is false and node is nil, target name is not in-domain. GetNameNode(target string) (node NameNodeInterface, isStrict bool) // CopyChildNodes returns child name node map // map key is canonical name CopyChildNodes() map[string]NameNodeInterface // CopyRRSetMap returns rrset map // map key is uint16 rrtype CopyRRSetMap() map[uint16]RRSetInterface // GetRRSet returns rrset by rrtype // if not exist rrset return nil GetRRSet(rrtype uint16) RRSetInterface // IterateNameRRSet can iterate function by RRSetInterface // sort oreder is implementation dependent. IterateNameRRSet(func(RRSetInterface) error) error // IterateNameNode can iterate function by NameNodeInterface // sort oreder is implementation dependent. IterateNameNode(func(NameNodeInterface) error) error // IterateNameNode can iterate function by NameNodeInterface // sort oreder is implementation dependent. IterateNameNodeWithValue(f func(NameNodeInterface, any) (any, error), v any) error // AddChildNode adds child node into children. AddChildNameNode(NameNodeInterface) error // RemoveNameNode removed child node. RemoveChildNameNode(name string) error // SetValue override child and rrsetMap SetValue(NameNodeInterface) error // SetRRSet overrides rrset SetRRSet(RRSetInterface) error // RemoveRRSet removes rrset RemoveRRSet(rrtype uint16) error // RRSetLen returns the number of not empty rrset RRSetLen() int }
NameNodeInterface manages node of name tree
func GetNameNodeOrCreate ¶ added in v0.2.2
func GetNameNodeOrCreate(n NameNodeInterface, name string, generator NameNodeGenerator) (NameNodeInterface, error)
GetNameNodeOrCreate returns name node from arg name node. if exist NameNode, returns it. if not exist NameNode, It create new NameNode and return it. but new NameNode is not link to from arg name node. Maybe you can use SetNameNode.
func GetZoneCuts ¶ added in v1.12.1
func GetZoneCuts(rootNode NameNodeInterface) (NameNodeInterface, map[string]struct{}, error)
type RRSet ¶
type RRSet struct {
// contains filtered or unexported fields
}
RRSet is implement of RRSetInterface
func NewRRSet ¶
func NewRRSet(name string, ttl uint32, class dns.Class, rrtype uint16, rrs []dns.RR) (*RRSet, error)
NewRRSet creates RRSet. Returns ErrBadName when name is not domain name
func NewRRSetFromRR ¶
NewRRSetFromRR creates RRSet from dns.RR If rr is nil return nil
func NewRRSetFromRRs ¶ added in v0.2.2
NewRRSetFromRRs creates RRSet from []dns.RR. It creates RRset by first RR using NewRRSetFromRR. 2nd and subsequent RR are add rrset using RRSet.AddRR. If RRSet.AddRR failed, return nil If rrs is nil return nil
func (*RRSet) AddRR ¶
AddRR add resource record rr is must equals al of name,ttl,class and rrtype. if duplicate RDATA, It will be ignored. It returns err when any of name, ttl, class and rrtype not equal. It returns err when rtype is SOA or CNAME, and it number is multiple.
func (*RRSet) MarshalJSON ¶ added in v0.4.0
MarshalJSON returns json.RawMessage.
func (*RRSet) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON reads rrset data from json.RawMessage.
type RRSetGenerator ¶ added in v0.4.0
type RRSetInterface ¶
type RRSetInterface interface { // GetName returns canonical name GetName() string // GetRRtype returns rrtype GetRRtype() uint16 // GetClass returns dns.Class GetClass() dns.Class // GetTTL returns rtype GetTTL() uint32 // SetTTL sets ttl SetTTL(uint32) error // GetRRs returns rr slice GetRRs() []dns.RR // Len returns number of rdata Len() int // AddRR adds dns.RR AddRR(dns.RR) error // RemoveRR removes dns.RR RemoveRR(dns.RR) error // Copy returns a copy Copy() RRSetInterface }
RRSetInterface manages rrset
func GetRRSetOrCreate ¶
func GetRRSetOrCreate(n NameNodeInterface, rrtype uint16, ttl uint32, generator RRSetGenerator) (RRSetInterface, error)
GetRRSetOrCreate returns rrset from name node. if exist rrset, returns it. if not exist rrset, It create new rrset and return it. but new rrset is not link to NameNode. Maybe you can use SetRRSet.
func NewRRSetFromRRWithGenerator ¶ added in v1.13.0
func NewRRSetFromRRWithGenerator(rr dns.RR, generator RRSetGenerator) (RRSetInterface, error)
func NewRRSetFromRRsWithGenerator ¶ added in v1.13.0
func NewRRSetFromRRsWithGenerator(rrs []dns.RR, generator RRSetGenerator) (RRSetInterface, error)
type SignOption ¶ added in v1.12.1
type SignOption struct { BeforeSign *time.Duration Expiry *time.Duration Inception *uint32 Expiration *uint32 DoEMethod DenialOfExistenceMethod NSEC3Salt string NSEC3Iterate uint16 DNSKEYTTL *uint32 ZONEMDEnabled *bool CDSEnabled *bool CDNSKEYEnabled *bool }
func (*SignOption) GetBeforSign ¶ added in v1.12.1
func (o *SignOption) GetBeforSign() time.Duration
func (*SignOption) GetCDNSKEYEnabled ¶ added in v1.15.0
func (o *SignOption) GetCDNSKEYEnabled() bool
func (*SignOption) GetCDSEnabled ¶ added in v1.15.0
func (o *SignOption) GetCDSEnabled() bool
func (*SignOption) GetDNSKEYTTL ¶ added in v1.15.0
func (o *SignOption) GetDNSKEYTTL() uint32
func (*SignOption) GetExpiration ¶ added in v1.12.1
func (o *SignOption) GetExpiration() uint32
func (*SignOption) GetExpiry ¶ added in v1.12.1
func (o *SignOption) GetExpiry() time.Duration
func (*SignOption) GetInception ¶ added in v1.12.1
func (o *SignOption) GetInception() uint32
func (*SignOption) GetNSEC3Iterate ¶ added in v1.13.0
func (o *SignOption) GetNSEC3Iterate() uint16
func (*SignOption) GetNSEC3Salt ¶ added in v1.13.0
func (o *SignOption) GetNSEC3Salt() string
func (*SignOption) GetZONEMDEnabled ¶ added in v1.15.0
func (o *SignOption) GetZONEMDEnabled() bool
type Zone ¶
type Zone struct {
// contains filtered or unexported fields
}
Zone is implement of ZoneInterface
func (*Zone) GetGenerator ¶ added in v0.4.0
GetGenerator returns Generator
func (*Zone) GetRootNode ¶
func (z *Zone) GetRootNode() NameNodeInterface
GetRootNode returns zone apex NameNode If zone is not created by NewZone, maybe it returns nil
func (*Zone) MarshalJSON ¶ added in v0.4.0
MarshalJSON returns json.RawMessage.
func (*Zone) Read ¶
Read reads zone data from zonefile (RFC1035) It overrides zone's name and class when root node not exist.
func (*Zone) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON reads zone data from json.RawMessage. It override zone's name and class when root node not exist.
type ZoneInterface ¶
type ZoneInterface interface { // return canonical zone name GetName() string GetRootNode() NameNodeInterface GetClass() dns.Class }
ZoneInterface manages zone root node