file

package
v0.7.17 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0 Imports: 6 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 {
	BasePath string
}

Store implements ports.StateStore using the local filesystem. It stores sessions as JSON files in a configured directory.

func New

func New(basePath string) *Store

New creates a new Store with the given base path. If basePath is empty, it defaults to ".trellis/sessions".

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, sessionID string) error

Delete removes the session file.

func (*Store) List

func (s *Store) List(ctx context.Context) ([]string, error)

List returns all active session IDs.

func (*Store) Load

func (s *Store) Load(ctx context.Context, sessionID string) (*domain.State, error)

Load retrieves the session state from a JSON file.

func (*Store) Save

func (s *Store) Save(ctx context.Context, sessionID string, state *domain.State) error

Save persists the session state to a JSON file atomically. It writes to a temporary file first, syncs via fsync, and then renames it to the destination.

Jump to

Keyboard shortcuts

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