inspect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package inspect is a read-only window into a memmy Neo4j database used by the eval harness to capture per-node state (weight, last touch, edge degree) before and after a query.

It opens its own bolt driver against the same Neo4j the live memmy service writes to. Reads run as managed read transactions and never interfere with the writer's session pool. This separation keeps memmy.MemoryService out of the harness's path and preserves the stateless-service contract (CLAUDE.md §0 #3).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	URI      string
	User     string
	Password string
	Database string
}

Connection bundles the Neo4j connection settings.

type NodeState

type NodeState struct {
	NodeID       string
	TenantID     string
	Weight       float64
	LastTouched  time.Time
	AccessCount  uint64
	EdgeCountOut int
	EdgeCountIn  int
}

NodeState is the slice of per-node metadata the harness cares about.

type Reader

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

Reader is the read-only window. Open one against the same Neo4j instance the live service writes to.

func Open

func Open(conn Connection) (*Reader, error)

Open returns a Reader pointing at conn.

func (*Reader) Close

func (r *Reader) Close() error

Close releases the read-side driver pool.

func (*Reader) ListNodes

func (r *Reader) ListNodes(ctx context.Context, tenant string) ([]string, error)

ListNodes returns every node ID for tenant in storage order.

func (*Reader) ListTenants

func (r *Reader) ListTenants(ctx context.Context) ([]Tenant, error)

ListTenants returns every tenant registered in the db.

func (*Reader) NodeState

func (r *Reader) NodeState(ctx context.Context, tenant, id string) (NodeState, bool, error)

NodeState reads a single node's state. (state, false, nil) when absent.

func (*Reader) NodeStates

func (r *Reader) NodeStates(ctx context.Context, tenant string, ids []string) ([]NodeState, error)

NodeStates fetches state for the given node IDs in one read tx. Missing nodes are silently omitted.

type Tenant

type Tenant struct {
	ID    string
	Tuple map[string]string
}

Tenant describes one tenant the db has seen.

Jump to

Keyboard shortcuts

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