Documentation
¶
Index ¶
- Variables
- func BjsonFromBinary(bs []byte) (b bjson.Json, err error)
- func EraseManifestFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) error
- func EtagStoragePath(name string) storage.Path
- func LegacyEraseManifestFromStore(ctx context.Context, store storage.Store, txn storage.Transaction) error
- func LegacyReadRevisionFromStore(ctx context.Context, store storage.Store, txn storage.Transaction) (string, error)
- func LegacyWriteManifestToStore(ctx context.Context, store storage.Store, txn storage.Transaction, ...) error
- func ManifestStoragePath(name string) storage.Path
- func ReadBundleEtagFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (string, error)
- func ReadBundleMetadataFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (map[string]interface{}, error)
- func ReadBundleNamesFromStore(ctx context.Context, store storage.Store, txn storage.Transaction) ([]string, error)
- func ReadBundleRevisionFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (string, error)
- func ReadBundleRootsFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) ([]string, error)
- func ReadWasmMetadataFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) ([]bundleApi.WasmResolver, error)
- func ReadWasmModulesFromStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string) (map[string][]byte, error)
- func RegisterActivator()
- func WriteEtagToStore(ctx context.Context, store storage.Store, txn storage.Transaction, ...) error
- func WriteManifestToStore(ctx context.Context, store storage.Store, txn storage.Transaction, name string, ...) error
- type CustomActivator
Constants ¶
This section is empty.
Variables ¶
var BundlesBasePath = storage.MustParsePath("/system/bundles")
BundlesBasePath is the storage path used for storing bundle metadata
var ModulesInfoBasePath = storage.MustParsePath("/system/modules")
Functions ¶
func BjsonFromBinary ¶
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 ¶
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 ¶
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.
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.