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, ornull.override -
assetByName(
String releaseId, String name) → Future< Asset?> -
The asset named
namewithinreleaseId, ornull.override -
attachAsset(
{required String releaseId, required String name, required Stream< List< data, int? length, String contentType = 'application/octet-stream', String? expectedSha256, String? platform, String? kind, Map<int> >String, String> metadata = const {}}) → Future<Asset> -
Attaches an asset named
nametoreleaseId, streamingdatainto storage.override -
checkForUpdates(
{required String packageReference, required Version currentVersion, ReleaseChannel? channel, String? platform}) → Future< UpdateInfo> -
Answers "is there a newer version of
packageReferencethancurrentVersion, onchannel, forplatform?".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
nameunderprojectId.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
nameunderorganizationId.override -
deleteAsset(
String id) → Future< void> -
Deletes the asset with
idand its stored bytes on every provider.override -
deleteOrganization(
String id, {bool force = false}) → Future< void> -
Deletes the organization with
idand everything under it.override -
deletePackage(
String id, {bool force = false}) → Future< void> -
Deletes the package with
id.forceis required if it has releases.override -
deleteProject(
String id, {bool force = false}) → Future< void> -
Deletes the project with
id.forceis 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
idfrom.override -
latestAny(
String packageReference) → Future< Release?> -
The newest offerable release of
packageReferenceon any channel.override -
latestBeta(
String packageReference) → Future< Release?> -
The newest offerable beta release of
packageReference, ornull.override -
latestChannel(
String packageReference, ReleaseChannel channel, {bool exact = false}) → Future< Release?> -
The newest release of
packageReferencea client onchannelwould accept, ornull.override -
latestDev(
String packageReference) → Future< Release?> -
The newest offerable dev release of
packageReference, ornull.override -
latestRelease(
String packageReference) → Future< Release?> -
The newest offerable stable release of
packageReference, ornull.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
projectIdororganizationId, or every package when both arenull.override -
listProjects(
{String? organizationId}) → Future< List< Project> > -
Projects of
organizationId, or every project when it isnull.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
packageReferencematchingquery, 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 torange.override -
organization(
String id) → Future< Organization?> -
The organization with
id, ornull.override -
organizationByName(
String name) → Future< Organization?> -
The organization named
name, ornull.override -
package(
String id) → Future< Package?> -
The package with
id, ornull.override -
packageByName(
String projectId, String name) → Future< Package?> -
The package named
namewithinprojectId, ornull.override -
project(
String id) → Future< Project?> -
The project with
id, ornull.override -
projectByName(
String organizationId, String name) → Future< Project?> -
The project named
namewithinorganizationId, ornull.override -
promoteRelease(
String releaseId, ReleaseChannel channel, {String? notes}) → Future< Release> -
Promotes
releaseIdtochannelby 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
versionof the packagepackageReferenceresolves to.override -
recordDownload(
{required String assetId, String? clientAddress, String? userAgent, String? principalId, String? providerId, int? bytesServed}) → Future< DownloadRecord> -
Records that the asset with
assetIdwas 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, ornull.override -
releaseByVersion(
String packageReference, Version version) → Future< Release?> -
The release of
packageReferenceatversion, ornull.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