Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memory is an in-process, non-persistent reference implementation of agentkit.Repository. It is intended for tests, development, and persistence-free one-shot runs; the kernel's own tests use it. All state lives in memory guarded by a single mutex, and every value crossing the boundary is deep-copied.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

Repository is the in-memory agentkit.Repository.

func New

func New() *Repository

New returns an empty in-memory Repository.

func (*Repository) Apply

func (r *Repository) Apply(ctx context.Context, cs agentkit.ChangeSet) error

Apply applies a ChangeSet atomically. On any precondition failure it writes nothing and returns agentkit.ErrConflict.

func (*Repository) ClaimNextProcess

func (r *Repository) ClaimNextProcess(ctx context.Context, workerID string, leaseUntil time.Time, now time.Time) (*agentkit.Process, error)

ClaimNextProcess atomically claims one runnable Process, minting a fresh LeaseToken. No target -> (nil, nil).

func (*Repository) FindOpenProcessBySubject

func (r *Repository) FindOpenProcessBySubject(ctx context.Context, subject agentkit.SubjectRef) (*agentkit.Process, error)

FindOpenProcessBySubject finds an open Process holding the subject.

func (*Repository) FindProcessByIdempotencyKey

func (r *Repository) FindProcessByIdempotencyKey(ctx context.Context, key string) (*agentkit.Process, error)

FindProcessByIdempotencyKey finds a Process by idempotency key.

func (*Repository) GetProcess

func (r *Repository) GetProcess(ctx context.Context, pid agentkit.ProcessID) (*agentkit.Process, error)

GetProcess returns the Process, or agentkit.ErrProcessNotFound.

func (*Repository) ListAwaits

func (r *Repository) ListAwaits(ctx context.Context, pid agentkit.ProcessID) ([]*agentkit.Await, error)

ListAwaits returns all awaits of a Process.

func (*Repository) ListEvents

ListEvents returns a Process's events in append order, after the cursor and capped at limit.

Jump to

Keyboard shortcuts

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