Versions in this module Expand all Collapse all v0 v0.2.0 Oct 8, 2026 Changes in this version + func CompareNames(a, b string) int v0.1.0 Oct 2, 2026 Changes in this version + const InactivityTimeoutDefault + const InactivityTimeoutNever + const KeepAliveIntervalDefault + const KeepAliveIntervalMin + const KeepAliveIntervalNever + const KeepAliveIntervalRecommended + const KeepAliveLen + const LengthPrefixLen + const MaxMsgLen + const MaxPushMsgLen + const MsgHeaderLen + const PushDomain + const PushTTLAddMax + const PushTTLAddMin + const PushTTLCollectiveRemove + const PushTTLRemove + const RetryDelayLen + const TLSBlockLen + const TLVHeaderLen + const TypeEncryptionPadding + const TypeKeepAlive + const TypePush + const TypeReconfirm + const TypeRetryDelay + const TypeSubscribe + const TypeUnsubscribe + const UnsubscribeLen + var ErrBufferFull = fmt.Errorf("dsomessage.Builder: short buffer") + var ErrDone = fmt.Errorf("dsomessage.Parser: done") + var ErrFormat = fmt.Errorf("dsomessage: bad message format") + var ErrHeader = fmt.Errorf("%w - bad header", ErrFormat) + var ErrShortWrite = fmt.Errorf("dsomessage.Builder: short write") + var ErrTLV = fmt.Errorf("%w - bad TLV", ErrFormat) + var ErrTooLong = fmt.Errorf("dsomessage.Builder: msg too long") + func PaddedMsgLen(msgLen int, blockLen uint16) int + func RRLen(rr dns.RR) (l int) + type Builder struct + func NewBuilder(buf []byte) *Builder + func (b *Builder) Available() int + func (b *Builder) Cap() int + func (b *Builder) Clear() *Builder + func (b *Builder) EnableCompression() *Builder + func (b *Builder) EnableLengthPrefix() *Builder + func (b *Builder) EnablePadding(blockLen uint16) *Builder + func (b *Builder) Err() error + func (b *Builder) Grow(n int) *Builder + func (b *Builder) Len() int + func (b *Builder) Message() ([]byte, error) + func (b *Builder) Reset() *Builder + func (b *Builder) SetHeader(h MsgHeader) *Builder + func (b *Builder) Write(p []byte) (n int, err error) + func (b *Builder) WriteEncryptionPadding(tlv *EncryptionPadding) (int, error) + func (b *Builder) WriteKeepAlive(tlv *KeepAlive) (int, error) + func (b *Builder) WritePush(tlv *Push) (int, error) + func (b *Builder) WritePushChange(change []dns.RR) (n int, err error) + func (b *Builder) WriteReconfirm(tlv *Reconfirm) (int, error) + func (b *Builder) WriteRetryDelay(tlv *RetryDelay) (int, error) + func (b *Builder) WriteSubscribe(tlv *Subscribe) (int, error) + func (b *Builder) WriteTLV(tlv TLV) (int, error) + func (b *Builder) WriteTo(w io.Writer) (int64, error) + func (b *Builder) WriteUnsubscribe(tlv *Unsubscribe) (int, error) + type EncryptionPadding struct + Padding uint16 + func (tlv *EncryptionPadding) AppendBinary(b []byte) (b1 []byte, err error) + func (tlv *EncryptionPadding) Clone() TLV + func (tlv *EncryptionPadding) Equal(tlv1 TLV) bool + func (tlv *EncryptionPadding) MarshalBinary() ([]byte, error) + func (tlv *EncryptionPadding) UnmarshalBinary(data []byte) error + func (tlv *EncryptionPadding) Verify(usage Usage) error + func (tlv EncryptionPadding) Len() int + func (tlv EncryptionPadding) String() string + func (tlv EncryptionPadding) Type() Type + type KeepAlive struct + InactivityTimeout uint32 + KeepAliveInterval uint32 + func (tlv *KeepAlive) AppendBinary(b []byte) (b1 []byte, err error) + func (tlv *KeepAlive) Clone() TLV + func (tlv *KeepAlive) Equal(tlv1 TLV) bool + func (tlv *KeepAlive) MarshalBinary() ([]byte, error) + func (tlv *KeepAlive) UnmarshalBinary(data []byte) error + func (tlv *KeepAlive) Verify(usage Usage) error + func (tlv KeepAlive) Len() int + func (tlv KeepAlive) String() string + func (tlv KeepAlive) Type() Type + type Msg struct + Origin Origin + TLV []TLV + func NewErrorMsg(id uint16, rcode uint8, tlvs ...TLV) (m *Msg) + func NewRepMsg(id uint16, tlvs ...TLV) *Msg + func NewReqMsg(id uint16, tlvs ...TLV) *Msg + func NewUniMsg(tlvs ...TLV) *Msg + func UnpackMsg(buf []byte, origin Origin) (m *Msg, err error) + func (m *Msg) AppendBinary(b []byte) ([]byte, error) + func (m *Msg) Clone() (m1 *Msg) + func (m *Msg) Equal(m1 *Msg) bool + func (m *Msg) Len() (n int) + func (m *Msg) MarshalBinary() ([]byte, error) + func (m *Msg) Pack() (msg []byte, err error) + func (m *Msg) PackTo(b *Builder) + func (m *Msg) UnmarshalBinary(data []byte) error + func (m *Msg) Verify(request *Msg) (err error) + type MsgHeader struct + ID uint16 + Rcode uint8 + Response bool + func (h *MsgHeader) UnmarshalBinary(data []byte) (err error) + func (h MsgHeader) AppendBinary(b []byte) ([]byte, error) + func (h MsgHeader) IsRequest() bool + func (h MsgHeader) IsResponse() bool + func (h MsgHeader) IsUnidirectional() bool + func (h MsgHeader) MarshalBinary() (data []byte, err error) + func (h MsgHeader) Verify() error + type Origin uint16 + const OriginClient + const OriginInvalid + const OriginServer + func (o Origin) Remote() Origin + type PackingError struct + Index int + Offset int + func (e *PackingError) Error() string + func (e *PackingError) Unwrap() error + type Parser struct + func (p *Parser) EncryptionPadding() (tlv EncryptionPadding, err error) + func (p *Parser) IsPadded() bool + func (p *Parser) KeepAlive() (tlv KeepAlive, err error) + func (p *Parser) Push() (tlv Push, err error) + func (p *Parser) Reconfirm() (tlv Reconfirm, err error) + func (p *Parser) RetryDelay() (tlv RetryDelay, err error) + func (p *Parser) SetResponseType(t Type) + func (p *Parser) SkipTLV() (err error) + func (p *Parser) Start(msg []byte, origin Origin) (MsgHeader, error) + func (p *Parser) Subscribe() (tlv Subscribe, err error) + func (p *Parser) TLV() (TLV, error) + func (p *Parser) TLVHeader() (h TLVHeader, err error) + func (p *Parser) TLVUsage() (u Usage) + func (p *Parser) Unsubscribe() (tlv Unsubscribe, err error) + type Push struct + Change []dns.RR + func (tlv *Push) AppendBinary(b []byte) (b1 []byte, err error) + func (tlv *Push) Clone() TLV + func (tlv *Push) Equal(tlv1 TLV) bool + func (tlv *Push) Len() (l int) + func (tlv *Push) MarshalBinary() ([]byte, error) + func (tlv *Push) UnmarshalBinary(data []byte) error + func (tlv *Push) Verify(usage Usage) error + func (tlv Push) String() string + func (tlv Push) Type() Type + type Reconfirm struct + RR dns.RR + func (tlv *Reconfirm) AppendBinary(b []byte) (b1 []byte, err error) + func (tlv *Reconfirm) Clone() TLV + func (tlv *Reconfirm) Equal(tlv1 TLV) bool + func (tlv *Reconfirm) Len() int + func (tlv *Reconfirm) MarshalBinary() ([]byte, error) + func (tlv *Reconfirm) UnmarshalBinary(data []byte) error + func (tlv *Reconfirm) Verify(usage Usage) error + func (tlv Reconfirm) String() string + func (tlv Reconfirm) Type() Type + type RetryDelay struct + RetryDelay uint32 + func (tlv *RetryDelay) AppendBinary(b []byte) (b1 []byte, err error) + func (tlv *RetryDelay) Clone() TLV + func (tlv *RetryDelay) Equal(tlv1 TLV) bool + func (tlv *RetryDelay) MarshalBinary() ([]byte, error) + func (tlv *RetryDelay) UnmarshalBinary(data []byte) error + func (tlv *RetryDelay) Verify(usage Usage) error + func (tlv RetryDelay) Len() int + func (tlv RetryDelay) String() string + func (tlv RetryDelay) Type() Type + type Subscribe struct + Class uint16 + Name string + RRType uint16 + func (tlv *Subscribe) AppendBinary(b []byte) (b1 []byte, err error) + func (tlv *Subscribe) Clone() TLV + func (tlv *Subscribe) Equal(tlv1 TLV) bool + func (tlv *Subscribe) Len() int + func (tlv *Subscribe) MarshalBinary() ([]byte, error) + func (tlv *Subscribe) UnmarshalBinary(data []byte) error + func (tlv *Subscribe) Verify(usage Usage) error + func (tlv Subscribe) String() string + func (tlv Subscribe) Type() Type + type TLV interface + Clone func() TLV + Equal func(tlv TLV) bool + Len func() int + String func() string + Type func() Type + Verify func(usage Usage) error + type TLVHeader struct + Length uint16 + Type Type + func (h *TLVHeader) UnmarshalBinary(data []byte) error + func (h TLVHeader) AppendBinary(b []byte) ([]byte, error) + func (h TLVHeader) MarshalBinary() (data []byte, err error) + type Type uint16 + func (t Type) String() string + type UnpackingError struct + Offset int + func (e *UnpackingError) Error() string + func (e *UnpackingError) Unwrap() error + type Unsubscribe struct + SubscribeID uint16 + func (tlv *Unsubscribe) AppendBinary(b []byte) (b1 []byte, err error) + func (tlv *Unsubscribe) Clone() TLV + func (tlv *Unsubscribe) Equal(tlv1 TLV) bool + func (tlv *Unsubscribe) MarshalBinary() ([]byte, error) + func (tlv *Unsubscribe) UnmarshalBinary(data []byte) error + func (tlv *Unsubscribe) Verify(usage Usage) error + func (tlv Unsubscribe) Len() int + func (tlv Unsubscribe) String() (s string) + func (tlv Unsubscribe) Type() Type + type Usage uint16 + const UsageAdditional + const UsageCA + const UsageCP + const UsageCRA + const UsageCRP + const UsageCU + const UsageEncryptionPadding + const UsageFromClient + const UsageFromServer + const UsageInvalid + const UsageKeepAlive + const UsagePrimary + const UsagePush + const UsageReconfirm + const UsageRetryDelay + const UsageSA + const UsageSP + const UsageSRA + const UsageSRP + const UsageSU + const UsageSubscribe + const UsageUnsubscribe + func (u Usage) Origin() Origin