package httpsfv
Import Path
golang.org/x/net/internal/httpsfv (on go.dev)
Dependency Relation
imports 5 packages, and imported by one package
Involved Source Files
Package httpsfv provides functionality for dealing with HTTP Structured
Field Values.
Package-Level Functions (total 13)
ParseBareInnerList parses a bare inner list from a given HTTP Structured
Field Values.
We define a bare inner list as an inner list
(https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-inner-list),
without the top-most parameter of the inner list. For example, given the
inner list `(a;b c;d);e`, the bare inner list would be `(a;b c;d)`.
Given an HTTP SFV string that represents a bare inner list, it will call the
given function using each of the bare item and parameter within the bare
inner list. This allows the caller to extract information out of the bare
inner list.
This function will return once it encounters the end of the bare inner list,
or something that is not a bare inner list. If it cannot consume the entire
given string, the ok value returned will be false.
ParseBoolean parses a boolean from a given HTTP Structured Field Values.
The entire HTTP SFV string must consist of a valid boolean. It returns the
parsed boolean and an ok boolean value, indicating success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-boolean.
ParseByteSequence parses a byte sequence from a given HTTP Structured Field
Values.
The entire HTTP SFV string must consist of a valid byte sequence. It returns
the parsed byte sequence and an ok boolean value, indicating success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-byte-sequence.
ParseDate parses a date from a given HTTP Structured Field Values.
The entire HTTP SFV string must consist of a valid date. It returns the
parsed date and an ok boolean value, indicating success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-date.
ParseDecimal parses a decimal from a given HTTP Structured Field Values.
The entire HTTP SFV string must consist of a valid decimal. It returns the
parsed decimal and an ok boolean value, indicating success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-integer-or-decim.
ParseDictionary parses a dictionary from a given HTTP Structured Field
Values.
Given an HTTP SFV string that represents a dictionary, it will call the
given function using each of the keys, values, and parameters contained in
the dictionary. This allows the caller to extract information out of the
dictionary.
This function will return once it encounters the end of the string, or
something that is not a dictionary. If it cannot consume the entire given
string, the ok value returned will be false.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-dictionary.
ParseDisplayString parses a display string from a given HTTP Structured
Field Values.
The entire HTTP SFV string must consist of a valid display string. It
returns the parsed display string and an ok boolean value, indicating
success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-display-string.
ParseInteger parses an integer from a given HTTP Structured Field Values.
The entire HTTP SFV string must consist of a valid integer. It returns the
parsed integer and an ok boolean value, indicating success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-integer-or-decim.
ParseItem parses an item from a given HTTP Structured Field Values.
Given an HTTP SFV string that represents an item, it will call the given
function once, with the bare item and the parameter of the item. This allows
the caller to extract information out of the item.
This function will return once it encounters the end of the string, or
something that is not an item. If it cannot consume the entire given
string, the ok value returned will be false.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-item.
ParseList parses a list from a given HTTP Structured Field Values.
Given an HTTP SFV string that represents a list, it will call the given
function using each of the members and parameters contained in the list.
This allows the caller to extract information out of the list.
This function will return once it encounters the end of the string, or
something that is not a list. If it cannot consume the entire given
string, the ok value returned will be false.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-list.
ParseParameter parses a parameter from a given HTTP Structured Field Values.
Given an HTTP SFV string that represents a parameter, it will call the given
function using each of the keys and values contained in the parameter. This
allows the caller to extract information out of the parameter.
This function will return once it encounters the end of the string, or
something that is not a parameter. If it cannot consume the entire given
string, the ok value returned will be false.
https://www.rfc-editor.org/rfc/rfc9651.html#parse-param.
ParseString parses a Go string from a given HTTP Structured Field Values.
The entire HTTP SFV string must consist of a valid string. It returns the
parsed string and an ok boolean value, indicating success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-string.
ParseToken parses a token from a given HTTP Structured Field Values.
The entire HTTP SFV string must consist of a valid token. It returns the
parsed token and an ok boolean value, indicating success or not.
https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-token
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |