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.
Package decoder provides several decoders for differently encoded trice streams.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Verbose gives mor information on output if set. The value is injected from main packages. Verbose bool // Encoding describes the way the byte stream is coded. Encoding string )
Functions ¶
func Translate ¶
func Translate(sw *emitter.TriceLineComposer, list *id.List, rc io.ReadCloser) bool
Translate performs the trice log task. Bytes are read with rc, according decoder.Encoding are translated into strings returns false on program end signal or true on hard read error.
func UnmarshalTriceIDList ¶
UnmarshalTriceIDList extracts the trice ID list byte slice to an items slice. til is a result of a read til.json file or is a converted test string. til can change during runtime, when an "trice update" occurs. Just in case til is not consistent the err value is not nil.
Types ¶
type Bare ¶
type Bare struct {
// contains filtered or unexported fields
}
Bare is the Decoder instance for bare encoded trices.
func NewBare ¶
NewBare provides an BareDecoder instance. l is the trice id list in slice of struct format. in is the usable reader for the input bytes.
func (*Bare) StringsRead ¶
StringsRead is the provided read method for bare decoding. It uses inner reader and internal id look-up table to fill ss. ss is a slice of strings with a len for the max expected strings. m is the count of decoded strings inside ss.
type BareReaderFromWrap ¶
type BareReaderFromWrap struct {
// contains filtered or unexported fields
}
BareReaderFromWrap provides a Read method for bare data from wrapped data
func NewBareReaderFromWrap ¶
func NewBareReaderFromWrap(in io.Reader) *BareReaderFromWrap
NewBareReaderFromWrap returns a pointer to a BareReaderFromWrap instance which is satisfying the io.Reader interface and using `in` as internal reader. It assumes wrap coded trices in the input byte stream. It uses the wrapper bytes for syncing and removes them silently.
type Decoder ¶
type Decoder interface { StringsReader }
Decoder is the interface (method set) a decoder needs to provide
type Esc ¶
type Esc struct {
// contains filtered or unexported fields
}
Esc is the Decoder instance for esc encoded trices.
func NewEsc ¶
NewEsc provides an EscDecoder instance. l is the trice id list in slice of struct format. in is the usable reader for the input bytes.
func (*Esc) StringsRead ¶
StringsRead is the provided read method for esc decoding. It uses inner reader and internal id look-up table to fill ss. ss is a slice of strings with a len for the max expected strings. m is the count of decoded strings inside ss.
type StringsReader ¶
StringsReader as Decoder method uses an underlying (byte) Reader for reading and returns max len(p) strings inside p. n is the received amount of strings. err is the underlying Reader error or an internal error.