Documentation ¶
Index ¶
- func Exec(contextID ContextID, forward bool, argBuffer *byte, argSize int32, ...) types.Status
- func GetInputArgBuffer(start, maxsize int32) ([]byte, error)
- func GetInputDataBuffer(start, maxsize int32) ([]byte, error)
- func GetTempArgBuffer(start, maxsize int32) ([]byte, error)
- func GetTempDataBuffer(start, maxsize int32) ([]byte, error)
- func RawBytePtrToByteSlice(raw *byte, size int32) []byte
- func RegisterContext(contextID ContextID, module ModuleContext) error
- func SetOutputPatchBuffer(patch []byte) error
- func SetTempArgBuffer(buf []byte) error
- func SetTempDataBuffer(buf []byte) error
- type ContextID
- type Data
- type DataArray
- type DefaultModuleContext
- func (ctx *DefaultModuleContext) GetImport(name string) (ImportedModuleContext, error)
- func (ctx *DefaultModuleContext) Imports() []string
- func (ctx *DefaultModuleContext) Init()
- func (ctx *DefaultModuleContext) Name() string
- func (ctx *DefaultModuleContext) OnContextCreate()
- func (ctx *DefaultModuleContext) ResolveImports() []Import
- func (ctx *DefaultModuleContext) Run(forward bool, args Data, data Data) (Data, error)
- type DefaultWrappedContext
- type ExecFn
- type Import
- type ImportedModuleContext
- type ModuleContext
- type Patch
- type WrappedModuleContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInputArgBuffer ¶
func GetInputDataBuffer ¶
func GetTempArgBuffer ¶
func GetTempDataBuffer ¶
func RawBytePtrToByteSlice ¶
RawBytePtrToByteSlice takes a pointer and a size argument and returns a byte slice Note: It uses the TinyGo internal representation of a Byte slice (https://tinygo.org/compiler-internals/datatypes/)
func RegisterContext ¶
func RegisterContext(contextID ContextID, module ModuleContext) error
func SetOutputPatchBuffer ¶
func SetTempArgBuffer ¶
func SetTempDataBuffer ¶
Types ¶
type Data ¶
type Data interface { Get(keys ...string) (interface{}, bool) GetObject(keys ...string) (Data, bool) MustGetObject(keys ...string) Data GetArray(keys ...string) (DataArray, bool) MustGetArray(keys ...string) DataArray GetString(keys ...string) (string, bool) MustGetString(keys ...string) string GetInt32(keys ...string) (int32, bool) MustGetInt32(keys ...string) int32 GetFloat32(keys ...string) (float32, bool) MustGetFloat32(keys ...string) float32 Merge(Patch) Data }
type DefaultModuleContext ¶
type DefaultModuleContext struct {
// contains filtered or unexported fields
}
func (*DefaultModuleContext) GetImport ¶
func (ctx *DefaultModuleContext) GetImport(name string) (ImportedModuleContext, error)
Get the function handler for a named import. Any import accessed through this function must be defined in the Imports() method.
func (*DefaultModuleContext) Imports ¶
func (ctx *DefaultModuleContext) Imports() []string
Imports returns a list of modules to import.
func (*DefaultModuleContext) Init ¶
func (ctx *DefaultModuleContext) Init()
func (*DefaultModuleContext) Name ¶
func (ctx *DefaultModuleContext) Name() string
Name returns the name of the lens module
func (*DefaultModuleContext) OnContextCreate ¶
func (ctx *DefaultModuleContext) OnContextCreate()
OnContextCreate implements the Module ABI lifecycle
func (*DefaultModuleContext) ResolveImports ¶
func (ctx *DefaultModuleContext) ResolveImports() []Import
ResolveImports links the import name to the WASM import function
type DefaultWrappedContext ¶
type DefaultWrappedContext struct {
// contains filtered or unexported fields
}
func NewWrappedContext ¶
func NewWrappedContext(ctx ModuleContext) *DefaultWrappedContext
func (*DefaultWrappedContext) Init ¶
func (ctx *DefaultWrappedContext) Init()
type ImportedModuleContext ¶
type ModuleContext ¶
type ModuleContext interface { Init() // Name returns the name of the lens module Name() string // OnContextCreate is called when a new module context is created OnContextCreate() // ResolveImports dynamically links the import name // to the imported WASM module function. // This function should be autogenerated // See github.com/lens-vm/lens-vm-go-sdk#GeneratedImportResolver ResolveImports() []Import // Imports returns a list of modules to import. // Any imports returned here must also be defined in the // module file import section // (https://github.com/lens-vm/spec#module-file-modulejsonyaml). // Additionally, we rely on the module file for the version // info, so the runtime can resolve the correct version and // dynamically link it into the module. Imports() []string // Get the function handler for a named import. // Any import accessed through this function must be defined // in the Imports() method. GetImport(string) (ImportedModuleContext, error) // Run is responsible for parsing arguments and executing // the actual lens transformation function. Run(forward bool, args Data, data Data) (Patch, error) }
func GetContext ¶
func GetContext(contextID ContextID) ModuleContext
type WrappedModuleContext ¶
type WrappedModuleContext interface { ModuleContext }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.