Versions in this module Expand all Collapse all v1 v1.0.0 Mar 26, 2023 v0 v0.9.0 Mar 25, 2023 Changes in this version + var ErrNotStarted = errors.New("parsing/packing of this type isn't available yet") + var ErrSectionDone = errors.New("parsing/packing of this section has completed") + type AAAAResource struct + AAAA [16]byte + func (r *AAAAResource) GoString() string + type AResource struct + A [4]byte + func (r *AResource) GoString() string + type Builder struct + func NewBuilder(buf []byte, h Header) Builder + func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error + func (b *Builder) AResource(h ResourceHeader, r AResource) error + func (b *Builder) CNAMEResource(h ResourceHeader, r CNAMEResource) error + func (b *Builder) EnableCompression() + func (b *Builder) Finish() ([]byte, error) + func (b *Builder) MXResource(h ResourceHeader, r MXResource) error + func (b *Builder) NSResource(h ResourceHeader, r NSResource) error + func (b *Builder) OPTResource(h ResourceHeader, r OPTResource) error + func (b *Builder) PTRResource(h ResourceHeader, r PTRResource) error + func (b *Builder) Question(q Question) error + func (b *Builder) SOAResource(h ResourceHeader, r SOAResource) error + func (b *Builder) SRVResource(h ResourceHeader, r SRVResource) error + func (b *Builder) StartAdditionals() error + func (b *Builder) StartAnswers() error + func (b *Builder) StartAuthorities() error + func (b *Builder) StartQuestions() error + func (b *Builder) TXTResource(h ResourceHeader, r TXTResource) error + func (b *Builder) UnknownResource(h ResourceHeader, r UnknownResource) error + type CNAMEResource struct + CNAME Name + func (r *CNAMEResource) GoString() string + type Class uint16 + const ClassANY + const ClassCHAOS + const ClassCSNET + const ClassHESIOD + const ClassINET + func (c Class) GoString() string + func (c Class) String() string + type Header struct + AuthenticData bool + Authoritative bool + CheckingDisabled bool + ID uint16 + OpCode OpCode + RCode RCode + RecursionAvailable bool + RecursionDesired bool + Response bool + Truncated bool + func (m *Header) GoString() string + type MXResource struct + MX Name + Pref uint16 + func (r *MXResource) GoString() string + type Message struct + Additionals []Resource + Answers []Resource + Authorities []Resource + Questions []Question + func (m *Message) AppendPack(b []byte) ([]byte, error) + func (m *Message) GoString() string + func (m *Message) Pack() ([]byte, error) + func (m *Message) Unpack(msg []byte) error + type NSResource struct + NS Name + func (r *NSResource) GoString() string + type Name struct + Data [nameLen]byte + Length uint8 + func MustNewName(name string) Name + func NewName(name string) (Name, error) + func (n *Name) GoString() string + func (n Name) String() string + type OPTResource struct + Options []Option + func (r *OPTResource) GoString() string + type OpCode uint16 + func (o OpCode) GoString() string + type Option struct + Code uint16 + Data []byte + func (o *Option) GoString() string + type PTRResource struct + PTR Name + func (r *PTRResource) GoString() string + type Parser struct + func (p *Parser) AAAAResource() (AAAAResource, error) + func (p *Parser) AResource() (AResource, error) + func (p *Parser) Additional() (Resource, error) + func (p *Parser) AdditionalHeader() (ResourceHeader, error) + func (p *Parser) AllAdditionals() ([]Resource, error) + func (p *Parser) AllAnswers() ([]Resource, error) + func (p *Parser) AllAuthorities() ([]Resource, error) + func (p *Parser) AllQuestions() ([]Question, error) + func (p *Parser) Answer() (Resource, error) + func (p *Parser) AnswerHeader() (ResourceHeader, error) + func (p *Parser) Authority() (Resource, error) + func (p *Parser) AuthorityHeader() (ResourceHeader, error) + func (p *Parser) CNAMEResource() (CNAMEResource, error) + func (p *Parser) MXResource() (MXResource, error) + func (p *Parser) NSResource() (NSResource, error) + func (p *Parser) OPTResource() (OPTResource, error) + func (p *Parser) PTRResource() (PTRResource, error) + func (p *Parser) Question() (Question, error) + func (p *Parser) SOAResource() (SOAResource, error) + func (p *Parser) SRVResource() (SRVResource, error) + func (p *Parser) SkipAdditional() error + func (p *Parser) SkipAllAdditionals() error + func (p *Parser) SkipAllAnswers() error + func (p *Parser) SkipAllAuthorities() error + func (p *Parser) SkipAllQuestions() error + func (p *Parser) SkipAnswer() error + func (p *Parser) SkipAuthority() error + func (p *Parser) SkipQuestion() error + func (p *Parser) Start(msg []byte) (Header, error) + func (p *Parser) TXTResource() (TXTResource, error) + func (p *Parser) UnknownResource() (UnknownResource, error) + type Question struct + Class Class + Name Name + Type Type + func (q *Question) GoString() string + type RCode uint16 + const RCodeFormatError + const RCodeNameError + const RCodeNotImplemented + const RCodeRefused + const RCodeServerFailure + const RCodeSuccess + func (r RCode) GoString() string + func (r RCode) String() string + type Resource struct + Body ResourceBody + Header ResourceHeader + func (r *Resource) GoString() string + type ResourceBody interface + GoString func() string + type ResourceHeader struct + Class Class + Length uint16 + Name Name + TTL uint32 + Type Type + func (h *ResourceHeader) DNSSECAllowed() bool + func (h *ResourceHeader) ExtendedRCode(rcode RCode) RCode + func (h *ResourceHeader) GoString() string + func (h *ResourceHeader) SetEDNS0(udpPayloadLen int, extRCode RCode, dnssecOK bool) error + type SOAResource struct + Expire uint32 + MBox Name + MinTTL uint32 + NS Name + Refresh uint32 + Retry uint32 + Serial uint32 + func (r *SOAResource) GoString() string + type SRVResource struct + Port uint16 + Priority uint16 + Target Name + Weight uint16 + func (r *SRVResource) GoString() string + type TXTResource struct + TXT []string + func (r *TXTResource) GoString() string + type Type uint16 + const TypeA + const TypeAAAA + const TypeALL + const TypeAXFR + const TypeCNAME + const TypeHINFO + const TypeMINFO + const TypeMX + const TypeNS + const TypeOPT + const TypePTR + const TypeSOA + const TypeSRV + const TypeTXT + const TypeWKS + func (t Type) GoString() string + func (t Type) String() string + type UnknownResource struct + Data []byte + Type Type + func (r *UnknownResource) GoString() string