2026-01-03 15:53:50 -08:00
|
|
|
// Package encoding provides generic encoder and decoder function types.
|
2020-07-08 18:59:37 -07:00
|
|
|
package encoding
|
|
|
|
|
|
|
|
|
|
import "io"
|
|
|
|
|
|
2026-01-03 15:53:50 -08:00
|
|
|
// Encoder is a function that encodes data to a writer.
|
2020-07-08 18:59:37 -07:00
|
|
|
type Encoder func(io.Writer, interface{}) error
|
2026-01-03 15:53:50 -08:00
|
|
|
|
|
|
|
|
// Decoder is a function that decodes data from a reader.
|
2020-07-08 18:59:37 -07:00
|
|
|
type Decoder func(io.Reader, interface{}) error
|