akaibu

package module
v0.0.0-...-5b6ded1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

README

goakaibu - Akaibu log archive reader and writer for Go

Build status GoDoc

Supports the full Akaibu log archive specification version 1. Documentation is available on GoDoc.

Testing

To test against samples, generate the samples with make samples in the Akaibu format repository, and place the files in fixtures/ before running tests. Tests are run with Make:

make test

Documentation

Overview

akaibu provides reading and writing of Akaibu log archive files.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Invalid archive error.
	ErrInvalidArchive = errors.New("invalid archive")

	// Unsupported version error.
	ErrUnsupportedVersion = errors.New("unsupported archive version")

	// Invalid compression error.
	ErrInvalidCompression = errors.New("invalid compression")

	// Out of range error.
	ErrOutOfRange = errors.New("out of range")
)

Functions

func PackInt

func PackInt(v uint64) ([]byte, error)

Pack an integer value.

Types

type Compression

type Compression uint8

Compression.

const (
	// Uncompressed.
	UncompressedCompression Compression = iota

	// zlib compression.
	ZlibCompression

	// Snappy compression.
	SnappyCompression
)

func (Compression) Valid

func (c Compression) Valid() bool

Test if the compression is valid.

type Reader

type Reader interface {
	io.Closer

	// Read a record.
	Read() ([]byte, error)
}

Reader.

Reads records from an Akaibu archival log file.

func NewReader

func NewReader(r io.Reader) (Reader, error)

New reader.

type Writer

type Writer interface {
	io.Closer

	// Write a record.
	Write(p []byte) error
}

Writer.

func NewSnappyCompressedWriter

func NewSnappyCompressedWriter(w io.Writer) (Writer, error)

New Snappy-compressed writer.

func NewUncompressedWriter

func NewUncompressedWriter(w io.Writer) (Writer, error)

New uncompressed writer.

func NewZlibCompressedWriter

func NewZlibCompressedWriter(w io.Writer, level int) (Writer, error)

New zlib-compressed writer.

The level has the same function as in compress/zlib.

Jump to

Keyboard shortcuts

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