logstore

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

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

func (Sender) Write

func (s Sender) Write(line string)

type Store

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

func NewStore

func NewStore() *Store

func (*Store) CleanupExpired

func (s *Store) CleanupExpired(retention time.Duration) int

CleanupExpired removes log entries that ended more than `retention` ago.

func (*Store) Create

func (s *Store) Create(workerID, appID string) Sender

Create registers a new log stream for a worker. Returns a Sender for writing log lines from the capture goroutine.

func (*Store) HasActive

func (s *Store) HasActive(workerID string) bool

func (*Store) HasWorker added in v0.0.3

func (s *Store) HasWorker(workerID string) bool

HasWorker returns true if the store has a log entry for the given worker ID.

func (*Store) IsEnded

func (s *Store) IsEnded(workerID string) bool

IsEnded returns true if the worker's log stream has ended.

func (*Store) MarkEnded

func (s *Store) MarkEnded(workerID string)

MarkEnded marks a worker's log stream as ended. Idempotent — safe to call multiple times or on nonexistent workers.

func (*Store) Subscribe

func (s *Store) Subscribe(workerID string) (snapshot []string, live <-chan string, ok bool)

Subscribe returns a snapshot and live channel for a worker's logs.

func (*Store) WorkerAppID added in v0.0.3

func (s *Store) WorkerAppID(workerID string) string

WorkerAppID returns the app ID for a worker, or empty string if not found.

func (*Store) WorkerIDsByApp

func (s *Store) WorkerIDsByApp(appID string) []WorkerInfo

WorkerIDsByApp returns worker info for all workers of the given app.

type WorkerInfo added in v0.0.3

type WorkerInfo struct {
	ID        string
	StartedAt time.Time
	EndedAt   time.Time // zero for active
	Ended     bool
}

WorkerInfo provides timing data for a worker's log stream.

Jump to

Keyboard shortcuts

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