# README
httpsfv: Structured Field Values for HTTP in Go
This Go (golang) library implements parsing and serialization for Structured Field Values for HTTP (RFC 8941).
Features
- Fully implementing the RFC
- Compliant with the official test suite
- Unit and fuzz tested
- Strongly-typed
- Fast (see the benchmark)
- No dependencies
Docs
Browse the documentation on Go.dev.
Credits
Created by Kévin Dunglas. Sponsored by Les-Tilleuls.coop.
# Functions
Marshal returns the HTTP Structured Value serialization of v as defined in https://httpwg.org/specs/rfc8941.html#text-serialize.
NewDictionary creates a new ordered map.
NewItem returns a new Item.
NewParams creates a new ordered map.
UnmarshalDictionary parses a dictionary as defined in https://httpwg.org/specs/rfc8941.html#parse-dictionary.
UnmarshalItem parses an item as defined in https://httpwg.org/specs/rfc8941.html#parse-item.
UnmarshalList parses a list as defined in https://httpwg.org/specs/rfc8941.html#parse-list.
# Variables
ErrInvalidBareItem is returned when a bare item is invalid.
ErrInvalidBinaryFormat is returned when the binary format is invalid.
ErrInvalidBooleanFormat is returned when a boolean format is invalid.
ErrInvalidDecimal is returned when a decimal is invalid.
ErrInvalidDecimalFormat is returned when the decimal format is invalid.
ErrInvalidDictionaryFormat is returned when a dictionary value is invalid.
ErrInvalidInnerListFormat is returned when an inner list format is invalid.
ErrInvalidKeyFormat is returned when the format of a parameter or dictionary key is invalid.
ErrInvalidListFormat is returned when the format of a list is invalid.
ErrInvalidParameterFormat is returned when the format of a parameter is invalid.
ErrInvalidParameterValue is returned when a parameter key is invalid.
ErrInvalidStringFormat is returned when a string format is invalid.
ErrInvalidTokenFormat is returned when a token format is invalid.
ErrMissingParameters is returned when the Params structure is missing from the element.
ErrNotDigit is returned when a character should be a digit but isn't.
ErrNumberOutOfRange is returned when the number is too large according to the specification.
ErrUnexpectedEndOfString is returned when the end of string is unexpected.
ErrUnrecognizedCharacter is returned when an unrecognized character in encountered.
# Structs
Dictionary is an ordered map of name-value pairs.
InnerList represents an inner list as defined in https://httpwg.org/specs/rfc8941.html#inner-list.
Item is a bare value and associated parameters.
Params are an ordered map of key-value pairs that are associated with an item or an inner list.
UnmarshalError contains the underlying parsing error and the position at which it occurred.
# Interfaces
Member is a marker interface for members of dictionaries and lists.
StructuredFieldValue represents a List, a Dictionary or an Item.