listparse

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: BSD-2-Clause Imports: 4 Imported by: 1

Documentation

Overview

Package listparse implements functions to read and write repbin message lists.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInMessage is returned if the message contained an error string
	ErrInMessage = errors.New("listparse: Error returned")
	// ErrFormat is returned if the format is corrupt
	ErrFormat = errors.New("listparse: Format malformed")
	// ErrNoEntries is returned if no entries are found in the list
	ErrNoEntries = errors.New("listparse: No entries in list")
	// ErrSomeErrors is returned if some entries were corrupts but we were able to read at least some
	ErrSomeErrors = errors.New("listparse: List contains some errors, recovered")
)

Functions

func ReadMessageList

func ReadMessageList(d []byte) (messages []*structs.MessageStruct, lastline []byte, err error)

ReadMessageList reads a message list from reader and outputs a list of MessageStructs. Callers must verify that messages is nil or that err != ErrSomeErrors.

func WriteMessageList

func WriteMessageList(messages []*structs.MessageStruct, w io.Writer)

WriteMessageList formats a message list into a list of newline separated lines with space separated values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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