store

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBPath

func DBPath() (string, error)

DBPath returns the path to the database file

Types

type Entry

type Entry struct {
	ID            int64
	Persona       string
	Content       string
	CreatedAt     time.Time
	Uptime        string
	CPUPercent    float64
	MemoryPercent float64
	DiskPercent   float64
}

Entry represents a saved journal entry

type Store

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

Store handles persistence of journal entries

func Open

func Open() (*Store, error)

Open creates or opens the database

func (*Store) Close

func (s *Store) Close() error

Close closes the database connection

func (*Store) GetByID

func (s *Store) GetByID(id int64) (*Entry, error)

GetByID retrieves a single entry by ID

func (*Store) List

func (s *Store) List(limit int) ([]*Entry, error)

List retrieves entries with optional limit, newest first

func (*Store) ListByPersona

func (s *Store) ListByPersona(persona string, limit int) ([]*Entry, error)

ListByPersona retrieves entries for a specific persona

func (*Store) Save

func (s *Store) Save(persona string, content string, snapshot *metrics.Snapshot) (*Entry, error)

Save persists a new journal entry

Jump to

Keyboard shortcuts

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