Documentation
¶
Index ¶
- func ExtismFree(offset ExtismPointer)
- func ExtismLength(offset ExtismPointer) uint64
- func ExtismLengthUnsafe(ExtismPointer) uint64
- func ExtismLoadU8(offset ExtismPointer) uint8
- func ExtismLoadU64(offset ExtismPointer) uint64
- func ExtismStoreU8(offset ExtismPointer, v uint8)
- func ExtismStoreU64(offset ExtismPointer, v uint64)
- func Load(offset ExtismPointer, buf []byte)
- func Store(offset ExtismPointer, buf []byte)
- type ExtismPointer
- type Memory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtismFree ¶
func ExtismFree(offset ExtismPointer)
extismFree releases the bytes previously allocated with `extism_alloc` at the given `offset`.
func ExtismLength ¶
func ExtismLength(offset ExtismPointer) uint64
extismLength returns the number of bytes associated with the block of host memory located at `offset`.
func ExtismLengthUnsafe ¶
func ExtismLengthUnsafe(ExtismPointer) uint64
func ExtismLoadU8 ¶
func ExtismLoadU8(offset ExtismPointer) uint8
func ExtismLoadU64 ¶
func ExtismLoadU64(offset ExtismPointer) uint64
extismLoadU64 returns the 64-bit unsigned integer at location `offset` in the host memory block. Note that `offset` must lie on an 8-byte boundary.
func ExtismStoreU8 ¶
func ExtismStoreU8(offset ExtismPointer, v uint8)
func ExtismStoreU64 ¶
func ExtismStoreU64(offset ExtismPointer, v uint64)
extismStoreU64 stores the 64-bit unsigned integer value `v` at location `offset` in the host memory block. Note that `offset` must lie on an 8-byte boundary.
func Load ¶
func Load(offset ExtismPointer, buf []byte)
func Store ¶
func Store(offset ExtismPointer, buf []byte)
Types ¶
type ExtismPointer ¶
type ExtismPointer uint64
func ExtismAlloc ¶
func ExtismAlloc(length uint64) ExtismPointer
extismAlloc allocates `length` bytes of data with host memory for use by the plugin and returns its offset within the host memory block.
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory represents memory allocated by (and shared with) the host.
func AllocateBytes ¶
AllocateBytes allocates and saves the `data` into Memory on the host.
func NewMemory ¶
func NewMemory(offset ExtismPointer, length uint64) Memory