Source File
encode.go
Belonging Package
github.com/dunglas/httpsfv
// Package httpsfv implements serializing and parsing// of Structured Field Values for HTTP as defined in RFC 9651.//// Structured Field Values are either lists, dictionaries or items. Dedicated types are provided for all of them.// Dedicated types are also used for tokens, parameters and inner lists.// Other values are stored in native types://// int64, for integers// float64, for decimals// string, for strings// byte[], for byte sequences// bool, for booleans//// The specification is available at https://httpwg.org/specs/rfc9651.html.package httpsfvimport ()// marshaler is the interface implemented by types that can marshal themselves into valid SFV.type marshaler interface {marshalSFV(b *strings.Builder) error}// StructuredFieldValue represents a List, a Dictionary or an Item.type StructuredFieldValue interface {marshaler}// Marshal returns the HTTP Structured Value serialization of v// as defined in https://httpwg.org/specs/rfc9651.html#text-serialize.//// v must be a List, a Dictionary, an Item or an InnerList.func ( StructuredFieldValue) (string, error) {var strings.Builderif := .marshalSFV(&); != nil {return "",}return .String(), nil}
![]() |
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. |