io

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package io contains the serialization interfaces used by perun.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(reader io.Reader, values ...Decoder) error

Decode decodes multiple serializer objects at once. If an error occurs, the index at which it occurred is also reported.

func Encode

func Encode(writer io.Writer, values ...Encoder) error

Encode encodes multiple serializer objects at once. If an error occurs, the index at which it occurred is also reported.

Types

type Decoder

type Decoder interface {
	// Decode reads an object from a stream.
	// If the stream fails, the underlying error is returned.
	Decode(io.Reader) error
}

A Decoder can decode itself from a stream.

type Encoder

type Encoder interface {
	// Encode writes itself to a stream.
	// If the stream fails, the underlying error is returned.
	Encode(io.Writer) error
}

An Encoder can encode itself into a stream.

type Serializer added in v0.2.0

type Serializer interface {
	Encoder
	Decoder
}

Serializer objects can be serialized into and from streams.

Directories

Path Synopsis
Package test contains the generic serializer tests.
Package test contains the generic serializer tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL