Documentation
¶
Overview ¶
Package workspace retains logical organization independently of the records it groups. A membership neither moves a conversation nor grants control of it.
Index ¶
- Variables
- func ValidateName(name string) error
- type Collection
- type Kind
- type Ref
- type Store
- func (s *Store) Add(ctx context.Context, id string, ref Ref) error
- func (s *Store) Close() error
- func (s *Store) Collections(ctx context.Context) ([]Collection, error)
- func (s *Store) CollectionsFor(ctx context.Context, ref Ref) ([]Collection, error)
- func (s *Store) Create(ctx context.Context, name string) (Collection, error)
- func (s *Store) Members(ctx context.Context, id string) ([]Ref, error)
- func (s *Store) Remove(ctx context.Context, id string, ref Ref) error
- func (s *Store) Rename(ctx context.Context, id, name string) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalid = errors.New("invalid collection or reference") ErrNotFound = errors.New("collection not found") ErrCycle = errors.New("collection membership would form a cycle") // ErrBusy is a lock this store waited busyTimeout for and did not get. It is // not corruption and not a refusal: another command is still writing, so // this command left the collections database unchanged and can be retried. ErrBusy = errors.New("the collections database is busy being written by something else") )
Functions ¶
func ValidateName ¶
ValidateName lets command adapters reject malformed requests before opening durable storage. Create and Rename enforce the same rule at the write boundary.
Types ¶
type Collection ¶
type Ref ¶
type Ref struct {
Kind Kind `json:"kind"`
ID string `json:"id"`
SessionID string `json:"session_id,omitempty"`
}
Ref preserves the address used by the existing record owner. TASK NUMBERS ARE LOCAL TO A CONVERSATION, so their session is part of their identity. Artifact IDs are absolute paths, not claims of permanent content identity.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns collection metadata only. Transcripts, task checkpoints, standing items and artifacts retain their existing owners and persistence formats.
THE SCHEMA IS BUILT BY THE FIRST WRITE THAT NEEDS IT, never by Open. Opening is also how `list`, `show` and `find` reach the file, and a read that built a schema would write to a database nobody asked to change and take the writer lock to do it — which is what put a plain read behind whichever peer happened to be adding a membership. `ready` is that question already answered, and `schemaMu` keeps two goroutines on one handle from both answering it.
func Open ¶
Open creates a private collection store or checks an existing one. Unknown databases fail explicitly; they must never be interpreted as empty state.
func (*Store) Collections ¶
func (s *Store) Collections(ctx context.Context) ([]Collection, error)