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_docfeature. - on_set_many_docs: Enables the
on_set_many_docsfeature. - on_delete_doc: Enables the
on_delete_docfeature. - on_delete_many_docs: Enables the
on_delete_many_docsfeature. - on_delete_filtered_docs: Enables the
on_delete_filtered_docsfeature. - on_upload_asset: Enables the
on_upload_assetfeature. - on_delete_asset: Enables the
on_delete_assetfeature. - on_delete_many_assets: Enables the
on_delete_many_assetsfeature. - on_delete_filtered_assets: Enables the
on_delete_filtered_assetsfeature. - on_init: Enables the
on_initfeature. - on_post_upgrade: Enables the
on_post_upgradefeature. - assert_set_doc: Enables the
assert_set_docfeature. - assert_delete_doc: Enables the
assert_delete_docfeature. - assert_upload_asset: Enables the
assert_upload_assetfeature. - assert_delete_asset: Enables the
assert_delete_assetfeature.
These features are enabled by default and do not have additional dependencies.
§Links & Resources
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§
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.
- DocAssert
Delete - DocAssert
Set - DocContext
- DocUpsert
- Hook
Context - A generic context struct used in Juno satellite hooks.
- Log
- SetDoc
- Parameters for setting a document.
Enums§
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
Infolevel. - log_
with_ data - Logs a message at the
Infolevel with additional serialized data. - random
- Generates a random
i32number. - 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§
- Assert
Delete Asset Context - A type alias for the context used in the
assert_delete_assetsatellite hook. - Assert
Delete DocContext - A type alias for the context used in the
assert_delete_docsatellite hook. - Assert
SetDoc Context - A type alias for the context used in the
assert_set_docsatellite hook. - Assert
Upload Asset Context - A type alias for the context used in the
assert_upload_assetsatellite hook. - OnDelete
Asset Context - A type alias for the context used in the
on_delete_assetsatellite hook. - OnDelete
DocContext - A type alias for the context used in the
on_delete_docsatellite hook. - OnDelete
Filtered Assets Context - A type alias for the context used in the
on_delete_filtered_assetssatellite hook. - OnDelete
Filtered Docs Context - A type alias for the context used in the
on_delete_filtered_docssatellite hook. - OnDelete
Many Assets Context - A type alias for the context used in the
on_delete_many_assetssatellite hook. - OnDelete
Many Docs Context - A type alias for the context used in the
on_delete_many_docssatellite hook. - OnSet
DocContext - A type alias for the context used in the
on_set_docsatellite hook. - OnSet
Many Docs Context - A type alias for the context used in the
on_set_many_docssatellite hook. - OnUpload
Asset Context - A type alias for the context used in the
on_upload_assetsatellite hook.