Versions in this module Expand all Collapse all v0 v0.2.0 Jan 27, 2022 v0.1.0 Dec 4, 2020 Changes in this version + const DefaultEncodingType + var Encoders = EncodeDecoderFactories + var ErrNotEncodable = errors.New("transfer: the given value cannot be encoded for this transfer mechanism") + var ErrUnknownEncodingType = errors.New("transfer: unknown encoding type") + func DecodeFromTransfer(value string) ([]byte, error) + func EncodeForTransfer(value []byte) (string, error) + type Base64Encoding struct + func (Base64Encoding) EncodeJSON(value []byte) (JSONOrStr, error) + func (e Base64Encoding) DecodeFromTransfer(value string) ([]byte, error) + func (e Base64Encoding) EncodeForTransfer(value []byte) (string, error) + type Decoder interface + DecodeFromTransfer func(string) ([]byte, error) + type EncodeDecoder interface + type EncodeDecoderFactories map[EncodingType]EncodeDecoderFactoryFunc + type EncodeDecoderFactoryFunc func() EncodeDecoder + type Encoder interface + EncodeForTransfer func([]byte) (string, error) + EncodeJSON func([]byte) (JSONOrStr, error) + type EncodingType string + const Base64EncodingType + const NoEncodingType + func ParseEncodedValue(value string) (EncodingType, string) + func (p EncodingType) String() string + type JSON struct + Data string + EncodingType EncodingType + Factories EncodeDecoderFactories + func (t JSON) Decode() ([]byte, error) + type JSONInterface struct + Data interface{} + func (ji *JSONInterface) UnmarshalJSON(data []byte) error + func (ji JSONInterface) MarshalJSON() ([]byte, error) + type JSONOrStr struct + func EncodeJSON(value []byte) (JSONOrStr, error) + func (tos *JSONOrStr) UnmarshalJSON(data []byte) error + func (tos JSONOrStr) MarshalJSON() ([]byte, error) + type NoEncoding struct + func (NoEncoding) EncodeJSON(value []byte) (JSONOrStr, error) + func (e NoEncoding) DecodeFromTransfer(value string) ([]byte, error) + func (e NoEncoding) EncodeForTransfer(value []byte) (string, error)