package messagejournal

import "github.com/redhatinsights/yggdrasil/internal/messagejournal"

Index

Types

type Filter

type Filter struct {
	Persistent bool
	MessageID  string
	Worker     string
	Since      string
	Until      string
}

Filter is a data structure representing the filtering options that are used when message journal entries are retrieved by yggctl.

type MessageJournal

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

MessageJournal is a data structure representing the collection of message journal entries received from worker emitted events and messages. It also stores the date time of when the journal was initialized to track events and messages in the active session.

func Open

func Open(databaseFilePath string) (*MessageJournal, error)

Open initializes a message journal sqlite database consisting of a persistent table that maintains journal entries across sessions.

func (*MessageJournal) AddEntry

func (j *MessageJournal) AddEntry(entry yggdrasil.WorkerMessage) error

AddEntry adds a new message journal entry to the persistent table in the database.

func (*MessageJournal) GetEntries

func (j *MessageJournal) GetEntries(filter Filter) ([]map[string]string, error)

GetEntries retrieves a list of all the journal entries in the message journal database that meet the criteria of the provided message journal filter.

Source Files

messagejournal.go

Version
v0.4.5 (latest)
Published
Feb 3, 2025
Platform
linux/amd64
Imports
15 packages
Last checked
3 weeks ago

Tools for package owners.