Skip to content

Commit 12fb2d5

Browse files
committed
shim: organize code to different modules
this commit organized code to different modules: - constants: to handling constants across entire crate - engine: the execution engine - source: manages application sources - stdio_hook: a trigger hook for stdio - trigger: manages spin triggers - utils: utility functions it also removes ResolvedAppSource as it's not needed Signed-off-by: jiaxiao zhou <[email protected]>
1 parent 8c36933 commit 12fb2d5

File tree

7 files changed

+541
-528
lines changed

7 files changed

+541
-528
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// SPIN_ADDR_DEFAULT is the default address and port that the Spin HTTP trigger
2+
/// listens on.
3+
pub(crate) const SPIN_ADDR_DEFAULT: &str = "0.0.0.0:80";
4+
/// SPIN_HTTP_LISTEN_ADDR_ENV is the environment variable that can be used to
5+
/// override the default address and port that the Spin HTTP trigger listens on.
6+
pub(crate) const SPIN_HTTP_LISTEN_ADDR_ENV: &str = "SPIN_HTTP_LISTEN_ADDR";
7+
/// RUNTIME_CONFIG_PATH specifies the expected location and name of the runtime
8+
/// config for a Spin application. The runtime config should be loaded into the
9+
/// root `/` of the container.
10+
pub(crate) const RUNTIME_CONFIG_PATH: &str = "/runtime-config.toml";
11+
/// Describes an OCI layer with Wasm content
12+
pub(crate) const OCI_LAYER_MEDIA_TYPE_WASM: &str = "application/vnd.wasm.content.layer.v1+wasm";
13+
/// Expected location of the Spin manifest when loading from a file rather than
14+
/// an OCI image
15+
pub(crate) const SPIN_MANIFEST_FILE_PATH: &str = "/spin.toml";
16+
/// Known prefix for the Spin application variables environment variable
17+
/// provider: https://github.com/fermyon/spin/blob/436ad589237c02f7aa4693e984132808fd80b863/crates/variables/src/provider/env.rs#L9
18+
pub(crate) const SPIN_APPLICATION_VARIABLE_PREFIX: &str = "SPIN_VARIABLE";
19+
/// Working directory for Spin applications
20+
pub(crate) const SPIN_TRIGGER_WORKING_DIR: &str = "/";
21+
/// Name of the Spin lock file
22+
pub(crate) const SPIN_LOCK_FILE_NAME: &str = "spin.lock";

0 commit comments

Comments
 (0)