Documentation
¶
Overview ¶
Package bytes provides byte-oriented encoding helpers and adapters used by go-service.
Start with the package-level constructors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct{}
Encoder encodes and decodes values by delegating to io.WriterTo and io.ReaderFrom.
This encoder does not perform any framing, escaping, or format conversion. It simply forwards the Encode/Decode call to the value itself.
func NewEncoder ¶
func NewEncoder() *Encoder
NewEncoder constructs a passthrough encoder for stream-capable types.
This encoder is intended for values that can write themselves to an io.Writer and/or read themselves from an io.Reader via the standard library interfaces:
- io.WriterTo for Encode
- io.ReaderFrom for Decode
It is useful when you want to treat a value as its own codec (for example when caching or transporting pre-serialized payloads) while still satisfying the go-service encoding.Encoder interface.