memory

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is an in-memory implementation of logstore.LogStore using a circular buffer and a broadcast pattern for live tailing.

func NewStore

func NewStore(capacity int) *Store

NewStore creates a new in-memory log store with the given capacity.

func (*Store) LevelCounts

func (s *Store) LevelCounts() (map[string]int, error)

LevelCounts returns the count of entries by level.

func (*Store) Query

func (s *Store) Query(opts logstore.QueryOpts) ([]logstore.LogEntry, error)

Query returns log entries matching the given options.

func (*Store) Services

func (s *Store) Services() ([]string, error)

Services returns the distinct service names.

func (*Store) Tail

func (s *Store) Tail(ctx context.Context, filter logstore.TailFilter) <-chan logstore.LogEntry

Tail returns a channel that streams matching log entries in real time. The channel is closed when ctx is cancelled.

func (*Store) Write

func (s *Store) Write(entry logstore.LogEntry) error

Write persists a single log entry.

func (*Store) WriteBatch

func (s *Store) WriteBatch(entries []logstore.LogEntry) error

WriteBatch persists multiple log entries.

Jump to

Keyboard shortcuts

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