Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeQuoted ¶ added in v4.7.0
EncodeQuoted encodes a string into a series of quoted 255-octet chunks. That is, when decoded each chunk would be 255-octets with the remainder in the last chunk.
The output looks like:
`""` empty `"255\"octets"` quotes are escaped `"255\\octets"` backslashes are escaped `"255octets" "255octets" "remainder"` long strings are chunked
func ParseQuoted ¶ added in v4.7.0
ParseQuoted parses a string of RFC1035-style quoted items. The resulting items are then joined into one string. This is useful for parsing TXT records. Examples: `foo` => foo `"foo"` => foo `"f\"oo"` => f"oo `"f\\oo"` => f\oo `"foo" "bar"` => foobar `"foo" bar` => foobar
Types ¶
type State ¶ added in v4.7.0
type State int
State denotes the parser state.
const ( // StateStart indicates parser is looking for a non-space StateStart State = iota // StateUnquoted indicates parser is in a run of unquoted text StateUnquoted // StateQuoted indicates parser is in quoted text StateQuoted // StateBackslash indicates the last char was backlash in a quoted string StateBackslash // StateWantSpace indicates parser expects a space (the previous token was a closing quote) StateWantSpace )
Click to show internal directories.
Click to hide internal directories.