encoding

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package encoding defines types that deal with document encoding. Genji codecs are designed to support buffer reuse during encoding and optional random-access, i.e. decoding one path without decoding the entire document, during decoding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	NewEncoder(io.Writer) Encoder
	// NewDocument returns a document without decoding its given binary representation.
	// The returned document should ideally support random-access, i.e. decoding one path
	// without decoding the entire document. If not, the document must be lazily decoded.
	NewDocument([]byte) document.Document
}

A Codec is able to create encoders and decoders for a specific encoding format.

type Encoder

type Encoder interface {
	EncodeDocument(d document.Document) error
	// Close the encoder to release any resource.
	Close()
}

An Encoder encodes one document to the underlying writer.

Directories

Path Synopsis
Package encodingtest provides a test suite for testing codec implementations.
Package encodingtest provides a test suite for testing codec implementations.

Jump to

Keyboard shortcuts

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