bundle

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load added in v0.9.0

func Load(h *rt.Reactr, bundle *Bundle) error

Load loads a .wasm.zip file into the rt instance

func LoadFromPath added in v0.9.0

func LoadFromPath(h *rt.Reactr, path string) error

LoadFromPath loads a .wasm.zip file into the rt instance

func NormalizeStaticFilename added in v0.6.2

func NormalizeStaticFilename(fileName string) string

NormalizeStaticFilename will take various variations of a filename and normalize it to what is listed in the staticFile name cache on the Bundle struct

func Write

func Write(directiveBytes []byte, modules []os.File, staticFiles map[string]os.File, targetPath string) error

Write writes a runnable bundle based loosely on https://golang.org/src/archive/zip/example_test.go staticFiles should be a map of *relative* filepaths to their associated files, with or without the `static/` prefix.

Types

type Bundle

type Bundle struct {
	Directive *directive.Directive
	Runnables []rwasm.WasmModuleRef
	// contains filtered or unexported fields
}

Bundle represents a Runnable bundle

func Read

func Read(path string) (*Bundle, error)

Read reads a .wasm.zip file and returns the bundle of wasm modules (suitable to be loaded into a wasmer instance)

func (*Bundle) StaticFile

func (b *Bundle) StaticFile(filePath string) ([]byte, error)

StaticFile returns a static file from the bundle, if it exists

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL