plug

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(h *BasicHandler)

Main runs the main loop for a plugin

Types

type BasicHandler

type BasicHandler struct {
	Handlers map[string]func([]byte)
	// contains filtered or unexported fields
}

func New

func New() *BasicHandler

New creates basic plug that supports basic options

func (*BasicHandler) Finish

func (h *BasicHandler) Finish(message string, code codes.PluginExitReason)

func (*BasicHandler) HandleMessageType

func (h *BasicHandler) HandleMessageType(name string, handler func([]byte))

HandleMessageType registers a function that decodes a message of particular type to process it

func (*BasicHandler) Respond

func (h *BasicHandler) Respond(t string, v any)

Respond sends raw response to the plugin host. It encapsulates the information in an envelope

Jump to

Keyboard shortcuts

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