stream

package
v3.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2014 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stream

func Stream(ch chan string, options MessagePrinterOptions)

Types

type FilterFn

type FilterFn func(
	keypart1 string,
	record map[string]interface{},
	options MessagePrinterOptions) bool

FilterFn is a function to filter incoming messages

type MessagePrinter

type MessagePrinter struct {
	// contains filtered or unexported fields
}

MessagePrinter handles print representation of messages streamed by logyard.

func NewMessagePrinter

func NewMessagePrinter(options MessagePrinterOptions) MessagePrinter

func (MessagePrinter) AddFormat

func (p MessagePrinter) AddFormat(keypart1 string, format string)

Add print format for messages identified by this key prefix. The prefix of the key must not contain any period. For example, if messages are identified by "systail.dea.NODE", then keypart1 should just be "systail".

func (MessagePrinter) Print

func (p MessagePrinter) Print(msg zmqpubsub.Message) error

Print a message from logyard streams

func (MessagePrinter) PrintInternalError

func (p MessagePrinter) PrintInternalError(errmsg string)

func (*MessagePrinter) SetPrePrintHook

func (p *MessagePrinter) SetPrePrintHook(fn FilterFn)

type MessagePrinterOptions

type MessagePrinterOptions struct {
	Raw            bool
	LogyardVerbose bool
	ShowTime       bool
	NoColor        bool
	NodeID         string
	JSON           bool
}

REFACTOR: remove coupling between color printer and options.

Jump to

Keyboard shortcuts

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