forked from tetratelabs/wazero
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: adds FSConfig to replace experimental writefs (tetratelabs#1061)
This adds a new top-level type FSConfig, which is configured via `ModuleConfig.WithFSConfig(fcfg)`. This implements read-only and read-write directory mounts, something not formally supported before. It also implements `WithFS` which adapts a normal `fs.FS`. For convenience, we retain the old `ModuleConfig.WithFS` signature so as to not affect existing users much. A new configuration for our emerging raw filesystem, `FSConfig.WithSysfs()` will happen later without breaking this API. Here's an example: ``` moduleConfig = wazero.NewModuleConfig(). // Make the current directory read-only accessible to the guest. WithReadOnlyDirMount(".", "/") // Make "/tmp/wasm" accessible to the guest as "/tmp". WithDirMount("/tmp/wasm", "/tmp") ``` Signed-off-by: Adrian Cole <[email protected]>
- Loading branch information
1 parent
affcf6c
commit cc68f8e
Showing
25 changed files
with
458 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.