Skip to main content

Crate warpgate

Crate warpgate 

Source
Expand description

Download, resolve, and manage Extism WASM plugins.

Re-exports§

pub use warpgate_api as api;

Modules§

host
Host functions that are executed on the host machine, and are exposed to WASM plugins (the guest) through the PDKs.
test_utils
Utilities for locating and testing WASM plugins.

Structs§

DataLocator
An inline data locator.
FileLocator
A file system locator.
GitHubLocator
A GitHub release locator.
HttpClient
An HTTP(S) client with middleware that wraps reqwest::Client.
HttpDownloader
A downloader that uses our internal HTTP(S) client.
HttpOptions
Configures the HTTP(S) client used for making requests.
Id
A compact string identifier for use within records, key lookups, and more. Supports unicode alphanumeric characters, forward slash /, period ., underscore _, and dash -. A leading @ is supported to support npm package names.
IdError
ID errors.
LoadedPlugin
A plugin that has been loaded with PluginLoader.
NetrcMiddleware
HTTP client middleware that applies credentials from the user’s .netrc file to each request.
OciClient
An OCI client that wraps oci_client::Client.
PluginContainer
A container around Extism’s Plugin and Manifest types that provides convenience methods for calling and caching functions from the WASM plugin. It also provides additional methods for easily working with WASI and virtual paths.
PluginLoader
A system for loading plugins from a locator strategy, and caching the plugin file (.wasm) to the host’s file system.
PluginManifest
The Manifest type is used to configure the runtime and specify how to load modules.
RealPath
Represents a real absolute path on the host system.
RegistryConfig
Configures an individual plugin registry.
RegistryLocator
An OCI registry locator.
UrlLocator
A HTTPS URL locator.
VirtualPath
Represents a virtual absolute path on the guest system.

Enums§

PluginLocator
Strategies and protocols for locating plugins.
PluginLocatorError
Errors during plugin locator parsing.
WarpgateHttpClientError
HTTP(S) client errors.
WarpgateLoaderError
Loader errors.
WarpgatePluginError
Plugin/runtime errors.
Wasm
The Wasm type specifies how to access a WebAssembly module

Constants§

WASM_LAYER_MEDIA_TYPE_JSON
Media type for a JSON file layer in an OCI image.
WASM_LAYER_MEDIA_TYPE_MARKDOWN
Media type for a Markdown file layer in an OCI image.
WASM_LAYER_MEDIA_TYPE_TAR
Media type for an uncompressed tarball layer in an OCI image.
WASM_LAYER_MEDIA_TYPE_TAR_GZIP
Media type for a gzip compressed tarball layer in an OCI image.
WASM_LAYER_MEDIA_TYPE_TAR_ZSTD
Media type for a zstd compressed tarball layer in an OCI image.
WASM_LAYER_MEDIA_TYPE_TOML
Media type for a TOML file layer in an OCI image.
WASM_LAYER_MEDIA_TYPE_WASM
Media type for a WASM file layer in an OCI image.
WASM_LAYER_MEDIA_TYPE_YAML
Media type for a YAML file layer in an OCI image.

Functions§

create_http_client
Create an HTTP(S) client that’ll be used for downloading files.
create_http_client_with_options
Create an HTTP(S) client with the provided options, that’ll be used for downloading files.
create_oci_client_with_options
Create an OCI client with the provided options, that’ll be used for interacting with OCI registries.
download_from_url_to_file
Download a file from the provided URL, with the provided HTTP(S) client, and save it to a destination location.
extract_file_name_from_url
Attempt to extract a file name from the provided URL, which can be used for caching or temporary file creation.
inject_default_manifest_config
Inject our default configuration into the provided plugin Manifest. This will set plugin_id, host_environment, and virtual_paths for use within PDKs.
move_or_unpack_file
If the temporary file is an archive, unpack it into the destination, otherwise move the file into the destination.

Type Aliases§

OfflineChecker
A function that checks whether the host has no internet connection (is offline).
OnCallFn
A callback that is executed before and after a plugin function call. Receives the function name, the input (before only), and the output (after only).