Documentation ¶
Index ¶
- Constants
- Variables
- func Csv(writer io.Writer, countMap map[string]EntryCount)
- func Default(writer io.Writer, countMap map[string]EntryCount)
- func Json(writer io.Writer, countMap map[string]EntryCount)
- func Process(in <-chan *domain.Entry, out chan<- bool, processor Processor)
- type CountProcessor
- type EntryCount
- type Formatter
- type Processor
Constants ¶
View Source
const (
FormatRaw = "{{.RawContent}}"
)
Variables ¶
View Source
var Formatters map[string]Formatter
Holds the registered formatters
Functions ¶
Types ¶
type CountProcessor ¶
type CountProcessor struct { Counters map[string]EntryCount // contains filtered or unexported fields }
Defines a processor for counting entries
func NewCountProcessor ¶
func NewCountProcessor(groups []string, formatter Formatter, writer io.Writer) CountProcessor
Creates a new processor that will count the entries and prints the total at the end of the process groups: an array of the groups to count (level, category, origin or exception) formatter: the component for printing the output in some format writer: the writer that will receive the output for printing
func (CountProcessor) After ¶
func (processor CountProcessor) After()
Prints the totals after the process
func (CountProcessor) Before ¶
func (processor CountProcessor) Before()
func (CountProcessor) Execute ¶
func (processor CountProcessor) Execute(entry *domain.Entry)
Counts the entries as they arrive on the pipeline
type EntryCount ¶
type EntryCount struct { // The counter grouped by values Values map[string]int64 // contains filtered or unexported fields }
Structure that represents a counter
type Formatter ¶
type Formatter func(writer io.Writer, countMap map[string]EntryCount)
Defines a Formatter as a function that prints the given count map on the given writer
func TemplateFormatter ¶
Returns a new formatter that uses the given go template for printing the count map
Click to show internal directories.
Click to hide internal directories.