gsplug

package
v0.0.0-...-8c91f9f Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPluginLogDir

func GetPluginLogDir(pluginName string) (string, error)

func ReadMessage

func ReadMessage(r io.Reader) (uint32, proto.Message, error)

func RunPlugin

func RunPlugin(handler PluginHandler)

func WriteMessage

func WriteMessage(w io.Writer, msg proto.Message) error

Types

type MenuOption struct {
	Label      string          `json:"label"`
	Command    string          `json:"command"`
	Parameters []ParameterInfo `json:"parameters,omitempty"`
	SubMenu    []MenuOption    `json:"sub_menu,omitempty"`
}

type ParameterInfo

type ParameterInfo struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
}

type PluginHandler

type PluginHandler interface {
	GetPluginInfo(*pb.PluginInfoRequest) (*pb.PluginInfo, error)
	ExecuteCommand(*pb.CommandRequest) (*pb.CommandResponse, error)
	GetMenu(*pb.MenuRequest) (*pb.MenuResponse, error)
}

Jump to

Keyboard shortcuts

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