Documentation
¶
Index ¶
- func RegisterTypedObjectResource(mux srpc.Mux, le *logrus.Entry, b bus.Bus, ws world.WorldState, ...)
- type EngineResource
- func (r *EngineResource) AccessTypedObject(ctx context.Context, req *s4wave_world.AccessTypedObjectRequest) (*s4wave_world.AccessTypedObjectResponse, error)
- func (r *EngineResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
- func (r *EngineResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
- func (r *EngineResource) Close()
- func (r *EngineResource) ExecuteWorldOp(ctx context.Context, req *s4wave_world.ApplyWorldOpRequest) (*s4wave_world.ApplyWorldOpResponse, error)
- func (r *EngineResource) GetEngine() world.Engine
- func (r *EngineResource) GetEngineInfo(ctx context.Context, req *s4wave_world.GetEngineInfoRequest) (*s4wave_world.GetEngineInfoResponse, error)
- func (r *EngineResource) GetMux() srpc.Invoker
- func (r *EngineResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
- func (r *EngineResource) GetWorldRootSnapshot(ctx context.Context, req *s4wave_world.GetWorldRootSnapshotRequest) (*s4wave_world.WorldRootSnapshot, error)
- func (r *EngineResource) NewTransaction(ctx context.Context, req *s4wave_world.NewTransactionRequest) (*s4wave_world.NewTransactionResponse, error)
- func (r *EngineResource) SetRetainedRoot(ctx context.Context, req *s4wave_world.SetRetainedRootRequest) (*s4wave_world.SetRetainedRootResponse, error)
- func (r *EngineResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
- func (r *EngineResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
- func (r *EngineResource) WatchTypedObject(req *s4wave_world.WatchTypedObjectRequest, ...) error
- func (r *EngineResource) WatchWorldRootSnapshots(req *s4wave_world.WatchWorldRootSnapshotsRequest, ...) error
- func (r *EngineResource) WatchWorldState(req *s4wave_world.WatchWorldStateRequest, ...) error
- type GraphPathQueryResource
- func (r *GraphPathQueryResource) Close(ctx context.Context, req *s4wave_world.CloseGraphPathQueryRequest) (*s4wave_world.CloseGraphPathQueryResponse, error)
- func (r *GraphPathQueryResource) GetMux() srpc.Invoker
- func (r *GraphPathQueryResource) Next(ctx context.Context, req *s4wave_world.NextGraphPathQueryRequest) (*s4wave_world.NextGraphPathQueryResponse, error)
- type ObjectIteratorResource
- func (r *ObjectIteratorResource) Close(ctx context.Context, req *s4wave_world.CloseRequest) (*s4wave_world.CloseResponse, error)
- func (r *ObjectIteratorResource) Err(ctx context.Context, req *s4wave_world.ErrRequest) (*s4wave_world.ErrResponse, error)
- func (r *ObjectIteratorResource) GetMux() srpc.Invoker
- func (r *ObjectIteratorResource) Key(ctx context.Context, req *s4wave_world.KeyRequest) (*s4wave_world.KeyResponse, error)
- func (r *ObjectIteratorResource) Next(ctx context.Context, req *s4wave_world.NextRequest) (*s4wave_world.NextResponse, error)
- func (r *ObjectIteratorResource) Seek(ctx context.Context, req *s4wave_world.SeekRequest) (*s4wave_world.SeekResponse, error)
- func (r *ObjectIteratorResource) Valid(ctx context.Context, req *s4wave_world.ValidRequest) (*s4wave_world.ValidResponse, error)
- type ObjectStateResource
- func (r *ObjectStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
- func (r *ObjectStateResource) ApplyObjectOp(ctx context.Context, req *s4wave_world.ApplyObjectOpRequest) (*s4wave_world.ApplyObjectOpResponse, error)
- func (r *ObjectStateResource) GetKey(ctx context.Context, req *s4wave_world.GetKeyRequest) (*s4wave_world.GetKeyResponse, error)
- func (r *ObjectStateResource) GetMux() srpc.Invoker
- func (r *ObjectStateResource) GetRootRef(ctx context.Context, req *s4wave_world.GetRootRefRequest) (*s4wave_world.GetRootRefResponse, error)
- func (r *ObjectStateResource) IncrementRev(ctx context.Context, req *s4wave_world.IncrementRevRequest) (*s4wave_world.IncrementRevResponse, error)
- func (r *ObjectStateResource) SetRootRef(ctx context.Context, req *s4wave_world.SetRootRefRequest) (*s4wave_world.SetRootRefResponse, error)
- func (r *ObjectStateResource) WaitRev(ctx context.Context, req *s4wave_world.WaitRevRequest) (*s4wave_world.WaitRevResponse, error)
- type TrackedWorldState
- func (t *TrackedWorldState) AccessCayleyGraph(ctx context.Context, write bool, ...) error
- func (t *TrackedWorldState) AccessWorldState(ctx context.Context, ref *bucket.ObjectRef, ...) error
- func (t *TrackedWorldState) ApplyWorldOp(ctx context.Context, op world.Operation, opSender peer.ID) (uint64, bool, error)
- func (t *TrackedWorldState) BuildStorageCursor(ctx context.Context) (*bucket_lookup.Cursor, error)
- func (t *TrackedWorldState) Close()
- func (t *TrackedWorldState) CreateObject(ctx context.Context, key string, rootRef *bucket.ObjectRef) (world.ObjectState, error)
- func (t *TrackedWorldState) DeleteGraphObject(ctx context.Context, objKey string) error
- func (t *TrackedWorldState) DeleteGraphQuad(ctx context.Context, q world.GraphQuad) error
- func (t *TrackedWorldState) DeleteObject(ctx context.Context, key string) (bool, error)
- func (t *TrackedWorldState) GetObject(ctx context.Context, key string) (world.ObjectState, bool, error)
- func (t *TrackedWorldState) GetObjectBodiesBatchPage(ctx context.Context, keys []string, byteBudget int) ([]*world.ObjectBody, uint32, error)
- func (t *TrackedWorldState) GetObjectBodiesBatchPageWithSeqno(ctx context.Context, keys []string, byteBudget int) ([]*world.ObjectBody, uint32, uint64, error)
- func (t *TrackedWorldState) GetReadOnly() bool
- func (t *TrackedWorldState) GetSeqno(ctx context.Context) (uint64, error)
- func (t *TrackedWorldState) HasObject(ctx context.Context, key string) (bool, error)
- func (t *TrackedWorldState) IterateObjects(ctx context.Context, prefix string, reversed bool) world.ObjectIterator
- func (t *TrackedWorldState) LookupGraphQuads(ctx context.Context, filter world.GraphQuad, limit uint32) ([]world.GraphQuad, error)
- func (t *TrackedWorldState) LookupGraphQuadsBatch(ctx context.Context, filters []world.GraphQuad, limitPerFilter uint32) ([][]world.GraphQuad, error)
- func (t *TrackedWorldState) QueryGraphPath(ctx context.Context, query *world.GraphPathQuery) (*world.GraphPathQueryResult, error)
- func (t *TrackedWorldState) RenameObject(ctx context.Context, oldKey, newKey string, descendants bool) (world.ObjectState, error)
- func (t *TrackedWorldState) SetGraphQuad(ctx context.Context, q world.GraphQuad) error
- func (t *TrackedWorldState) Sync(ctx context.Context) (bool, error)
- func (t *TrackedWorldState) WaitForChanges(ctx context.Context) error
- func (t *TrackedWorldState) WaitSeqno(ctx context.Context, seqno uint64) (uint64, error)
- type TxResource
- func (r *TxResource) Commit(ctx context.Context, req *s4wave_world.CommitRequest) (*s4wave_world.CommitResponse, error)
- func (r *TxResource) CommitMutations(ctx context.Context, req *s4wave_world.CommitMutationsRequest) (_ *s4wave_world.CommitMutationsResponse, retErr error)
- func (r *TxResource) Discard(ctx context.Context, req *s4wave_world.DiscardRequest) (*s4wave_world.DiscardResponse, error)
- func (r *TxResource) Release()
- type TypedObjectResource
- func (r *TypedObjectResource) AccessTypedObject(ctx context.Context, req *s4wave_world.AccessTypedObjectRequest) (*s4wave_world.AccessTypedObjectResponse, error)
- func (r *TypedObjectResource) Close()
- func (r *TypedObjectResource) WatchTypedObject(req *s4wave_world.WatchTypedObjectRequest, ...) error
- type WorldStateOperationObserver
- type WorldStateOperationRecord
- type WorldStateResource
- func (r *WorldStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
- func (r *WorldStateResource) ApplyWorldOp(ctx context.Context, req *s4wave_world.ApplyWorldOpRequest) (*s4wave_world.ApplyWorldOpResponse, error)
- func (r *WorldStateResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
- func (r *WorldStateResource) Close()
- func (r *WorldStateResource) CompareObjectRecords(ctx context.Context, req *sdk_world.CompareObjectRecordsRequest) (*sdk_world.CompareObjectRecordsResponse, error)
- func (r *WorldStateResource) CreateObject(ctx context.Context, req *s4wave_world.CreateObjectRequest) (*s4wave_world.CreateObjectResponse, error)
- func (r *WorldStateResource) DeleteGraphObject(ctx context.Context, req *s4wave_world.DeleteGraphObjectRequest) (*s4wave_world.DeleteGraphObjectResponse, error)
- func (r *WorldStateResource) DeleteGraphQuad(ctx context.Context, req *s4wave_world.DeleteGraphQuadRequest) (*s4wave_world.DeleteGraphQuadResponse, error)
- func (r *WorldStateResource) DeleteObject(ctx context.Context, req *s4wave_world.DeleteObjectRequest) (*s4wave_world.DeleteObjectResponse, error)
- func (r *WorldStateResource) GetMux() srpc.Invoker
- func (r *WorldStateResource) GetObject(ctx context.Context, req *s4wave_world.GetObjectRequest) (*s4wave_world.GetObjectResponse, error)
- func (r *WorldStateResource) GetObjectBodiesBatch(req *s4wave_world.GetObjectBodiesBatchRequest, ...) error
- func (r *WorldStateResource) GetObjectMetadataBatch(ctx context.Context, req *s4wave_world.GetObjectMetadataBatchRequest) (*s4wave_world.GetObjectMetadataBatchResponse, error)
- func (r *WorldStateResource) GetObjectRootRefsBatch(ctx context.Context, req *s4wave_world.GetObjectRootRefsBatchRequest) (*s4wave_world.GetObjectRootRefsBatchResponse, error)
- func (r *WorldStateResource) GetReadOnly(ctx context.Context, req *s4wave_world.GetReadOnlyRequest) (*s4wave_world.GetReadOnlyResponse, error)
- func (r *WorldStateResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
- func (r *WorldStateResource) IterateObjects(ctx context.Context, req *s4wave_world.IterateObjectsRequest) (*s4wave_world.IterateObjectsResponse, error)
- func (r *WorldStateResource) ListGraphEdgeBuckets(ctx context.Context, req *s4wave_world.ListGraphEdgeBucketsRequest) (*s4wave_world.ListGraphEdgeBucketsResponse, error)
- func (r *WorldStateResource) ListObjects(ctx context.Context, req *s4wave_world.ListObjectsRequest) (*s4wave_world.ListObjectsResponse, error)
- func (r *WorldStateResource) ListObjectsWithType(ctx context.Context, req *s4wave_world.ListObjectsWithTypeRequest) (*s4wave_world.ListObjectsWithTypeResponse, error)
- func (r *WorldStateResource) LookupGraphQuads(ctx context.Context, req *s4wave_world.LookupGraphQuadsRequest) (*s4wave_world.LookupGraphQuadsResponse, error)
- func (r *WorldStateResource) LookupGraphQuadsBatch(ctx context.Context, req *s4wave_world.LookupGraphQuadsBatchRequest) (*s4wave_world.LookupGraphQuadsBatchResponse, error)
- func (r *WorldStateResource) OpenNestedWorld(ctx context.Context, req *s4wave_world.OpenNestedWorldRequest) (*s4wave_world.OpenNestedWorldResponse, error)
- func (r *WorldStateResource) OpenOuterWorld(ctx context.Context, _ *s4wave_world.OpenOuterWorldRequest) (*s4wave_world.OpenOuterWorldResponse, error)
- func (r *WorldStateResource) QueryGraphPath(ctx context.Context, req *s4wave_world.QueryGraphPathRequest) (*s4wave_world.QueryGraphPathResponse, error)
- func (r *WorldStateResource) RenameObject(ctx context.Context, req *s4wave_world.RenameObjectRequest) (*s4wave_world.RenameObjectResponse, error)
- func (r *WorldStateResource) SetGraphQuad(ctx context.Context, req *s4wave_world.SetGraphQuadRequest) (*s4wave_world.SetGraphQuadResponse, error)
- func (r *WorldStateResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
- func (r *WorldStateResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
- type WorldStateResourceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EngineResource ¶
type EngineResource struct {
// contains filtered or unexported fields
}
EngineResource wraps an Engine for resource access.
func NewEngineResource ¶
func NewEngineResource( le *logrus.Entry, b bus.Bus, w world.Engine, lookupOp world.LookupOp, engineInfo *s4wave_world.EngineInfo, opts ...WorldStateResourceOption, ) *EngineResource
NewEngineResource creates a new EngineResource.
func (*EngineResource) AccessTypedObject ¶
func (r *EngineResource) AccessTypedObject(ctx context.Context, req *s4wave_world.AccessTypedObjectRequest) (*s4wave_world.AccessTypedObjectResponse, error)
AccessTypedObject looks up an object, determines its type, and returns a typed resource.
func (*EngineResource) AccessWorldState ¶
func (r *EngineResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
AccessWorldState builds a bucket lookup cursor with an optional ref.
func (*EngineResource) BuildStorageCursor ¶
func (r *EngineResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
BuildStorageCursor builds a cursor to the world storage with an empty ref.
func (*EngineResource) Close ¶
func (r *EngineResource) Close()
Close releases typed object handles owned by this resource mount. It leaves the supplied engine and its storage running.
func (*EngineResource) ExecuteWorldOp ¶
func (r *EngineResource) ExecuteWorldOp(ctx context.Context, req *s4wave_world.ApplyWorldOpRequest) (*s4wave_world.ApplyWorldOpResponse, error)
ExecuteWorldOp delegates transaction acceptance and stale-base retry to World.
func (*EngineResource) GetEngine ¶
func (r *EngineResource) GetEngine() world.Engine
GetEngine returns the capability already granted by this Engine Resource.
func (*EngineResource) GetEngineInfo ¶
func (r *EngineResource) GetEngineInfo(ctx context.Context, req *s4wave_world.GetEngineInfoRequest) (*s4wave_world.GetEngineInfoResponse, error)
GetEngineInfo returns information about the world engine.
func (*EngineResource) GetMux ¶
func (r *EngineResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*EngineResource) GetSeqno ¶
func (r *EngineResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
GetSeqno returns the current seqno of the world state.
func (*EngineResource) GetWorldRootSnapshot ¶ added in v0.51.7
func (r *EngineResource) GetWorldRootSnapshot(ctx context.Context, req *s4wave_world.GetWorldRootSnapshotRequest) (*s4wave_world.WorldRootSnapshot, error)
GetWorldRootSnapshot returns the current committed World root.
func (*EngineResource) NewTransaction ¶
func (r *EngineResource) NewTransaction(ctx context.Context, req *s4wave_world.NewTransactionRequest) (*s4wave_world.NewTransactionResponse, error)
NewTransaction creates a new transaction against the world state.
func (*EngineResource) SetRetainedRoot ¶
func (r *EngineResource) SetRetainedRoot(ctx context.Context, req *s4wave_world.SetRetainedRootRequest) (*s4wave_world.SetRetainedRootResponse, error)
SetRetainedRoot retains a World root in an engine that supports retention.
func (*EngineResource) Sync ¶ added in v0.52.0
func (r *EngineResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
Sync fences durable storage and advances the durable head via the engine.
func (*EngineResource) WaitSeqno ¶
func (r *EngineResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
WaitSeqno waits for the seqno of the world state to be >= value.
func (*EngineResource) WatchTypedObject ¶
func (r *EngineResource) WatchTypedObject(req *s4wave_world.WatchTypedObjectRequest, stream s4wave_world.SRPCTypedObjectResourceService_WatchTypedObjectStream) error
WatchTypedObject forwards standing typed demand under the Engine mount's authority.
func (*EngineResource) WatchWorldRootSnapshots ¶ added in v0.51.7
func (r *EngineResource) WatchWorldRootSnapshots( req *s4wave_world.WatchWorldRootSnapshotsRequest, stream s4wave_world.SRPCEngineResourceService_WatchWorldRootSnapshotsStream, ) error
WatchWorldRootSnapshots streams committed World root snapshots.
func (*EngineResource) WatchWorldState ¶
func (r *EngineResource) WatchWorldState( req *s4wave_world.WatchWorldStateRequest, stream s4wave_world.SRPCWatchWorldStateResourceService_WatchWorldStateStream, ) error
WatchWorldState implements the streaming watch RPC. Change detection starts immediately as client accesses resources.
type GraphPathQueryResource ¶ added in v0.51.6
type GraphPathQueryResource struct {
// contains filtered or unexported fields
}
GraphPathQueryResource wraps bounded graph path query results.
func NewGraphPathQueryResource ¶ added in v0.51.6
func NewGraphPathQueryResource( le *logrus.Entry, b bus.Bus, result *world.GraphPathQueryResult, pageSize uint32, ) *GraphPathQueryResource
NewGraphPathQueryResource creates a graph path query resource.
func (*GraphPathQueryResource) Close ¶ added in v0.51.6
func (r *GraphPathQueryResource) Close(ctx context.Context, req *s4wave_world.CloseGraphPathQueryRequest) (*s4wave_world.CloseGraphPathQueryResponse, error)
Close closes the graph path query resource.
func (*GraphPathQueryResource) GetMux ¶ added in v0.51.6
func (r *GraphPathQueryResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*GraphPathQueryResource) Next ¶ added in v0.51.6
func (r *GraphPathQueryResource) Next(ctx context.Context, req *s4wave_world.NextGraphPathQueryRequest) (*s4wave_world.NextGraphPathQueryResponse, error)
Next returns the next page of path query results.
type ObjectIteratorResource ¶
type ObjectIteratorResource struct {
// contains filtered or unexported fields
}
ObjectIteratorResource wraps an ObjectIterator for resource access.
func NewObjectIteratorResource ¶
func NewObjectIteratorResource(le *logrus.Entry, b bus.Bus, iter world.ObjectIterator) *ObjectIteratorResource
NewObjectIteratorResource creates a new ObjectIteratorResource.
func (*ObjectIteratorResource) Close ¶
func (r *ObjectIteratorResource) Close(ctx context.Context, req *s4wave_world.CloseRequest) (*s4wave_world.CloseResponse, error)
Close closes the iterator.
func (*ObjectIteratorResource) Err ¶
func (r *ObjectIteratorResource) Err(ctx context.Context, req *s4wave_world.ErrRequest) (*s4wave_world.ErrResponse, error)
Err returns any error that has closed the iterator.
func (*ObjectIteratorResource) GetMux ¶
func (r *ObjectIteratorResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*ObjectIteratorResource) Key ¶
func (r *ObjectIteratorResource) Key(ctx context.Context, req *s4wave_world.KeyRequest) (*s4wave_world.KeyResponse, error)
Key returns the current entry key, or empty if not valid.
func (*ObjectIteratorResource) Next ¶
func (r *ObjectIteratorResource) Next(ctx context.Context, req *s4wave_world.NextRequest) (*s4wave_world.NextResponse, error)
Next advances to the next entry and returns Valid.
func (*ObjectIteratorResource) Seek ¶
func (r *ObjectIteratorResource) Seek(ctx context.Context, req *s4wave_world.SeekRequest) (*s4wave_world.SeekResponse, error)
Seek moves the iterator to the first key >= the provided key (or <= in reverse mode).
func (*ObjectIteratorResource) Valid ¶
func (r *ObjectIteratorResource) Valid(ctx context.Context, req *s4wave_world.ValidRequest) (*s4wave_world.ValidResponse, error)
Valid returns if the iterator points to a valid entry.
type ObjectStateResource ¶
type ObjectStateResource struct {
// contains filtered or unexported fields
}
ObjectStateResource wraps an ObjectState for resource access.
func NewObjectStateResource ¶
func NewObjectStateResource(le *logrus.Entry, b bus.Bus, obj world.ObjectState, lookupOp world.LookupOp, opts ...WorldStateResourceOption) *ObjectStateResource
NewObjectStateResource creates a new ObjectStateResource.
It borrows obj for the resource lifetime. The caller must release obj after retiring the resource. lookupOp may be nil.
func (*ObjectStateResource) AccessWorldState ¶
func (r *ObjectStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
AccessWorldState builds a bucket lookup cursor with an optional ref.
func (*ObjectStateResource) ApplyObjectOp ¶
func (r *ObjectStateResource) ApplyObjectOp(ctx context.Context, req *s4wave_world.ApplyObjectOpRequest) (*s4wave_world.ApplyObjectOpResponse, error)
ApplyObjectOp applies a batch operation at the object level.
func (*ObjectStateResource) GetKey ¶
func (r *ObjectStateResource) GetKey(ctx context.Context, req *s4wave_world.GetKeyRequest) (*s4wave_world.GetKeyResponse, error)
GetKey returns the key identifier of the object.
func (*ObjectStateResource) GetMux ¶
func (r *ObjectStateResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*ObjectStateResource) GetRootRef ¶
func (r *ObjectStateResource) GetRootRef(ctx context.Context, req *s4wave_world.GetRootRefRequest) (*s4wave_world.GetRootRefResponse, error)
GetRootRef returns the root reference of the object.
func (*ObjectStateResource) IncrementRev ¶
func (r *ObjectStateResource) IncrementRev(ctx context.Context, req *s4wave_world.IncrementRevRequest) (*s4wave_world.IncrementRevResponse, error)
IncrementRev increments the revision of the object.
func (*ObjectStateResource) SetRootRef ¶
func (r *ObjectStateResource) SetRootRef(ctx context.Context, req *s4wave_world.SetRootRefRequest) (*s4wave_world.SetRootRefResponse, error)
SetRootRef updates the root reference of the object.
func (*ObjectStateResource) WaitRev ¶
func (r *ObjectStateResource) WaitRev(ctx context.Context, req *s4wave_world.WaitRevRequest) (*s4wave_world.WaitRevResponse, error)
WaitRev waits until the object rev is >= the specified revision.
type TrackedWorldState ¶
type TrackedWorldState struct {
// contains filtered or unexported fields
}
TrackedWorldState wraps a WorldState and records all access patterns. Immediately starts change detection as accesses are recorded.
func NewTrackedWorldState ¶
func NewTrackedWorldState(ws world.WorldState, watchWs world.WorldState, initialSeqno uint64, ctx context.Context) *TrackedWorldState
NewTrackedWorldState creates a new TrackedWorldState.
func (*TrackedWorldState) AccessCayleyGraph ¶
func (t *TrackedWorldState) AccessCayleyGraph(ctx context.Context, write bool, cb func(ctx context.Context, h world.CayleyHandle) error) error
func (*TrackedWorldState) AccessWorldState ¶
func (t *TrackedWorldState) AccessWorldState(ctx context.Context, ref *bucket.ObjectRef, cb func(*bucket_lookup.Cursor) error) error
func (*TrackedWorldState) ApplyWorldOp ¶
func (*TrackedWorldState) BuildStorageCursor ¶
func (t *TrackedWorldState) BuildStorageCursor(ctx context.Context) (*bucket_lookup.Cursor, error)
func (*TrackedWorldState) Close ¶
func (t *TrackedWorldState) Close()
Close stops the change detection routine.
func (*TrackedWorldState) CreateObject ¶
func (t *TrackedWorldState) CreateObject(ctx context.Context, key string, rootRef *bucket.ObjectRef) (world.ObjectState, error)
func (*TrackedWorldState) DeleteGraphObject ¶
func (t *TrackedWorldState) DeleteGraphObject(ctx context.Context, objKey string) error
func (*TrackedWorldState) DeleteGraphQuad ¶
func (*TrackedWorldState) DeleteObject ¶
func (*TrackedWorldState) GetObject ¶
func (t *TrackedWorldState) GetObject(ctx context.Context, key string) (world.ObjectState, bool, error)
func (*TrackedWorldState) GetObjectBodiesBatchPage ¶ added in v0.57.0
func (t *TrackedWorldState) GetObjectBodiesBatchPage(ctx context.Context, keys []string, byteBudget int) ([]*world.ObjectBody, uint32, error)
GetObjectBodiesBatchPage forwards budgeted body paging to the wrapped state.
func (*TrackedWorldState) GetObjectBodiesBatchPageWithSeqno ¶ added in v0.57.0
func (t *TrackedWorldState) GetObjectBodiesBatchPageWithSeqno(ctx context.Context, keys []string, byteBudget int) ([]*world.ObjectBody, uint32, uint64, error)
GetObjectBodiesBatchPageWithSeqno forwards body paging and the wrapped transaction seqno.
func (*TrackedWorldState) GetReadOnly ¶
func (t *TrackedWorldState) GetReadOnly() bool
func (*TrackedWorldState) GetSeqno ¶
func (t *TrackedWorldState) GetSeqno(ctx context.Context) (uint64, error)
func (*TrackedWorldState) HasObject ¶ added in v0.53.0
HasObject forwards the object-existence query to the wrapped state.
func (*TrackedWorldState) IterateObjects ¶
func (t *TrackedWorldState) IterateObjects(ctx context.Context, prefix string, reversed bool) world.ObjectIterator
func (*TrackedWorldState) LookupGraphQuads ¶
func (*TrackedWorldState) LookupGraphQuadsBatch ¶ added in v0.51.7
func (*TrackedWorldState) QueryGraphPath ¶ added in v0.51.6
func (t *TrackedWorldState) QueryGraphPath(ctx context.Context, query *world.GraphPathQuery) (*world.GraphPathQueryResult, error)
func (*TrackedWorldState) RenameObject ¶
func (t *TrackedWorldState) RenameObject(ctx context.Context, oldKey, newKey string, descendants bool) (world.ObjectState, error)
func (*TrackedWorldState) SetGraphQuad ¶
func (*TrackedWorldState) Sync ¶ added in v0.52.0
func (t *TrackedWorldState) Sync(ctx context.Context) (bool, error)
Sync fences the block writes made through the tracked world state durable.
func (*TrackedWorldState) WaitForChanges ¶
func (t *TrackedWorldState) WaitForChanges(ctx context.Context) error
WaitForChanges waits until any tracked resource changes. Returns nil when changes detected, error on failure or context cancel.
type TxResource ¶
type TxResource struct {
// WorldStateResource serves transaction-scoped World operations.
*WorldStateResource
// contains filtered or unexported fields
}
TxResource wraps a Tx for resource access. It embeds WorldStateResource and adds Commit/Discard operations.
func NewTxResource ¶
func NewTxResource( le *logrus.Entry, b bus.Bus, tx world.Tx, lookupOp world.LookupOp, engine world.Engine, opts ...WorldStateResourceOption, ) *TxResource
NewTxResource creates a new TxResource.
engine is optional - if provided, TypedObjectResourceService is registered on the mux.
func (*TxResource) Commit ¶
func (r *TxResource) Commit(ctx context.Context, req *s4wave_world.CommitRequest) (*s4wave_world.CommitResponse, error)
Commit commits the transaction.
func (*TxResource) CommitMutations ¶ added in v0.57.2
func (r *TxResource) CommitMutations( ctx context.Context, req *s4wave_world.CommitMutationsRequest, ) (_ *s4wave_world.CommitMutationsResponse, retErr error)
CommitMutations applies ordered mutations and commits the transaction.
func (*TxResource) Discard ¶
func (r *TxResource) Discard(ctx context.Context, req *s4wave_world.DiscardRequest) (*s4wave_world.DiscardResponse, error)
Discard discards the transaction without committing changes.
func (*TxResource) Release ¶ added in v0.51.7
func (r *TxResource) Release()
Release discards the underlying transaction exactly once.
type TypedObjectResource ¶
type TypedObjectResource struct {
// contains filtered or unexported fields
}
TypedObjectResource implements TypedObjectResourceService. It provides access to typed resources from world objects.
func NewTypedObjectResource ¶
func NewTypedObjectResource(le *logrus.Entry, b bus.Bus, ws world.WorldState, engine world.Engine, opts ...WorldStateResourceOption) *TypedObjectResource
NewTypedObjectResource creates typed access with trusted mount options.
func NewTypedObjectResourceWithContext ¶ added in v0.52.0
func NewTypedObjectResourceWithContext(ctx context.Context, le *logrus.Entry, b bus.Bus, ws world.WorldState, engine world.Engine, opts ...WorldStateResourceOption) *TypedObjectResource
NewTypedObjectResourceWithContext binds typed access to the mount lifecycle and scope.
func (*TypedObjectResource) AccessTypedObject ¶
func (r *TypedObjectResource) AccessTypedObject(ctx context.Context, req *s4wave_world.AccessTypedObjectRequest) (*s4wave_world.AccessTypedObjectResponse, error)
AccessTypedObject looks up an object, determines its type, and returns a typed resource. Handles special prefixes:
- plugin-dist/{plugin-id}: accesses the plugin's distribution filesystem
- plugin-assets/{plugin-id}: accesses the plugin's assets filesystem.
The returned child owns its typed handle until Resource release.
func (*TypedObjectResource) Close ¶ added in v0.52.0
func (r *TypedObjectResource) Close()
Close releases shared typed object handles owned by this resource mount.
func (*TypedObjectResource) WatchTypedObject ¶
func (r *TypedObjectResource) WatchTypedObject(req *s4wave_world.WatchTypedObjectRequest, stream s4wave_world.SRPCTypedObjectResourceService_WatchTypedObjectStream) error
WatchTypedObject retains scoped handler demand and revokes obsolete children.
type WorldStateOperationObserver ¶ added in v0.51.7
type WorldStateOperationObserver func(WorldStateOperationRecord)
WorldStateOperationObserver observes WorldStateResource operation records.
type WorldStateOperationRecord ¶ added in v0.51.7
type WorldStateOperationRecord struct {
// Name is the WorldStateResource method name.
Name string
// Duration is the elapsed wall-clock duration.
Duration time.Duration
// Error is set when the operation returned an error.
Error string
// FilterCount is the number of graph filters in the request.
FilterCount int
// Limit is the relevant request limit.
Limit int
// ResultSetCount is the number of result groups returned.
ResultSetCount int
// ResultQuadCount is the total number of graph quads returned.
ResultQuadCount int
// StartKeyCount is the number of graph path start keys.
StartKeyCount int
// StepCount is the number of graph path steps.
StepCount int
// PageSize is the requested page size for resource-backed operations.
PageSize int
// ResultObjectCount is the number of object keys returned by the operation.
ResultObjectCount int
// ResourceCreated indicates that the operation attached a resource.
ResourceCreated bool
// ReadCounterSnapshot is the block read-counter snapshot for the operation.
ReadCounterSnapshot block.ReadCounterSnapshot
}
WorldStateOperationRecord describes one WorldStateResource operation.
type WorldStateResource ¶
type WorldStateResource struct {
// contains filtered or unexported fields
}
WorldStateResource wraps a WorldState for resource access.
func NewEngineWorldStateResource ¶ added in v0.51.2
func NewEngineWorldStateResource( le *logrus.Entry, b bus.Bus, ws world.WorldState, lookupOp world.LookupOp, engine world.Engine, opts ...WorldStateResourceOption, ) *WorldStateResource
NewEngineWorldStateResource creates a WorldStateResource with typed object access.
func NewWorldStateResource ¶
func NewWorldStateResource( le *logrus.Entry, b bus.Bus, ws world.WorldState, lookupOp world.LookupOp, opts ...WorldStateResourceOption, ) *WorldStateResource
NewWorldStateResource creates a new WorldStateResource.
lookupOp may be nil.
func (*WorldStateResource) AccessWorldState ¶
func (r *WorldStateResource) AccessWorldState(ctx context.Context, req *s4wave_world.AccessWorldStateRequest) (*s4wave_world.AccessWorldStateResponse, error)
AccessWorldState builds a bucket lookup cursor with an optional ref.
func (*WorldStateResource) ApplyWorldOp ¶
func (r *WorldStateResource) ApplyWorldOp(ctx context.Context, req *s4wave_world.ApplyWorldOpRequest) (*s4wave_world.ApplyWorldOpResponse, error)
ApplyWorldOp applies a batch operation at the world level.
func (*WorldStateResource) BuildStorageCursor ¶
func (r *WorldStateResource) BuildStorageCursor(ctx context.Context, req *s4wave_world.BuildStorageCursorRequest) (*s4wave_world.BuildStorageCursorResponse, error)
BuildStorageCursor builds a cursor to the world storage with an empty ref.
func (*WorldStateResource) Close ¶
func (r *WorldStateResource) Close()
Close withdraws typed demand owned by this World snapshot mount.
func (*WorldStateResource) CompareObjectRecords ¶
func (r *WorldStateResource) CompareObjectRecords(ctx context.Context, req *sdk_world.CompareObjectRecordsRequest) (*sdk_world.CompareObjectRecordsResponse, error)
CompareObjectRecords compares immutable KV roots within the supplied snapshot. Missing prior roots and bounded comparisons request full reevaluation.
func (*WorldStateResource) CreateObject ¶
func (r *WorldStateResource) CreateObject(ctx context.Context, req *s4wave_world.CreateObjectRequest) (*s4wave_world.CreateObjectResponse, error)
CreateObject creates an object with a key and initial root ref.
func (*WorldStateResource) DeleteGraphObject ¶
func (r *WorldStateResource) DeleteGraphObject(ctx context.Context, req *s4wave_world.DeleteGraphObjectRequest) (*s4wave_world.DeleteGraphObjectResponse, error)
DeleteGraphObject deletes all quads with Subject or Object set to value.
func (*WorldStateResource) DeleteGraphQuad ¶
func (r *WorldStateResource) DeleteGraphQuad(ctx context.Context, req *s4wave_world.DeleteGraphQuadRequest) (*s4wave_world.DeleteGraphQuadResponse, error)
DeleteGraphQuad deletes a quad from the graph store.
func (*WorldStateResource) DeleteObject ¶
func (r *WorldStateResource) DeleteObject(ctx context.Context, req *s4wave_world.DeleteObjectRequest) (*s4wave_world.DeleteObjectResponse, error)
DeleteObject deletes an object and associated graph quads by ID.
func (*WorldStateResource) GetMux ¶
func (r *WorldStateResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*WorldStateResource) GetObject ¶
func (r *WorldStateResource) GetObject(ctx context.Context, req *s4wave_world.GetObjectRequest) (*s4wave_world.GetObjectResponse, error)
GetObject looks up an object by key.
func (*WorldStateResource) GetObjectBodiesBatch ¶ added in v0.57.0
func (r *WorldStateResource) GetObjectBodiesBatch( req *s4wave_world.GetObjectBodiesBatchRequest, strm s4wave_world.SRPCWorldStateResourceService_GetObjectBodiesBatchStream, ) error
GetObjectBodiesBatch streams serialized object bodies for object keys.
Each response is one page within the encoded body budget, in request order, with the World seqno the page was read at. The stream ends after the page holding the last key.
func (*WorldStateResource) GetObjectMetadataBatch ¶ added in v0.51.6
func (r *WorldStateResource) GetObjectMetadataBatch(ctx context.Context, req *s4wave_world.GetObjectMetadataBatchRequest) (*s4wave_world.GetObjectMetadataBatchResponse, error)
GetObjectMetadataBatch returns graph metadata for object keys.
func (*WorldStateResource) GetObjectRootRefsBatch ¶ added in v0.51.7
func (r *WorldStateResource) GetObjectRootRefsBatch(ctx context.Context, req *s4wave_world.GetObjectRootRefsBatchRequest) (*s4wave_world.GetObjectRootRefsBatchResponse, error)
GetObjectRootRefsBatch returns root references for object keys.
func (*WorldStateResource) GetReadOnly ¶
func (r *WorldStateResource) GetReadOnly(ctx context.Context, req *s4wave_world.GetReadOnlyRequest) (*s4wave_world.GetReadOnlyResponse, error)
GetReadOnly returns if the world state is read-only.
func (*WorldStateResource) GetSeqno ¶
func (r *WorldStateResource) GetSeqno(ctx context.Context, req *s4wave_world.GetSeqnoRequest) (*s4wave_world.GetSeqnoResponse, error)
GetSeqno returns the current seqno of the world state.
func (*WorldStateResource) IterateObjects ¶
func (r *WorldStateResource) IterateObjects(ctx context.Context, req *s4wave_world.IterateObjectsRequest) (*s4wave_world.IterateObjectsResponse, error)
IterateObjects returns an iterator with the given object key prefix.
func (*WorldStateResource) ListGraphEdgeBuckets ¶ added in v0.51.7
func (r *WorldStateResource) ListGraphEdgeBuckets(ctx context.Context, req *s4wave_world.ListGraphEdgeBucketsRequest) (*s4wave_world.ListGraphEdgeBucketsResponse, error)
ListGraphEdgeBuckets lists grouped inbound/outbound graph edge buckets.
func (*WorldStateResource) ListObjects ¶
func (r *WorldStateResource) ListObjects(ctx context.Context, req *s4wave_world.ListObjectsRequest) (*s4wave_world.ListObjectsResponse, error)
ListObjects returns one page of objects and their metadata in key order. With a delimiter, keys below the next path segment are grouped into prefixes, and the iterator seeks past each group instead of reading its keys.
func (*WorldStateResource) ListObjectsWithType ¶
func (r *WorldStateResource) ListObjectsWithType(ctx context.Context, req *s4wave_world.ListObjectsWithTypeRequest) (*s4wave_world.ListObjectsWithTypeResponse, error)
ListObjectsWithType lists object keys with the given type identifier.
func (*WorldStateResource) LookupGraphQuads ¶
func (r *WorldStateResource) LookupGraphQuads(ctx context.Context, req *s4wave_world.LookupGraphQuadsRequest) (*s4wave_world.LookupGraphQuadsResponse, error)
LookupGraphQuads searches for graph quads in the store.
func (*WorldStateResource) LookupGraphQuadsBatch ¶ added in v0.51.6
func (r *WorldStateResource) LookupGraphQuadsBatch(ctx context.Context, req *s4wave_world.LookupGraphQuadsBatchRequest) (*s4wave_world.LookupGraphQuadsBatchResponse, error)
LookupGraphQuadsBatch searches for graph quads using bounded indexed filters.
func (*WorldStateResource) OpenNestedWorld ¶
func (r *WorldStateResource) OpenNestedWorld(ctx context.Context, req *s4wave_world.OpenNestedWorldRequest) (*s4wave_world.OpenNestedWorldResponse, error)
OpenNestedWorld opens a typed object's immutable nested World snapshot. The returned resource owns its snapshot pin independently of the outer state.
func (*WorldStateResource) OpenOuterWorld ¶
func (r *WorldStateResource) OpenOuterWorld(ctx context.Context, _ *s4wave_world.OpenOuterWorldRequest) (*s4wave_world.OpenOuterWorldResponse, error)
OpenOuterWorld grants the Space Engine that authorized this nested World. The Engine reads current Space state and writes under the same session authority, including World ops. It outlives this nested state.
func (*WorldStateResource) QueryGraphPath ¶ added in v0.51.6
func (r *WorldStateResource) QueryGraphPath(ctx context.Context, req *s4wave_world.QueryGraphPathRequest) (*s4wave_world.QueryGraphPathResponse, error)
QueryGraphPath creates a resource for a bounded graph path query.
func (*WorldStateResource) RenameObject ¶
func (r *WorldStateResource) RenameObject(ctx context.Context, req *s4wave_world.RenameObjectRequest) (*s4wave_world.RenameObjectResponse, error)
RenameObject renames an object key and associated graph quads.
func (*WorldStateResource) SetGraphQuad ¶
func (r *WorldStateResource) SetGraphQuad(ctx context.Context, req *s4wave_world.SetGraphQuadRequest) (*s4wave_world.SetGraphQuadResponse, error)
SetGraphQuad sets a quad in the graph store.
func (*WorldStateResource) Sync ¶ added in v0.52.0
func (r *WorldStateResource) Sync(ctx context.Context, req *s4wave_world.SyncRequest) (*s4wave_world.SyncResponse, error)
Sync fences the block writes made through this world state durable.
func (*WorldStateResource) WaitSeqno ¶
func (r *WorldStateResource) WaitSeqno(ctx context.Context, req *s4wave_world.WaitSeqnoRequest) (*s4wave_world.WaitSeqnoResponse, error)
WaitSeqno waits for the seqno of the world state to be >= value.
type WorldStateResourceOption ¶ added in v0.51.7
type WorldStateResourceOption func(*WorldStateResource)
WorldStateResourceOption configures a WorldStateResource.
func WithEngineID ¶
func WithEngineID(engineID string) WorldStateResourceOption
WithEngineID binds typed access to the registry scope selected by the granting mount. An empty ID binds global scope; callers cannot override a trusted binding.
func WithSessionPeerID ¶ added in v0.56.1
func WithSessionPeerID(sessionPeerID peer.ID) WorldStateResourceOption
WithSessionPeerID binds typed access and operation execution to the authenticated session peer.
func WithWorldStateOperationObserver ¶ added in v0.51.7
func WithWorldStateOperationObserver(observer WorldStateOperationObserver) WorldStateResourceOption
WithWorldStateOperationObserver configures WorldStateResource operation accounting.