plugin

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PluginName             = "plugin"
	DefaultProtocolVersion = 1
)

Variables

View Source
var Handshake = p.HandshakeConfig{
	ProtocolVersion: DefaultProtocolVersion,

	MagicCookieKey:   "RUN_PLUGIN_MAGIC_COOKIE",
	MagicCookieValue: "iaafij5485d5utqh",
}

Handshake is configuring the handshake for the gRPC client.

View Source
var VersionedPlugins = map[int]p.PluginSet{
	1: {
		"plugin": &GRPCProviderPlugin{},
	},
}

Functions

func Plugin

func Plugin(ctx context.Context, path string, args ...string) htmx.Node

Plugin ...

func Serve

func Serve(opts *ServeOpts)

Serve ...

Types

type Factory

type Factory func() (*GRPCPlugin, error)

Factory is creatig a new instance of the plugin.

type GRPCPlugin

type GRPCPlugin struct {
	PluginClient *p.Client
	Meta         *Meta
	// contains filtered or unexported fields
}

GRPCPlugin contains the configuration and the client connection for the provider Plugin.

func (*GRPCPlugin) Close

func (p *GRPCPlugin) Close() error

Close is closing the gRPC connection if a plugin is configured.

func (*GRPCPlugin) Render

func (p *GRPCPlugin) Render(ctx context.Context) (string, error)

Render is rendering the plugin with the provided app and options.

type GRPCPluginFunc

type GRPCPluginFunc func() proto.PluginServer

GRPCPluginFunc ...

type GRPCProviderPlugin

type GRPCProviderPlugin struct {
	p.Plugin
	GRPCPlugin func() proto.PluginServer
}

GRPCProviderPlugin ...

func (*GRPCProviderPlugin) GRPCClient

func (p *GRPCProviderPlugin) GRPCClient(_ context.Context, _ *p.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient ...

func (*GRPCProviderPlugin) GRPCServer

func (p *GRPCProviderPlugin) GRPCServer(_ *p.GRPCBroker, s *grpc.Server) error

type Meta

type Meta struct {
	// Path ...
	Path string
	// Arguments ...
	Arguments []string
}

Meta are the meta information provided for the plugin. These are the arguments and the path to the plugin.

func (*Meta) ExecutableFile

func (m *Meta) ExecutableFile() (string, error)

ExecutableFile ...

func (*Meta) Factory

func (m *Meta) Factory(ctx context.Context) Factory

Factory returns a factory function that can be used to create a new instance of the plugin.

type ServeOpts

type ServeOpts struct {
	GRPCPluginFunc GRPCPluginFunc
}

ServeOpts ...

Jump to

Keyboard shortcuts

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