arachne_plugin_scaffold

package
v0.0.0-...-713cbbb Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicHostFunc

func BasicHostFunc(_ context.Context, binding, namespace, operation string, payload []byte) ([]byte, error)

Host function to handle calls from the wasm module. No real functionality here, just for example purposes.

Types

type ArachnePlugin

type ArachnePlugin struct {
	Context    *context.Context
	Module     *wapc.Module
	Instance   *wapc.Instance
	PluginInfo *PluginInfo
}

type Payload

type Payload struct {
}

Base struct for all plugin payloads. Plugins should extend this struct as needed for their own functions. Example is commented out below.

type PluginInfo

type PluginInfo struct {
	PluginName        string `json:"PluginName" validate:"required,alphanumunicode,max=40,min=1"`
	PluginDevIdentity string `json:"PluginDevIdentity" validate:"required,alphanumunicode,max=40,min=1"`
	PluginUrl         string `json:"PluginUrl" validate:"url,max=40,min=6"`
	// Should be a semver-compatible string (https://semver.org/), not a number.
	PluginVersion       string   `json:"PluginVersion" validate:"required,semver,max=14,min=5"`
	PluginBuildTime     string   `json:"PluginBuildTime" validate:"required,datetime"`
	PluginDescription   string   `json:"PluginDescription" validate:"required,alphanumunicode,max=256,min=1"`
	PluginFunctions     []string `json:"PluginFunctions" validate:"required,alphanum,max=256,min=1"`
	RequiredDirectories []string `json:"RequiredDirectories" validate:"alphanum,max=512,min=1"`
}

Jump to

Keyboard shortcuts

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