csv

package
v0.0.0-...-660a5ed Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(buf []byte) (e *event.Event, err error)

Types

type FmtCSV

type FmtCSV struct {
	UnixTime bool
	JsonMeta bool
}

FmtCSV struct describes the different manipulations and processing that a CSV LogFormatter can apply to an event.Event

func (*FmtCSV) Format

func (f *FmtCSV) Format(log *event.Event) (buf []byte, err error)

Format method will take in a pointer to an event.Event; and returns a buffer and an error.

This method will process the input event.Event and marshal it according to this LogFormatter

type FmtCSVBuilder

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

FmtCSVBuilder struct allows creating custom CSV Formatters. Its default values will leave its supported options set as false, so it's not required to always use this struct.

Its options will allow: - setting Unix micros as timestamp (in string format) - setting a JSON metadata formatter instead of text-based

func New

func New() *FmtCSVBuilder

New function will create a new instance of a FmtCSVBuilder

func (*FmtCSVBuilder) Build

func (b *FmtCSVBuilder) Build() *FmtCSV

Build method will create a (custom) FmtCSV object based on the builder's configuration, and return a pointer to it

func (*FmtCSVBuilder) JSON

func (b *FmtCSVBuilder) JSON() *FmtCSVBuilder

JSON method will set the FmtCSV's metadata as JSON format

func (*FmtCSVBuilder) Unix

func (b *FmtCSVBuilder) Unix() *FmtCSVBuilder

Unix method will set the FmtCSV's timestamp as Unix micros

Jump to

Keyboard shortcuts

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