package rfc1035label
import "github.com/insomniacslk/dhcp/rfc1035label"
Index ¶
Variables ¶
ErrBufferTooShort is returned when the label cannot be parsed due to a wrong length or missing bytes.
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 ¶
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 ¶
FromBytes reads labels from a bytes stream according to RFC 1035.
func (*Labels) Length ¶
Length returns the length in bytes of the serialized labels
func (*Labels) String ¶
String prints labels.
func (*Labels) ToBytes ¶
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 ¶
- Version
- v0.0.0-20250109001534-8abf58130905 (latest)
- Published
- Jan 9, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 months ago –
Tools for package owners.