objectstoreplugin

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package objectstoreplugin implements the object-store plugin API on GCS or S3 object storage, using the plugin's own credentials.

Snapshot files are stored as zstd-compressed objects named <file>.zstd under the snapshot URI, except the manifest, which is stored as is. This is the layout atelet has always written, so snapshots taken before the plugin existed stay readable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetPlugin

type AssetPlugin struct {
	objectstorev1.UnimplementedAssetProviderServer
	// contains filtered or unexported fields
}

AssetPlugin serves AssetProvider on an object storage client. It reads URIs of its backend's scheme (gs:// on GCS, s3:// on S3) as <bucket>/<object>, and returns InvalidArgument for any other scheme without reading anything: a gs:// bucket name read on S3 names someone else's bucket, or none. atelet then reads a gs:// asset anonymously.

It downloads each asset into stagingDir, which must be private to the plugin, and copies it to the caller's file only once its size and sha256 check out (see assetfetch.Stager). The caller can therefore never read bytes it did not pin, such as a snapshot's.

func NewAssetPlugin

func NewAssetPlugin(client objectstorage.ObjectStorage, scheme, root, stagingDir string, stagingCapacity int64) (*AssetPlugin, error)

NewAssetPlugin returns an AssetPlugin that serves URIs of scheme ("gs" or "s3", client's backend) from client, writes caller files only below root and stages downloads in stagingDir, which must not be below root, holding at most stagingCapacity bytes there at once.

func (*AssetPlugin) FetchAsset

FetchAsset downloads the object at asset_uri into the staging directory and, if it is at most max_bytes long and hashes to sha256, copies it into the existing file at write_path (see assetfetch.Stager.Fetch).

type ControlPlugin

type ControlPlugin struct {
	objectstorev1.UnimplementedControlProviderServer
	// contains filtered or unexported fields
}

ControlPlugin serves ControlProvider on an object store.

func NewControlPlugin

func NewControlPlugin(store objectstore.Store) *ControlPlugin

NewControlPlugin returns a ControlPlugin backed by store.

func (*ControlPlugin) CleanupSnapshot

CleanupSnapshot deletes every object under the given prefix.

func (*ControlPlugin) CopySnapshot

CopySnapshot copies every object of src_uri to dst_uri.

type NodePlugin

type NodePlugin struct {
	objectstorev1.UnimplementedNodeProviderServer
	// contains filtered or unexported fields
}

NodePlugin serves NodeProvider on an object storage client.

func NewNodePlugin

func NewNodePlugin(gcsClient objectstorage.ObjectStorage, root string) (*NodePlugin, error)

NewNodePlugin returns a NodePlugin that reads and writes local files only below root.

func (*NodePlugin) FetchSnapshot

FetchSnapshot downloads the requested snapshot files into write_path.

func (*NodePlugin) UploadSnapshot

UploadSnapshot uploads the requested files from local_path into the snapshot.

Directories

Path Synopsis
Package objectstoreplugintest provides object-store plugin clients that call the object-store plugins directly, without a socket, for tests that drive atelet or ate-api-server through the real plugin.
Package objectstoreplugintest provides object-store plugin clients that call the object-store plugins directly, without a socket, for tests that drive atelet or ate-api-server through the real plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL