Versions in this module Expand all Collapse all v0 v0.2.0 Jun 3, 2023 Changes in this version + func Dearmor(in io.Reader) (string, map[string]string, io.Reader, error) + func MarshalBinary(v any) ([]byte, error) + func UnmarshalBinary(data []byte, v any) error + func UnmarshalBinaryNew(data []byte) (*T, error) + type RawMessage struct + func (r RawMessage[T]) Unpack() (*T, error) + type Stream struct + Reader io.Reader + func (s *Stream) DecodeMsgpack(dec *msgpack.Decoder) error + func (s *Stream) EncodeMsgpack(enc *msgpack.Encoder) error v0.1.3 May 28, 2023 Changes in this version + var ErrUnsupportedCompression = errors.New("unsupported compression algorithm") + func RegisterCompression(alg Compression, decompress Decompressor) type Compression + const CompressionDeflate + const CompressionLz4 + const CompressionZstd + type Compressor interface + Algorithm func() Compression + Compress func(w io.Writer) (io.WriteCloser, error) + type DecompressOpts interface + DecompressOpts func() + type Decompressor func(r io.Reader, opts DecompressOpts) (io.Reader, error) + type Lz4Opts struct + Threads uint + func (Lz4Opts) DecompressOpts() v0.1.2 May 26, 2023 v0.1.1 May 24, 2023 Changes in this version + type ErrMismatchType struct + func (e ErrMismatchType) Error() string + type Object struct + Reader io.Reader + func (o *Object) DecodeMsgpack(dec *msgpack.Decoder) error + func (o *Object) EncodeMsgpack(enc *msgpack.Encoder) error v0.1.0 May 10, 2023 Changes in this version + const IVSize + const MemoryRFC + const SaltSizeRFC + const TimeRFC + var ErrUnknownTag = errors.New("unknown tag") + func ArmoredEncoder(out io.Writer, blockType string, headers map[string]string) (io.WriteCloser, error) + func ChainCloser(c io.Closer, wc io.WriteCloser) io.WriteCloser + func Compress(w io.Writer, alg Compression, lvl int, opts *CompressionOpts) (io.WriteCloser, error) + func DecodeBinary(r io.Reader, v any) error + func DecodeBinaryNew(r io.Reader) (*T, error) + func Decompress(r io.Reader, alg Compression, opts *CompressionOpts) (io.Reader, error) + func Decrypt(r io.Reader, passphrase string, iv IV, salt []byte, params Argon2Params) *cipher.StreamReader + func DetermineArmor(in io.Reader) (bool, io.Reader, error) + func EncodeBinary(w io.Writer, v any) error + func Encrypt(w io.Writer, passphrase string, iv IV, salt []byte, params Argon2Params) *cipher.StreamWriter + func NewPassphrased(passphrase string, iv IV, salt []byte, params Argon2Params) cipher.Stream + func NopCloser(w io.Writer) io.WriteCloser + func Pack(out io.Writer, v Packable, opts ...Option) error + func RegisterPacketType(typ PacketType) + func Unpack(in io.Reader, opts ...UnpackOption) (Tag, Packable, error) + func UnpackExact(in io.Reader, opts ...UnpackOption) (val T, err error) + type Argon2Params struct + Memory uint32 + Threads uint8 + Time uint32 + func Argon2Defaults() Argon2Params + type ArmoredBlock = armor.Block + func DecodeArmored(in io.Reader) (*ArmoredBlock, error) + type Compression byte + const Deflate + const Lz4 + const NoCompression + const Zstd + type CompressionOpts struct + Threads uint + type CustomDecoder = msgpack.CustomDecoder + type CustomEncoder = msgpack.CustomEncoder + type Decoder = msgpack.Decoder + type Encoder = msgpack.Encoder + type Encryption struct + Argon2ID Argon2Params + IV IV + Salt []byte + type ErrMismatchTag struct + func (e ErrMismatchTag) Error() string + type IV [IVSize]byte + type Option interface + func WithArmor(header map[string]string) Option + func WithCompression(alg Compression, lvl int, opts ...*CompressionOpts) Option + func WithEncryption(passphrase string, params *Encryption) Option + type Packable interface + PacketTag func() Tag + type Packet struct + Header struct{ ... } + Object io.Reader + Tag Tag + func (p *Packet) DecodeMsgpack(dec *msgpack.Decoder) error + func (p *Packet) EncodeMsgpack(enc *msgpack.Encoder) error + type PacketType struct + BlockType string + Name string + Tag Tag + Type reflect.Type + func NewType(tag Tag, v Packable, name, blockType string) PacketType + type Tag byte + const TagInvalid + func (t Tag) BlockType() string + func (t Tag) String() string + func (t Tag) Type() (PacketType, error) + type UnpackOption interface + func WithDecompressionOpts(opts *CompressionOpts) UnpackOption + func WithPassphrase(passphrase func() (string, error)) UnpackOption + func WithoutArmor() UnpackOption