formatters

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

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

JSON is a formatter that converts the LogDumpContainer into a JSON formatted byte array

func (*JSON) GetFileExtension

func (f *JSON) GetFileExtension() string

GetFileExtension returns the file extension for a plain text file

func (*JSON) Read

func (f *JSON) Read(container *schema.LogDumpContainer) ([]byte, error)

Read returns the JSON representation of a LogDumpContainer (json formatted byte array)

func (*JSON) String added in v2.2.0

func (f *JSON) String() string

String returns the name of the formatter

type MegaDumpFormatter

type MegaDumpFormatter interface {
	Read(container *schema.LogDumpContainer) ([]byte, error)
	GetFileExtension() string
	String() string
}

MegaDumpFormatter abstracts the different types of log storage formats

func NewMegaDumpFormatter added in v2.3.0

func NewMegaDumpFormatter(format config.LogFormat) (MegaDumpFormatter, error)

NewMegaDumpFormatter returns an object that implements the MegaDumpFormatter interface based on the requested format.

type PlainText

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

PlainText is a formatter that flattens the LogDumpContainer into a plain text format

func (*PlainText) GetFileExtension

func (pt *PlainText) GetFileExtension() string

GetFileExtension returns the file extension for a plain text file

func (*PlainText) Read

func (pt *PlainText) Read(container *schema.LogDumpContainer) ([]byte, error)

Read returns a flattened representation of all the fields in the LogDumpContainer

func (*PlainText) String added in v2.2.0

func (pt *PlainText) String() string

String returns the name of the formatter

Jump to

Keyboard shortcuts

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