plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverInventory

func DiscoverInventory(ctx context.Context, payload []byte) (inventory *wasiv1.PluginInventoryResponse, err error)

Types

type HostFuncExportWrapper

type HostFuncExportWrapper[TRequest bapi.ProtoMessage, TResponse bapi.ProtoMessage] func(ctx context.Context, req TRequest) (TResponse, error)

func NewHostFuncExport

func NewHostFuncExport[TRequest bapi.ProtoMessage, TResponse bapi.ProtoMessage](f func(ctx context.Context, req TRequest) (TResponse, error)) HostFuncExportWrapper[TRequest, TResponse]

func (HostFuncExportWrapper[TRequest, TResponse]) Call

func (w HostFuncExportWrapper[TRequest, TResponse]) Call(ctx context.Context, m api.Module, offset, byteCount uint32) uint64

type MemoryPayload

type MemoryPayload []byte

func (MemoryPayload) Bytes

func (m MemoryPayload) Bytes() ([]byte, error)

func (MemoryPayload) Reader

func (m MemoryPayload) Reader() io.Reader

type Module

type Module struct {
	PluginPayload PayloadReader
	ModuleSpec    map[string]any `hcl:",remain"`

	PluginType     string
	PluginCategory modules.Category
	// contains filtered or unexported fields
}

func (Module) BinaryName

func (m Module) BinaryName(ctx context.Context) (binaryName string, err error)

func (Module) Category

func (m Module) Category() modules.Category

func (Module) Execute

func (m Module) Execute(ctx modules.ExecutionContext) (err error)

func (Module) Help

func (m Module) Help(ctx context.Context) (help modules.Help, err error)

func (Module) Init

func (m Module) Init(hclCtx *hcl2.EvalContext) (modules.Module, error)

func (Module) MarshalHCL

func (m Module) MarshalHCL(block *hclwrite.Block) error

func (*Module) SetModuleSpec

func (m *Module) SetModuleSpec(spec *commonv1.ModuleSpec)

func (Module) Type

func (m Module) Type() string

type PayloadFile

type PayloadFile struct {
	Path string

	Checksum []byte
	// contains filtered or unexported fields
}

func (*PayloadFile) Bytes

func (f *PayloadFile) Bytes() ([]byte, error)

func (*PayloadFile) Reader

func (f *PayloadFile) Reader() io.Reader

type PayloadReader

type PayloadReader interface {
	Reader() io.Reader
	Bytes() ([]byte, error)
}

Jump to

Keyboard shortcuts

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