Documentation ¶
Index ¶
- Variables
- func CreateHostPlugin(ctx context.Context, pluginType string, opt ...Option) (pb.HostPluginServiceClient, func() error, error)
- func CreateStoragePlugin(ctx context.Context, pluginType string, opt ...Option) (pb.StoragePluginServiceClient, func() error, error)
- func NewHostPluginServiceServer(impl pb.HostPluginServiceServer) (*hostPlugin, error)
- func NewPluginClient(pluginPath, setName string, opt ...Option) (*plugin.Client, error)
- func NewStoragePluginServiceServer(impl pb.StoragePluginServiceServer) (*storagePlugin, error)
- func ServePlugin(svc any, opt ...Option) error
- type Option
Constants ¶
This section is empty.
Variables ¶
var HandshakeConfig = plugin.HandshakeConfig{
MagicCookieKey: "HASHICORP_BOUNDARY_PLUGIN",
MagicCookieValue: "boundary-plugin",
}
HandshakeConfig is a shared config that can be used regardless of plugin, to avoid having to know type-specific things about each plugin
Functions ¶
func CreateHostPlugin ¶
func CreateHostPlugin(ctx context.Context, pluginType string, opt ...Option) (pb.HostPluginServiceClient, func() error, error)
CreateHostPlugin takes in a type, parses the various options to look for a plugin matching that name, and returns a host plugin client, a cleanup function to execute on shutdown of the enclosing program, and an error.
func CreateStoragePlugin ¶
func CreateStoragePlugin(ctx context.Context, pluginType string, opt ...Option) (pb.StoragePluginServiceClient, func() error, error)
CreateStoragePlugin takes in a type, parses the various options to look for a plugin matching that name, and returns a storage plugin client, a cleanup function to execute on shutdown of the enclosing program, and an error.
func NewHostPluginServiceServer ¶
func NewHostPluginServiceServer(impl pb.HostPluginServiceServer) (*hostPlugin, error)
func NewPluginClient ¶
func NewStoragePluginServiceServer ¶
func NewStoragePluginServiceServer(impl pb.StoragePluginServiceServer) (*storagePlugin, error)
func ServePlugin ¶
ServeHostPlugin is a generic function to start serving a host plugin service as a plugin
Types ¶
type Option ¶
type Option func(*options) error
Option - a type that wraps an interface for compile-time safety but can contain an option for this package or for wrappers implementing this interface.
func WithLogger ¶
func WithLogger(logger hclog.Logger) Option
WithLogger allows passing a logger to the plugin library for debugging
func WithPluginOptions ¶
func WithPluginOptions(opts ...pluginutil.Option) Option
WithPluginOptions allows providing plugin-related (as opposed to configutil-related) options