Versions in this module Expand all Collapse all v0 v0.1.0 Jul 28, 2018 Changes in this version + const Magic + const TypeFunc + const Version + var ErrEmptyInitExpr = errors.New("wasm: Initializer expression produces no value") + var ErrFunctionNoEnd = errors.New("Function body does not end with 0x0b (end)") + var ErrImportMutGlobal = errors.New("wasm: cannot import global mutable variable") + var ErrInvalidMagic = errors.New("wasm: Invalid magic number") + var ErrNoExportsInImportedModule = errors.New("wasm: imported module has no exports") + var ErrUnsupportedSection = errors.New("wasm: unsupported section") + func SetDebugMode(dbg bool) + type BlockType ValueType + const BlockTypeEmpty + func (b BlockType) String() string + type DataSegment struct + Data []byte + Index uint32 + Offset []byte + type DuplicateExportError string + func (e DuplicateExportError) Error() string + type ElemType int + const ElemTypeAnyFunc + func (t ElemType) String() string + type ElementSegment struct + Elems []uint32 + Index uint32 + Offset []byte + type ExportEntry struct + FieldStr string + Index uint32 + Kind External + type ExportNotFoundError struct + FieldName string + ModuleName string + func (e ExportNotFoundError) Error() string + type External uint8 + const ExternalFunction + const ExternalGlobal + const ExternalMemory + const ExternalTable + func (e External) String() string + type FuncImport struct + Type uint32 + type Function struct + Body *FunctionBody + Host reflect.Value + Sig *FunctionSig + func (fct *Function) IsHost() bool + type FunctionBody struct + Code []byte + Locals []LocalEntry + Module *Module + type FunctionSig struct + Form int8 + ParamTypes []ValueType + ReturnTypes []ValueType + func (f FunctionSig) String() string + type GlobalEntry struct + Init []byte + Type *GlobalVar + type GlobalVar struct + Mutable bool + Type ValueType + type GlobalVarImport struct + Type GlobalVar + type Import interface + type ImportEntry struct + FieldName string + Kind External + ModuleName string + Type Import + type InvalidCodeIndexError int + func (e InvalidCodeIndexError) Error() string + type InvalidExternalError uint8 + func (e InvalidExternalError) Error() string + type InvalidFunctionIndexError uint32 + func (e InvalidFunctionIndexError) Error() string + type InvalidGlobalIndexError uint32 + func (e InvalidGlobalIndexError) Error() string + type InvalidInitExprOpError byte + func (e InvalidInitExprOpError) Error() string + type InvalidLinearMemoryIndexError uint32 + func (e InvalidLinearMemoryIndexError) Error() string + type InvalidSectionIDError SectionID + func (e InvalidSectionIDError) Error() string + type InvalidTableIndexError uint32 + func (e InvalidTableIndexError) Error() string + type InvalidTypeConstructorError struct + Got int + Wanted int + func (e InvalidTypeConstructorError) Error() string + type InvalidValueTypeInitExprError struct + Got reflect.Kind + Wanted reflect.Kind + func (e InvalidValueTypeInitExprError) Error() string + type KindMismatchError struct + Export External + FieldName string + Import External + ModuleName string + func (e KindMismatchError) Error() string + type LocalEntry struct + Count uint32 + Type ValueType + type Memory struct + Limits ResizableLimits + type MemoryImport struct + Type Memory + type MissingSectionError SectionID + func (e MissingSectionError) Error() string + type Module struct + Code *SectionCode + Data *SectionData + Elements *SectionElements + Export *SectionExports + Function *SectionFunctions + FunctionIndexSpace []Function + Global *SectionGlobals + GlobalIndexSpace []GlobalEntry + Import *SectionImports + LinearMemoryIndexSpace [][]byte + Memory *SectionMemories + Other []Section + Start *SectionStartFunction + Table *SectionTables + TableIndexSpace [][]uint32 + Types *SectionTypes + Version uint32 + func NewModule() *Module + func ReadModule(r io.Reader, resolvePath ResolveFunc) (*Module, error) + func (m *Module) ExecInitExpr(expr []byte) (interface{}, error) + func (m *Module) GetFunction(i int) *Function + func (m *Module) GetGlobal(i int) *GlobalEntry + func (m *Module) GetLinearMemoryData(index int) (byte, error) + func (m *Module) GetTableElement(index int) (uint32, error) + type ResizableLimits struct + Flags uint32 + Initial uint32 + Maximum uint32 + type ResolveFunc func(name string) (*Module, error) + type Section struct + Bytes []byte + End int64 + ID SectionID + Name string + PayloadLen uint32 + Start int64 + type SectionCode struct + Bodies []FunctionBody + type SectionData struct + Entries []DataSegment + type SectionElements struct + Entries []ElementSegment + type SectionExports struct + Entries map[string]ExportEntry + type SectionFunctions struct + Types []uint32 + type SectionGlobals struct + Globals []GlobalEntry + type SectionID uint8 + const SectionIDCode + const SectionIDCustom + const SectionIDData + const SectionIDElement + const SectionIDExport + const SectionIDFunction + const SectionIDGlobal + const SectionIDImport + const SectionIDMemory + const SectionIDStart + const SectionIDTable + const SectionIDType + func (s SectionID) String() string + type SectionImports struct + Entries []ImportEntry + type SectionMemories struct + Entries []Memory + type SectionStartFunction struct + Index uint32 + type SectionTables struct + Entries []Table + type SectionTypes struct + Entries []FunctionSig + type Table struct + ElementType ElemType + Limits ResizableLimits + type TableImport struct + Type Table + type ValueType int8 + const ValueTypeF32 + const ValueTypeF64 + const ValueTypeI32 + const ValueTypeI64 + func (t ValueType) String() string