LocalStoreProvider class

A StoreProvider backed by an in-process OmnyStore.

Used both by a node — where it is the node's storage — and by a hub that hosts organizations itself.

final provider = LocalStoreProvider(
  OmnyStore(
    repositories: MemoryRepositories(),
    storage: LocalObjectStorage('/var/lib/omnystore'),
  ),
  descriptor: ProviderDescriptor(
    id: 'hub-local', kind: ProviderKind.hub, servesAll: true,
  ),
);
Implemented types

Constructors

LocalStoreProvider(OmnyStore store, {required ProviderDescriptor descriptor})
Wraps store, advertising it as descriptor.

Properties

descriptor ProviderDescriptor
Who this provider is and what it serves. Refreshed as the node heartbeats, so capacity and liveness stay current.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
id String
Stable identifier, unique within a hub.
no setteroverride
isReadable bool
Whether this provider can be read from right now.
no setteroverride
isWritable bool
Whether this provider accepts new writes right now.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store OmnyStore
The registry operations this provider can answer.
final

Methods

close() Future<void>
Releases the provider's resources.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshUsage() Future<void>
Refreshes the reported storage usage from the underlying object store.
serves(String organization) bool
Whether this provider serves organization.
override
toString() String
A string representation of this object.
inherited
updateDescriptor(ProviderDescriptor descriptor) → void
Replaces the advertised descriptor — used to bind new organizations, mark the provider draining, or refresh reported usage.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

describing(OmnyStore store, {ProviderKind kind = ProviderKind.hub, String? baseUrl, Map<String, String> labels = const {}, int priority = 0, int? capacityBytes}) Future<LocalStoreProvider>
Wraps store, deriving the descriptor from the store's own configuration and its object-storage capabilities.