wasm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package wasm provides the functionality for communicating with Conduit as a standalone plugin. DO NOT use this package directly.

Index

Constants

View Source
const (
	// ErrorCodeStart is the smallest error code which the host (i.e. Conduit) can send.
	// The imported function _nextCommand returns an uint32 value
	// that is either the number of bytes actually written or an error code.
	// Because of that, we're reserving a range of error codes.
	ErrorCodeStart = math.MaxUint32 - 100

	ErrorCodeNoMoreCommands = math.MaxUint32 - iota
	ErrorCodeUnknownCommandRequest
	ErrorCodeUnknownCommandResponse
	ErrorCodeMemoryOutOfRange
)

Variables

View Source
var (
	ErrNoMoreCommands         = NewError(ErrorCodeNoMoreCommands, "no more commands")
	ErrUnknownCommandRequest  = NewError(ErrorCodeUnknownCommandRequest, "unknown command request")
	ErrUnknownCommandResponse = NewError(ErrorCodeUnknownCommandResponse, "unknown command response")
	ErrMemoryOutOfRange       = NewError(ErrorCodeMemoryOutOfRange, "memory out of range")
)

Functions

func CodeFromError

func CodeFromError(err error) uint32

Types

type Error

type Error struct {
	ErrCode uint32
	Message string
}

Error is an error sent to or received from the host (i.e. Conduit).

func NewError

func NewError(code uint32, message string) *Error

func NewErrorFromCode

func NewErrorFromCode(code uint32) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

Jump to

Keyboard shortcuts

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