Documentation
¶
Overview ¶
Package workspacefeed keeps the change position behind the service feed of Workspaces (ADR 0009). A Workspace takes the next position whenever it is created, an owner is added, removed or transferred, an owner's email or verification changes, or it is deleted, restored or erased (ADR 0043). The service endpoint reads Workspaces in the order of that position (ee/staff), so what a caller saved as its cursor always names a place in the order of changes.
Two ent hooks keep it so no write path can forget it. Hook runs on every transaction client (the event bus's): the change and its position commit together, in the order the positions were taken. Guard runs on the plain client (db.NewEntClient) and refuses a change to the feed outside a transaction, where the position would be a separate statement that a crash loses and a concurrent change commits out of order. The hook reads Memberships of any Workspace to find the one a change belongs to, which is why this package is on the closed list of raw-client packages in docs/architecture.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNeedsTransaction = errors.New("workspace feed change outside a transaction")
ErrNeedsTransaction is what Guard returns for a change to the feed made on a client that is not bound to a transaction.
Functions ¶
Types ¶
This section is empty.