adapters

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStore added in v0.6.0

type FileStore struct {
	BasePath string
}

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

func NewFileStore added in v0.6.0

func NewFileStore(basePath string) *FileStore

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

func (*FileStore) Delete added in v0.6.0

func (f *FileStore) Delete(ctx context.Context, sessionID string) error

Delete removes the session file.

func (*FileStore) List added in v0.6.0

func (f *FileStore) List(ctx context.Context) ([]string, error)

List returns all active session IDs.

func (*FileStore) Load added in v0.6.0

func (f *FileStore) Load(ctx context.Context, sessionID string) (*domain.State, error)

Load retrieves the session state from a JSON file.

func (*FileStore) Save added in v0.6.0

func (f *FileStore) 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.

type LoamLoader

type LoamLoader struct {
	Repo *loam.TypedRepository[dto.NodeMetadata]
}

LoamLoader adapts the Loam library to the Trellis GraphLoader interface.

func NewLoamLoader

func NewLoamLoader(repo *loam.TypedRepository[dto.NodeMetadata]) *LoamLoader

NewLoamLoader creates a new Loam adapter.

func (*LoamLoader) GetNode

func (l *LoamLoader) GetNode(id string) ([]byte, error)

GetNode retrieves a node from the Loam repository using the direct Service API. Note: Loam Service.GetDocument is a direct convenience lookup.

func (*LoamLoader) ListNodes added in v0.3.0

func (l *LoamLoader) ListNodes() ([]string, error)

ListNodes lists all nodes in the repository.

func (*LoamLoader) Watch added in v0.3.2

func (l *LoamLoader) Watch(ctx context.Context) (<-chan string, error)

Watch implements ports.Watchable.

Directories

Path Synopsis
Package http provides primitives to interact with the openapi HTTP API.
Package http provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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