journal

package
v0.0.0-...-3d8d521 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Journal

type Journal interface {
	ListMessages(begin string, limit int, callback func(message *Message) (bool, error)) error
	WriteMessage(message *Message) error
	Close() error
}

func NewPebbleJournal

func NewPebbleJournal(config *config.Config) (Journal, error)

type Message

type Message struct {
	Id               string
	Version          string
	Host             string
	SenderHost       string
	Input            string
	Short            string
	Full             string
	TimeUnix         time.Time
	ReceivedTimeUnix time.Time
	Level            int32
	Facility         string
	Extra            map[string]interface{}
}

func FromGelfMessage

func FromGelfMessage(gelfMessage *gelf.Message, senderHost string, input string) *Message

func (*Message) MarshalJSON

func (m *Message) MarshalJSON() ([]byte, error)

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

type PebbleJournal

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

func (*PebbleJournal) Close

func (journal *PebbleJournal) Close() error

func (*PebbleJournal) ListMessages

func (journal *PebbleJournal) ListMessages(begin string, limit int, callback func(message *Message) (bool, error)) error

func (*PebbleJournal) WriteMessage

func (journal *PebbleJournal) WriteMessage(message *Message) error

Jump to

Keyboard shortcuts

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