Documentation ¶
Overview ¶
Package frob is a fast restricted object encoder/decoder in the spirit of gob. Restrictions include:
Interface values are not supported. This avoids the need for the encoding to describe types.
The encoding is unspecified and subject to change, so the encoder and decoder must exactly agree on their implementation and on the definitions of the target types.
Lengths (of arrays, slices, and maps) are currently assumed to fit in 32 bits.
There is no error handling. All errors are reported by panicking.
Types that (recursively) contain private struct fields are not permitted.
Values are serialized as trees, not graphs, so shared subgraphs are encoded repeatedly.
No attempt is made to detect cyclic data structures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
A Codec is an immutable encoder and decoder for values of a particular type.
func CodecFor117 ¶
func CodecFor117(x any) Codec
Use CodecFor117(new(T)) to create a codec for values of type T. Then call Encode(T) and Decode(data, *T). This is a placeholder for the forthcoming generic API -- see below. CodecFor117 panics if type T is unsuitable.