Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
Example ¶
package main import ( "fmt" "io" symbols "github.com/taubyte/go-sdk-symbols/i2mv/memview" "github.com/taubyte/go-sdk/i2mv/memview" ) var ( mvCloser io.Closer err error id uint32 ) func main() { // Mocking the calls to the vm for usage in tests and playground symbols.MockNew(1) id, mvCloser, err = memview.New([]byte{1, 2, 3}, true) if err != nil { fmt.Printf("New memory view failed with: failed with: %s\n", err) return } fmt.Printf("%d\n", id) }
Output: 1
Types ¶
type MemoryView ¶
type MemoryView interface { io.ReadSeekCloser Size() uint32 OffSet() int64 Id() uint32 }
TODO: Move to Interfaces once it is open sourced
func Open ¶
func Open(id uint32) (MemoryView, error)
Example ¶
package main import ( "fmt" symbols "github.com/taubyte/go-sdk-symbols/i2mv/memview" "github.com/taubyte/go-sdk/i2mv/memview" ) func main() { // Mocking the calls to the vm for usage in tests and playground symbols.MockOpen(5, false) mv, err := memview.Open(0) if err != nil { fmt.Printf("Open failed with: %s\n", err) return } fmt.Printf("%d\n", mv.Size()) }
Output: 5
Click to show internal directories.
Click to hide internal directories.