bundle

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeStaticFilename

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(tenantConfigBytes []byte, modules []os.File, staticFiles map[string]os.File, targetPath string) error

Write writes a module 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 {
	TenantConfig *tenant.Config
	// contains filtered or unexported fields
}

Bundle represents a Module 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.

Jump to

Keyboard shortcuts

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