bundle

package
v1.43.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BundlesBasePath = storage.MustParsePath("/system/bundles")

BundlesBasePath is the storage path used for storing bundle metadata

View Source
var ModulesInfoBasePath = storage.MustParsePath("/system/modules")

Functions

func BjsonFromBinary

func BjsonFromBinary(bs []byte) (b bjson.Json, err error)

BjsonFromBinary returns a bjson.Json instance (on success) that was read from the passed byte slice. If the byte slice is a vanilla bundle's content, it'll be converted.

func EraseManifestFromStore

func EraseManifestFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) error

EraseManifestFromStore will remove the manifest from storage. This function is called when the bundle is deactivated.

func EtagStoragePath

func EtagStoragePath(name string) storage.Path

EtagStoragePath is the storage path used for the given named bundle etag.

func LegacyEraseManifestFromStore

func LegacyEraseManifestFromStore(ctx context.Context, store storage.Store, txn storage.Transaction) error

LegacyEraseManifestFromStore will erase the bundle manifest from the older single (unnamed) bundle manifest location. Deprecated: Use WriteManifestToStore and named bundles instead.

func LegacyReadRevisionFromStore

func LegacyReadRevisionFromStore(ctx context.Context, store storage.Store, txn storage.Transaction) (string, error)

LegacyReadRevisionFromStore will read the bundle manifest revision from the older single (unnamed) bundle manifest location. Deprecated: Use ReadBundleRevisionFromStore and named bundles instead.

func LegacyWriteManifestToStore

func LegacyWriteManifestToStore(ctx context.Context, store storage.Store, txn storage.Transaction, manifest bundleApi.Manifest) error

LegacyWriteManifestToStore will write the bundle manifest to the older single (unnamed) bundle manifest location. Deprecated: Use WriteManifestToStore and named bundles instead.

func ManifestStoragePath

func ManifestStoragePath(name string) storage.Path

ManifestStoragePath is the storage path used for the given named bundle manifest.

func ReadBundleEtagFromStore

func ReadBundleEtagFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (string, error)

ReadBundleEtagFromStore returns the etag for the specified bundle. If the bundle is not activated, this function will return storage NotFound error.

func ReadBundleMetadataFromStore

func ReadBundleMetadataFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (map[string]interface{}, error)

ReadBundleMetadataFromStore returns the metadata in the specified bundle. If the bundle is not activated, this function will return storage NotFound error.

func ReadBundleNamesFromStore

func ReadBundleNamesFromStore(ctx context.Context, store storage.Store, txn storage.Transaction) ([]string, error)

ReadBundleNamesFromStore will return a list of bundle names which have had their metadata stored.

func ReadBundleRevisionFromStore

func ReadBundleRevisionFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (string, error)

ReadBundleRevisionFromStore returns the revision in the specified bundle. If the bundle is not activated, this function will return storage NotFound error.

func ReadBundleRootsFromStore

func ReadBundleRootsFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) ([]string, error)

ReadBundleRootsFromStore returns the roots in the specified bundle. If the bundle is not activated, this function will return storage NotFound error.

func ReadWasmMetadataFromStore

func ReadWasmMetadataFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) ([]bundleApi.WasmResolver, error)

ReadWasmMetadataFromStore will read Wasm module resolver metadata from the store.

func ReadWasmModulesFromStore

func ReadWasmModulesFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (map[string][]byte, error)

ReadWasmModulesFromStore will write Wasm module resolver metadata from the store.

func RegisterActivator

func RegisterActivator()

Ensure our custom bundle activator is available, then set it to be the default for all bundle activations.

func WriteEtagToStore

func WriteEtagToStore(ctx context.Context, store storage.Store, txn storage.Transaction, name, etag string) error

WriteEtagToStore will write the bundle etag into the storage. This function is called when the bundle is activated.

func WriteManifestToStore

func WriteManifestToStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string, manifest bundleApi.Manifest) error

WriteManifestToStore will write the manifest into the storage. This function is called when the bundle is activated.

Types

type CustomActivator

type CustomActivator struct{}

func (*CustomActivator) Activate

func (*CustomActivator) Activate(opts *bundleApi.ActivateOpts) error

Activate the bundle(s) by loading into the given Store. This will load policies, data, and record the manifest in storage. The compiler provided will have had the polices compiled on it.

Jump to

Keyboard shortcuts

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