Skip to main content

Crate warpgate_api

Crate warpgate_api 

Source
Expand description

APIs for working with Warpgate plugins.

Macros§

anyhow
Construct an ad-hoc error from a string or existing non-anyhow error value.
api_enum
Wrap an enum with common derives and serde required attributes.
api_struct
Wrap a struct with common derives and serde required attributes.
api_unit_enum
Wrap a unit-only enum with common derives and serde required attributes.

Structs§

DataLocator
An inline data locator.
EmptyInput
Represents an empty input.
ExecCommandInput
Input passed to the exec_command host function.
ExecCommandOutput
Output returned from the exec_command host function.
FileLocator
A file system locator.
GitHubLocator
A GitHub release locator.
HostEnvironment
Information about the host environment (the current runtime).
HostLogInput
Input passed to the host_log host function.
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.
PathParseError
Error type for path parsing failures.
RealPath
Represents a real absolute path on the host system.
RegistryLocator
An OCI registry locator.
SendRequestInput
Input passed to the send_request host function.
SendRequestOutput
Output returned from the send_request host function.
TestEnvironment
Information about the current testing environment.
UrlLocator
A HTTPS URL locator.
VirtualPath
Represents a virtual absolute path on the guest system.

Enums§

HostArch
Architecture of the system environment.
HostLibc
Libc being used in the system environment.
HostLogTarget
Target where host logs should be written to.
HostOS
Operating system of the current environment.
PluginLocator
Strategies and protocols for locating plugins.
PluginLocatorError
Errors during plugin locator parsing.

Statics§

ID_CLEAN_PATTERN
Pattern that removes unsupported characters from an identifier.
ID_PATTERN
Pattern that all identifiers are matched against. Supports unicode alphanumeric characters, forward slash /, period ., underscore _, and dash -. A leading @ is supported to support npm package names.

Functions§

convert_to_real_native_path
Convert the provided virtual guest path to a real host path, returning a PathBuf instead of a RealPath. If the guest path does not match any of the provided virtual paths, it will return the original path.
convert_to_real_path
Convert the provided virtual guest path to a real host path. If the guest path does not match any of the provided virtual paths, it will return None.
convert_to_virtual_path
Convert the provided real host path to a virtual guest path. If the host path does not match any of the provided virtual paths, it will return None.
sort_paths_list
Sort paths from longest to shortest host path, so that prefix replacing is deterministic and accurate.

Type Aliases§

AnyResult
Represents any result (using anyhow).