plugin

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package plugin provides the core Plugin interface and WASM export lifecycle.

Index

Constants

View Source
const (
	// Version of the SDK
	Version = "0.1.0-alpha"
	// MinHostVersion is the minimum compatible Reglet host version.
	MinHostVersion = "0.2.0"
)

Variables

This section is empty.

Functions

func CallHost

func CallHost[Req any, Resp any](hostFunc func(uint64) uint64, req Req) (Resp, error)

CallHost invokes a host function that uses the SDK's packed uint64 ABI.

func PackBytes

func PackBytes(data []byte) uint64

PackBytes packs a byte slice into a uint64 (ptr << 32 | len).

func Register

func Register(p Plugin)

Register is a stub for non-WASM platforms.

func UnpackBytes

func UnpackBytes(packed uint64) []byte

UnpackBytes unpacks a uint64 into a byte slice.

Types

type Plugin

type Plugin interface {
	Describe(ctx context.Context) (entities.Metadata, error)
	Schema(ctx context.Context) ([]byte, error)
	Check(ctx context.Context, config map[string]any) (entities.Result, error)
}

Plugin is the interface every Reglet plugin must implement.

Jump to

Keyboard shortcuts

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