Crate junobuild_satellite

Crate junobuild_satellite 

Source
Expand description

§JunoBuild-Satellite

junobuild-satellite is a Rust crate that extends the functionality of Juno satellites. This library is intended for developers looking to enhance the capabilities of Juno.

§Getting Started

To include junobuild-satellite in your Rust project, add it as a dependency in your Cargo.toml:

[dependencies]
junobuild-satellite = "*"

Replace "*" with the specific version you want to use, or omit the version to always use the latest version.

§Usage

The primary feature of junobuild-satellite is the include_satellite! macro. It allows you to include all the stock satellite features required for a Juno satellite to work efficiently.

Example usage:

use junobuild_satellite::include_satellite;
include_satellite!();

By using the include_satellite! macro, you can integrate all the necessary features into your satellite project.

§Features

  • on_set_doc: Enables the on_set_doc feature.
  • on_set_many_docs: Enables the on_set_many_docs feature.
  • on_delete_doc: Enables the on_delete_doc feature.
  • on_delete_many_docs: Enables the on_delete_many_docs feature.
  • on_delete_filtered_docs: Enables the on_delete_filtered_docs feature.
  • on_upload_asset: Enables the on_upload_asset feature.
  • on_delete_asset: Enables the on_delete_asset feature.
  • on_delete_many_assets: Enables the on_delete_many_assets feature.
  • on_delete_filtered_assets: Enables the on_delete_filtered_assets feature.
  • on_init: Enables the on_init feature.
  • on_post_upgrade: Enables the on_post_upgrade feature.
  • assert_set_doc: Enables the assert_set_doc feature.
  • assert_delete_doc: Enables the assert_delete_doc feature.
  • assert_upload_asset: Enables the assert_upload_asset feature.
  • assert_delete_asset: Enables the assert_delete_asset feature.

These features are enabled by default and do not have additional dependencies.

Here are some useful links:

  • Looking to get started? Check out the documentation.
  • Have a look at the LICENSE for information about licensing and limitation.
  • Have questions, comments or feedback? Join our Discord or OpenChat.

Modules§

internal

Macros§

include_satellite
Include the stock Juno satellite features into your Juno application.

Structs§

DelDoc
Parameters for deleting a document.
Doc
Represents a document in a collection’s store.
DocAssertDelete
DocAssertSet
DocContext
DocUpsert
HookContext
A generic context struct used in Juno satellite hooks.
Log
SetDoc
Parameters for setting a document.

Enums§

LogLevel

Functions§

caller
Returns the principal of the caller that invoked the current satellite.
count_assets_store
Count assets in a collection.
count_collection_assets_store
Count the number of assets in a collection’s store.
count_collection_docs_store
Count the number of documents in a collection’s store.
count_docs_store
Count documents in a collection.
debug
Logs a debug-level message.
debug_with_data
Logs a debug-level message with additional serialized data.
delete_asset_store
Delete an asset from a collection’s store.
delete_assets_store
Delete multiple assets from a collection.
delete_doc_store
Delete a document from a collection’s store.
delete_docs_store
Delete multiple documents from a collection’s store.
delete_filtered_assets_store
Delete multiple assets from a collection’s store based on filter criteria.
delete_filtered_docs_store
Delete multiple documents from a collection’s store based on filter criteria.
error
Logs an error message.
error_with_data
Logs an error message with additional serialized data.
get_admin_controllers
Retrieve the current admin controllers for a Satellite.
get_asset_store
Get an asset from a collection’s store.
get_content_chunks_store
Get content chunks of an asset.
get_controllers
Retrieve the controllers of the Satellite.
get_doc_store
Get a document from a collection’s store.
id
Returns the principal of the current satellite.
info
Logs an informational message.
info_with_data
Logs an informational message with additional serialized data.
list_assets_store
List assets in a collection.
list_docs_store
List documents in a collection.
log
Logs a message at the Info level.
log_with_data
Logs a message at the Info level with additional serialized data.
random
Generates a random i32 number.
set_asset_handler
Handles the setting of an asset within the store. This function performs various checks and operations to ensure the asset can be set and updated correctly.
set_asset_token_store
Set or update an access token for an asset in a collection’s store.
set_doc_store
Set a document in a collection’s store.
warn
Logs a warning message.
warn_with_data
Logs a warning message with additional serialized data.

Type Aliases§

AssertDeleteAssetContext
A type alias for the context used in the assert_delete_asset satellite hook.
AssertDeleteDocContext
A type alias for the context used in the assert_delete_doc satellite hook.
AssertSetDocContext
A type alias for the context used in the assert_set_doc satellite hook.
AssertUploadAssetContext
A type alias for the context used in the assert_upload_asset satellite hook.
OnDeleteAssetContext
A type alias for the context used in the on_delete_asset satellite hook.
OnDeleteDocContext
A type alias for the context used in the on_delete_doc satellite hook.
OnDeleteFilteredAssetsContext
A type alias for the context used in the on_delete_filtered_assets satellite hook.
OnDeleteFilteredDocsContext
A type alias for the context used in the on_delete_filtered_docs satellite hook.
OnDeleteManyAssetsContext
A type alias for the context used in the on_delete_many_assets satellite hook.
OnDeleteManyDocsContext
A type alias for the context used in the on_delete_many_docs satellite hook.
OnSetDocContext
A type alias for the context used in the on_set_doc satellite hook.
OnSetManyDocsContext
A type alias for the context used in the on_set_many_docs satellite hook.
OnUploadAssetContext
A type alias for the context used in the on_upload_asset satellite hook.