RemoteNodeStoreProvider class

The hub-side face of a connected storage node: an OmnyStoreApi whose every call is forwarded over the node's control channel.

This is what makes a node indistinguishable from an in-process store as far as OmnyStoreHub is concerned. The hub routes to a StoreProvider; whether that provider is a local OmnyStore or a machine in another datacentre is not something the routing code knows or needs to.

Byte streaming. openAsset pulls the artifact over the control channel in chunks and re-exposes it as an ordinary Stream, so callers upstream see a normal byte stream regardless of how far away the bytes were. attachAsset does the reverse. Both are the DataPlaneMode.relay path, used when the node can neither presign a URL nor be reached directly; see StoreProtocol for why the other two modes are preferable when the topology allows them.

Implemented types

Constructors

RemoteNodeStoreProvider({required ProviderDescriptor descriptor, required NodeInvoker invoke, int chunkBytes = StoreProtocol.defaultChunkBytes})
Creates a proxy for the node described by descriptor.

Properties

chunkBytes int
Bytes requested per relay chunk.
final
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
invoke NodeInvoker
Forwards an action to the node.
final
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 OmnyStoreApi
The registry operations this provider can answer.
no setteroverride

Methods

asset(String id) Future<Asset?>
The asset with id, or null.
override
assetByName(String releaseId, String name) Future<Asset?>
The asset named name within releaseId, or null.
override
attachAsset({required String releaseId, required String name, required Stream<List<int>> data, int? length, String contentType = 'application/octet-stream', String? expectedSha256, String? platform, String? kind, Map<String, String> metadata = const {}}) Future<Asset>
Attaches an asset named name to releaseId, streaming data into storage.
override
checkForUpdates({required String packageReference, required Version currentVersion, ReleaseChannel? channel, String? platform}) Future<UpdateInfo>
Answers "is there a newer version of packageReference than currentVersion, on channel, for platform?".
override
close() Future<void>
Releases the provider's resources.
override
createOrganization({required String name, String? displayName, String? description, String? website, Map<String, String> metadata = const {}}) Future<Organization>
Creates an organization named name.
override
createPackage({required String projectId, required String name, String? displayName, String? description, ReleaseChannel defaultChannel = ReleaseChannel.release, List<String> platforms = const [], Map<String, String> metadata = const {}}) Future<Package>
Creates a package named name under projectId.
override
createProject({required String organizationId, required String name, String? displayName, String? description, String? repository, String? website, Map<String, String> metadata = const {}}) Future<Project>
Creates a project named name under organizationId.
override
deleteAsset(String id) Future<void>
Deletes the asset with id and its stored bytes on every provider.
override
deleteOrganization(String id, {bool force = false}) Future<void>
Deletes the organization with id and everything under it.
override
deletePackage(String id, {bool force = false}) Future<void>
Deletes the package with id. force is required if it has releases.
override
deleteProject(String id, {bool force = false}) Future<void>
Deletes the project with id. force is required if it has packages.
override
deleteRelease(String id) Future<void>
Deletes the release with id, its assets and their stored bytes.
override
downloadStats(String packageReference, {DateTime? from, DateTime? to}) Future<DownloadStats>
Aggregated download statistics for packageReference.
override
downloadTarget(String id, {Duration expiresIn = const Duration(minutes: 15)}) Future<DownloadTarget>
Where a client should fetch the asset with id from.
override
latestAny(String packageReference) Future<Release?>
The newest offerable release of packageReference on any channel.
override
latestBeta(String packageReference) Future<Release?>
The newest offerable beta release of packageReference, or null.
override
latestChannel(String packageReference, ReleaseChannel channel, {bool exact = false}) Future<Release?>
The newest release of packageReference a client on channel would accept, or null.
override
latestDev(String packageReference) Future<Release?>
The newest offerable dev release of packageReference, or null.
override
latestRelease(String packageReference) Future<Release?>
The newest offerable stable release of packageReference, or null.
override
listAssets(String releaseId) Future<List<Asset>>
Assets of releaseId, ordered by name.
override
listDownloads(String packageReference, {int? limit, DateTime? from, DateTime? to}) Future<List<DownloadRecord>>
Download records for packageReference, newest first.
override
listOrganizations() Future<List<Organization>>
Every organization, ordered by name.
override
listPackages({String? projectId, String? organizationId}) Future<List<Package>>
Packages of projectId or organizationId, or every package when both are null.
override
listProjects({String? organizationId}) Future<List<Project>>
Projects of organizationId, or every project when it is null.
override
listProviders({String? organization}) Future<List<ProviderDescriptor>>
The storage providers this store knows about.
override
listReleases(String packageReference, {ReleaseQuery query = const ReleaseQuery()}) Future<List<Release>>
Releases of packageReference matching query, newest first.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAsset(String id, {ByteRange? range}) Future<AssetDownload>
Opens the bytes of the asset with id, optionally restricted to range.
override
organization(String id) Future<Organization?>
The organization with id, or null.
override
organizationByName(String name) Future<Organization?>
The organization named name, or null.
override
package(String id) Future<Package?>
The package with id, or null.
override
packageByName(String projectId, String name) Future<Package?>
The package named name within projectId, or null.
override
project(String id) Future<Project?>
The project with id, or null.
override
projectByName(String organizationId, String name) Future<Project?>
The project named name within organizationId, or null.
override
promoteRelease(String releaseId, ReleaseChannel channel, {String? notes}) Future<Release>
Promotes releaseId to channel by publishing its artifacts under a new version carrying that channel's tag.
override
publishRelease({required String packageReference, required Version version, String? title, String? notes, String? tag, bool draft = false, Map<String, String> metadata = const {}}) Future<Release>
Publishes version of the package packageReference resolves to.
override
recordDownload({required String assetId, String? clientAddress, String? userAgent, String? principalId, String? providerId, int? bytesServed}) Future<DownloadRecord>
Records that the asset with assetId was downloaded, and increments its counter.
override
refreshDescriptor() Future<ProviderDescriptor>
Re-reads the node's descriptor over the control channel.
release(String id) Future<Release?>
The release with id, or null.
override
releaseByVersion(String packageReference, Version version) Future<Release?>
The release of packageReference at version, or null.
override
resolvePackage(String reference) Future<Package>
Resolves a package from an id or a bare name.
override
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 cached descriptor — called as the node heartbeats, so capacity and liveness stay current between registrations.
updateOrganization(String id, {String? displayName, String? description, String? website, Map<String, String>? metadata}) Future<Organization>
Updates the mutable fields of the organization with id.
override
updatePackage(String id, {String? displayName, String? description, ReleaseChannel? defaultChannel, List<String>? platforms, Map<String, String>? metadata}) Future<Package>
Updates the mutable fields of the package with id.
override
updateProject(String id, {String? displayName, String? description, String? repository, String? website, Map<String, String>? metadata}) Future<Project>
Updates the mutable fields of the project with id.
override
updateRelease(String id, {String? title, String? notes, String? tag, bool? draft, bool? yanked, String? yankedReason, Map<String, String>? metadata}) Future<Release>
Updates a release's mutable metadata: notes, title, draft state, and yanking.
override

Operators

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