formatters

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kinds

func Kinds() []string

Types

type Formatter

type Formatter interface {
	Name() string
	Logs([]models.Log) (out []byte, err error)
	Log(models.Log) (out []byte, err error)
	Entry(models.Entry) (out []byte, err error)
	Meta(models.Meta) (out []byte, err error)
}

func New

func New(kind string) (f Formatter, err error)

func Preferred

func Preferred() (f Formatter, err error)

type Json added in v0.0.3

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

func (*Json) Entry added in v0.0.3

func (js *Json) Entry(e models.Entry) ([]byte, error)

func (*Json) Log added in v0.0.3

func (js *Json) Log(l models.Log) ([]byte, error)

func (*Json) Logs added in v0.0.3

func (js *Json) Logs(logs []models.Log) (out []byte, err error)

func (*Json) Meta added in v0.0.3

func (js *Json) Meta(m models.Meta) ([]byte, error)

func (*Json) Name added in v0.0.3

func (js *Json) Name() string

type Null added in v0.0.3

type Null struct{}

func (*Null) Entry added in v0.0.3

func (n *Null) Entry(e models.Entry) (o []byte, err error)

func (*Null) Log added in v0.0.3

func (n *Null) Log(l models.Log) (o []byte, err error)

func (*Null) Logs added in v0.0.3

func (n *Null) Logs(logs []models.Log) (out []byte, err error)

func (*Null) Meta added in v0.0.3

func (n *Null) Meta(m models.Meta) (o []byte, err error)

func (*Null) Name added in v0.0.3

func (n *Null) Name() string

type PlainText

type PlainText struct {
}

func (*PlainText) Entry

func (pt *PlainText) Entry(entry models.Entry) ([]byte, error)

func (*PlainText) Log

func (pt *PlainText) Log(log models.Log) (out []byte, err error)

func (*PlainText) Logs added in v0.0.3

func (pt *PlainText) Logs(logs []models.Log) (out []byte, err error)

func (*PlainText) Meta

func (pt *PlainText) Meta(meta models.Meta) (out []byte, err error)

func (*PlainText) Name

func (pt *PlainText) Name() string

Jump to

Keyboard shortcuts

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