v0.0.0-...-2aa077c Latest Latest

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

Go to latest
Published: Feb 9, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


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