decoder

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package decoder provides several decoders for differently encoded trice streams.

Package decoder provides several decoders for differently encoded trice streams.

Package decoder provides several decoders for differently encoded trice streams.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Verbose gives more information on output if set. The value is injected from main packages.
	Verbose bool

	// ShowID is used as format string for displaying the first trice ID at the start of each line if not "".
	ShowID string

	// Encoding describes the way the byte stream is coded.
	Encoding string

	// TargetEndianness if bigEndian assumes a big endian encoded trice stream from the target.
	// To keep target load small, the encoded trice stream from the target matches the target endianess, what us usually littleEndian.
	TargetEndianness string

	// TestTableMode is a special option for easy decoder test table generation.
	TestTableMode bool

	// Unsigned if true, forces hex and in values printed as unsigned values.
	Unsigned bool

	DebugOut          = false // DebugOut enables debug information.
	DumpLineByteCount int     // DumpLineByteCount is the bytes per line for the dumpDec decoder.

	ShowTargetTimestamp             string // ShowTargetTimestamp is the format string for target timestamps.
	LocationInformationFormatString string // LocationInformationFormatString is the format string for target location: line number and file name.

)

Functions

func Translate

Translate performs the trice log task.

Bytes are read with rc. Then according decoder.Encoding they are translated into strings. Each read returns the amount of bytes for one trice. rc is called on every Translate returns true on io.EOF or false on hard read error or sigterm.

Types

type Decoder

type Decoder interface {
	io.Reader
	// contains filtered or unexported methods
}

Decoder is providing a byte reader returning decoded trice's. setInput allows switching the input stream to a different source.

Jump to

Keyboard shortcuts

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