plain

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package plain provides interfaces and helpers for "plain" encoding.

Plain encodings are intended for human readable data.

Package plain provides interfaces and a few supporting functions for a 'plain' encoding.

A 'plain' encoding should serialize data in a plain text way, without being too 'pretty'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeInt64 added in v0.0.3

func DecodeInt64(r io.Reader, p *int64) error

func DecodeInt64From added in v0.0.6

func DecodeInt64From(r io.Reader) (int64, error)

func DecodeJoin

func DecodeJoin(r io.Reader, sep string, ds ...Decoder) error

func DecodeUint64 added in v0.0.6

func DecodeUint64(r io.Reader, p *uint64) error

func DecodeUint64From added in v0.0.6

func DecodeUint64From(r io.Reader) (uint64, error)

func EncodeInt64 added in v0.0.3

func EncodeInt64(w io.Writer, v int64) error

func EncodeJoin

func EncodeJoin(w io.Writer, sep string, es ...Encoder) error

func EncodeUint64 added in v0.0.6

func EncodeUint64(w io.Writer, v uint64) error

func Expect added in v0.0.4

func Expect(r io.Reader, s string) error

func Parse

func Parse(t Decoder, s string) error

Parse provides a Parse() function for decoders.

func Put added in v0.0.4

func Put(w io.Writer, s string) error

func String

func String(t Encoder) string

String provides a String() function for Encoders.

func TestRoundTrip added in v0.0.2

func TestRoundTrip(c Coder, verbose bool) error

func TestRoundTripClobber added in v0.0.8

func TestRoundTripClobber(c Coder, clob func(Coder), verbose bool) error

Types

type Coder

type Coder interface {
	Encoder
	Decoder
}

type Decoder

type Decoder interface {
	PlainDecode(io.Reader) error
}

Decoder is the interface for a plain decoder.

type Encoder

type Encoder interface {
	PlainEncode(io.Writer) error
}

Encoder is the interface for a plain encoder.

type Int added in v0.0.6

type Int int64

func (*Int) PlainDecode added in v0.0.6

func (i *Int) PlainDecode(r io.Reader) error

func (Int) PlainEncode added in v0.0.6

func (i Int) PlainEncode(w io.Writer) error

type Uint added in v0.0.6

type Uint uint64

func (*Uint) PlainDecode added in v0.0.6

func (u *Uint) PlainDecode(r io.Reader) error

func (Uint) PlainEncode added in v0.0.6

func (u Uint) PlainEncode(w io.Writer) error

Jump to

Keyboard shortcuts

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