Documentation ¶
Overview ¶
Package encs aims to provide a type-strict, modular and feature-full encoding library with as little overhead as possible.
Goals include: Type-safe: The type is encoded along with the value, and decoders will decode only into the same type that was sent, or in the case of interface encoding, fill the interface with the same type as was sent. All types to be received must be Registered with Register()
Stream-promiscuious: Encoded messages are completely self-contained, and encoded streams can be picked up by a Decoder mid-stream and decoded sucessfully, allowing a static Encoder to write to a dynamic number of receiving clients, and a dynamic number of sending clients to be decoded by a single Decoder.
Modular and Open: Methods for encoding are exposed in sub-packages, allowing their low-level encoding methods to be used to create custom encoding systems for a given use case, without the overhead or added complexity of an Encoder or Decoder. The simple payload structure also allows easy re-implementation of the encs protocol.
encs/encodable provides encoders for specific types, and methods for encoding reflect.Type values.
encs/encio provides io and error types for encoding and related tasks
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultResolver = encodable.NewRegisterResolver(nil)
DefaultResolver is the default Resolver used when Config.Resolver is nil. Types must be registered with Register()
Functions ¶
Types ¶
type Config ¶
type Config struct { // Resolver is the encoder for reflect.Types. // If nil, the default resolver will be used, and Encoded types must be registered with encs.Register() Resolver encodable.Resolver }
Config defines configuration for Encoders and Decoders
Directories ¶
Path | Synopsis |
---|---|
Package encio provides simple methods for encoding-relavent input and output, as well as error types.
|
Package encio provides simple methods for encoding-relavent input and output, as well as error types. |
Package encodable provides low-level methods for seralising golang data structures.
|
Package encodable provides low-level methods for seralising golang data structures. |