plugin

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrefixMessage added in v0.9.3

func PrefixMessage(pluginInfo api.Info, message string) string

PrefixMessage prefixes the given message with plugin information. The prefix is only applied if it is not already applied.

func Serve

func Serve(pluginServer api.PluginServer, serviceServers ...api.ServiceServer)

func ServeOptions added in v0.9.3

func ServeOptions(options ...pluginoption.ServerOption) error

Types

type Facade added in v0.9.3

type Facade struct {
	api.Info
	Log *slog.Logger
}

Facade is embedded by plugin interface facade implementations as a convenient way to embed Info but also provide a set of convenient functions for embellishing and generating errors that have the plugin name prefixed.

func FixedFacade added in v0.9.3

func FixedFacade(pluginName, pluginType string, log *slog.Logger) Facade

FixedFacade is a helper that creates a facade from fixed information, i.e. not the product of a loaded plugin.

func (*Facade) Error added in v0.9.3

func (f *Facade) Error(code codes.Code, message string) error

Error creates a gRPC status with the given code and message. The message will be prefixed with the plugin name.

func (*Facade) Errorf added in v0.9.3

func (f *Facade) Errorf(code codes.Code, format string, args ...any) error

Errorf creates a gRPC status with the given code and formatted message. The message will be prefixed with the plugin name.

func (*Facade) InitInfo added in v0.9.3

func (f *Facade) InitInfo(pluginInfo api.Info)

InitInfo partially satisfies the catalog.Facade interface

func (*Facade) InitLog added in v0.9.3

func (f *Facade) InitLog(log *slog.Logger)

InitLog partially satisfies the catalog.Facade interface

func (*Facade) WrapErr added in v0.9.3

func (f *Facade) WrapErr(err error) error

WrapErr wraps a given error such that it will be prefixed with the plugin name. This method should be used by facade implementations to wrap errors that come out of plugin implementations.

Directories

Path Synopsis
keystore

Jump to

Keyboard shortcuts

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