extension

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(e Extension)

func List

func List() []string

func Run

func Run(extID string, funcName string, arguments []byte, callback func([]byte)) error

Types

type Extension

type Extension interface {
	Load() error
	Call(exportName string, arguments []byte, callback func([]byte)) error
	GetID() string
	GetArch() string
}

type MemFSNode

type MemFSNode struct {
	BaseName string

	Subdirs   map[string]*MemFSNode // tree entires (directories only)
	FileNodes map[string]*MemFSNode // tree entires (files only)
	// contains filtered or unexported fields
}

MemFSNode - A makeshift in-memory fill system node, this object implements both the fs.File and fs.FileInfo interfaces.

func (MemFSNode) Close

func (m MemFSNode) Close() error

Close - No-op

func (*MemFSNode) Exists

func (m *MemFSNode) Exists(segs []string) bool

Exists - Should never be passed an empty slice, recursively calls exists on each segment until the last segment is reached

func (*MemFSNode) GetNode

func (m *MemFSNode) GetNode(segs []string) *MemFSNode

GetNode - Get a node from the memfs tree

func (*MemFSNode) HasSubdir

func (m *MemFSNode) HasSubdir(name string) bool

HasSubdir - Returns true if the directory has a subdir with the given name

func (MemFSNode) Info

func (m MemFSNode) Info() (fs.FileInfo, error)

func (*MemFSNode) Insert

func (m *MemFSNode) Insert(segs []string, fileNode *MemFSNode)

Insert - Recursively inserts segments of a path into the tree

func (MemFSNode) IsDir

func (m MemFSNode) IsDir() bool

IsDir - Returns true if the file is a directory

func (MemFSNode) ModTime

func (m MemFSNode) ModTime() time.Time

ModTime - Returns the mod time of the file

func (MemFSNode) Mode

func (m MemFSNode) Mode() fs.FileMode

Mode - Returns the mode of the file

func (MemFSNode) Name

func (m MemFSNode) Name() string

Name - Returns the name of the file

func (*MemFSNode) ParentSegs

func (m *MemFSNode) ParentSegs(segs []string) []string

func (MemFSNode) Read

func (m MemFSNode) Read(buf []byte) (int, error)

Read - Standard reader function

func (MemFSNode) ReadDir

func (m MemFSNode) ReadDir(n int) ([]fs.DirEntry, error)

ReadDir - Read contents for directory

func (MemFSNode) Size

func (m MemFSNode) Size() int64

Size - Returns the size of the file

func (MemFSNode) Stat

func (m MemFSNode) Stat() (fs.FileInfo, error)

Stat - Returns the MemoryNode itself since it implements FileInfo

func (MemFSNode) Sys

func (m MemFSNode) Sys() interface{}

Sys - Returns nil

func (MemFSNode) Type

func (m MemFSNode) Type() fs.FileMode

Type - Returns the mode of the file

type WasmExtension

type WasmExtension struct {
	Name string

	Stdin  *wasmPipe
	Stdout *wasmPipe
	Stderr *wasmPipe
	// contains filtered or unexported fields
}

WasmExtension - Wasm extension

func NewWasmExtension

func NewWasmExtension(name string, wasm []byte, memFS map[string][]byte) (*WasmExtension, error)

NewWasmExtension - Create a new Wasm extension

func (*WasmExtension) Close

func (w *WasmExtension) Close() error

Close - Close the Wasm module

func (*WasmExtension) Execute

func (w *WasmExtension) Execute(args []string) (uint32, error)

Execute - Execute the Wasm module with arguments, blocks during execution, returns errors

func (*WasmExtension) IsExecuting

func (w *WasmExtension) IsExecuting() bool

IsExecuting - Check if the Wasm module runtime is currently executing

type WasmMemoryFS

type WasmMemoryFS struct {
	// contains filtered or unexported fields
}

WasmMemoryFS - A makeshift read only in-memory virtual file system backed by a map of names to bytes the key is the absolute path to the file and the bytes are the contents of the file empty directories are not supported.

func (WasmMemoryFS) Open

func (w WasmMemoryFS) Open(name string) (fs.File, error)

Open - Open a file, the open call is either passed thru to the OS or is redirected to the WasmMemoryFS

Jump to

Keyboard shortcuts

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