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 ¶
- type Repository
- func (r *Repository) Apply(ctx context.Context, cs agentkit.ChangeSet) error
- func (r *Repository) ClaimNextProcess(ctx context.Context, workerID string, leaseUntil time.Time, now time.Time) (*agentkit.Process, error)
- func (r *Repository) FindOpenProcessBySubject(ctx context.Context, subject agentkit.SubjectRef) (*agentkit.Process, error)
- func (r *Repository) FindProcessByIdempotencyKey(ctx context.Context, key string) (*agentkit.Process, error)
- func (r *Repository) GetProcess(ctx context.Context, pid agentkit.ProcessID) (*agentkit.Process, error)
- func (r *Repository) ListAwaits(ctx context.Context, pid agentkit.ProcessID) ([]*agentkit.Await, error)
- func (r *Repository) ListEvents(ctx context.Context, pid agentkit.ProcessID, q agentkit.EventQuery) ([]*agentkit.Event, error)
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 (*Repository) Apply ¶
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 ¶
func (r *Repository) ListEvents(ctx context.Context, pid agentkit.ProcessID, q agentkit.EventQuery) ([]*agentkit.Event, error)
ListEvents returns a Process's events in append order, after the cursor and capped at limit.