Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct { Name string Type MediaType NewEncoder func(Sink) Encoder NewDecoder func(Source) Decoder }
A Codec composes encoding and decoding of a serialization format.
type Decoder ¶
type Decoder interface {
Decode(Unmarshaler) error
}
A Decoder decodes a given Unmarshaler or returns an error in case of failure.
type DecoderFunc ¶
type DecoderFunc func(Unmarshaler) error
DecoderFunc is the functional adapter for Decoder
func (DecoderFunc) Decode ¶
func (f DecoderFunc) Decode(u Unmarshaler) error
Decode implements the Decoder interface
type EncoderFunc ¶
EncoderFunc is the functional adapter for Encoder
func (EncoderFunc) Encode ¶
func (f EncoderFunc) Encode(m Marshaler) error
Encode implements the Encoder interface
type MediaType ¶ added in v0.0.4
type MediaType string
func (MediaType) ContentType ¶ added in v0.0.4
ContentType returns the HTTP Content-Type associated with the MediaType
type Sink ¶ added in v0.0.4
func SinkWriter ¶ added in v0.0.4
SinkWriter returns a Sink that sends a frame to an io.Writer with no decoration.
type SinkFactory ¶ added in v0.0.4
type SinkFactoryFunc ¶ added in v0.0.4
type Source ¶ added in v0.0.4
func SourceReader ¶ added in v0.0.4
SourceReader returns a Source that buffers all input from the given io.Reader and returns the contents in a single frame.
type SourceFactory ¶ added in v0.0.4
type SourceFactoryFunc ¶ added in v0.0.4
type Unmarshaler ¶
type Unmarshaler interface { pb.Unmarshaler json.Unmarshaler }
Unmarshaler composes the supporter unmarshaling formats.
Directories ¶
Path | Synopsis |
---|---|
Package proto implements protobuf utilities such as functional options to construct complex structs and encoders and decoders composable with io.ReadWriters.
|
Package proto implements protobuf utilities such as functional options to construct complex structs and encoders and decoders composable with io.ReadWriters. |