Documentation
¶
Index ¶
- func DateMarshalIntUnix(enc *jsontext.Encoder, d civil.Date) error
- func DateUnmarshalIntUnix(dec *jsontext.Decoder, d *civil.Date) error
- func DurationMarshalIntSeconds(enc *jsontext.Encoder, d time.Duration) error
- func DurationUnmarshalIntSeconds(dec *jsontext.Decoder, d *time.Duration) error
- func HTTPHeaderMarshal(enc *jsontext.Encoder, m http.Header) error
- func HTTPHeaderUnmarshal(dec *jsontext.Decoder, h *http.Header) error
- func OrderedMapMarshal[M ~map[K]V, K cmp.Ordered, V any](enc *jsontext.Encoder, m M) error
- func ReadFile[T any](name string, opts ...json.Options) (T, error)
- func TimeMarshalIntUnix(enc *jsontext.Encoder, t time.Time) error
- func TimeUnmarshalIntUnix(dec *jsontext.Decoder, d *time.Time) error
- func URLMarshal(enc *jsontext.Encoder, u url.URL) error
- func URLUnmarshal(dec *jsontext.Decoder, u *url.URL) error
- func WriteFile[T any](name string, data T, opts ...json.Options) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DateMarshalIntUnix ¶
DateMarshalIntUnix is a custom marshaler for civil.Date, marshaling them as integers representing unix time.
func DateUnmarshalIntUnix ¶
DateUnmarshalIntUnix is a custom unmarshaler for civil.Date, unmarshaling them from integers and assuming they represent unix time.
func DurationMarshalIntSeconds ¶
DurationMarshalIntSeconds is a custom marshaler for time.Duration, marshaling them as integers representing seconds.
func DurationUnmarshalIntSeconds ¶
DurationUnmarshalIntSeconds is a custom unmarshaler for time.Duration, unmarshaling them from integers and assuming they represent seconds.
func HTTPHeaderMarshal ¶
HTTPHeaderMarshal is a custom marshaler for http.Header, marshaling values as a single strings. It also marshals the keys in their canonical form. Note that we omit keys that don't have a value.
func HTTPHeaderUnmarshal ¶
HTTPHeaderUnmarshal is a custom unmarshaler for http.Header, unmarshaling values as single strings.
func OrderedMapMarshal ¶
OrderedMapMarshal is a custom marshaler for maps with ordered keys, marshaling them in an ordered fashion.
func TimeMarshalIntUnix ¶
TimeMarshalIntUnix is a custom marshaler for time.Time, marshaling them as integers representing unix time.
func TimeUnmarshalIntUnix ¶
TimeUnmarshalIntUnix is a custom unmarshaler for time.Time, unmarshaling them from integers and assuming they represent unix time.
func URLMarshal ¶
URLMarshal is a custom marshaler for URL values, marshaling them as strings.
func URLUnmarshal ¶
URLUnmarshal is a custom unmarshaler for URL values, unmarshaling them from strings.
Types ¶
This section is empty.