rfc1035label

package
Version: v0.0.0-...-7803ee8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL