plugin

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NullLogger

func NullLogger() logrus.FieldLogger

func PrefixMessage

func PrefixMessage(pluginInfo catalog.PluginInfo, message string) string

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

Types

type Facade

type Facade struct {
	catalog.PluginInfo
	Log logrus.FieldLogger
}

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

func FixedFacade

func FixedFacade(pluginName, pluginType string, log logrus.FieldLogger) Facade

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

func (*Facade) Error

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

func (f *Facade) Errorf(code codes.Code, format string, args ...interface{}) 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

func (f *Facade) InitInfo(pluginInfo catalog.PluginInfo)

InitInfo partially satisfies the catalog.Facade interface

func (*Facade) InitLog

func (f *Facade) InitLog(log logrus.FieldLogger)

InitLog partially satisfies the catalog.Facade interface

func (*Facade) WrapErr

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

WrapError 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
k8s
Package sshpop implements ssh proof of possession based node attestation.
Package sshpop implements ssh proof of possession based node attestation.

Jump to

Keyboard shortcuts

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