rfc1035label

package
v0.0.0-...-99f0e32 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBufferTooShort = errors.New("rfc1035label: buffer too short")

ErrBufferTooShort is returned when the label cannot be parsed due to a wrong length or missing bytes.

Functions

This section is empty.

Types

type Labels

type Labels struct {

	// Labels contains the parsed labels. A change here invalidates the
	// `original` object.
	Labels []string
	// contains filtered or unexported fields
}

Labels represents RFC1035 labels

This implements RFC 1035 labels, including compression. https://tools.ietf.org/html/rfc1035#section-4.1.4

func FromBytes

func FromBytes(data []byte) (*Labels, error)

FromBytes returns a Labels object from the given byte sequence, or an error if any.

func NewLabels

func NewLabels() *Labels

NewLabels returns an initialized Labels object.

func (*Labels) FromBytes

func (l *Labels) FromBytes(data []byte) error

FromBytes reads labels from a bytes stream according to RFC 1035.

func (*Labels) Length

func (l *Labels) Length() int

Length returns the length in bytes of the serialized labels

func (*Labels) String

func (l *Labels) String() string

String prints labels.

func (*Labels) ToBytes

func (l *Labels) ToBytes() []byte

ToBytes returns a byte sequence representing the labels. If the original sequence is modified, the labels are parsed again, otherwise the original byte sequence is returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL