Documentation
¶
Index ¶
- func ClientHandshakeConfig(pluginClient api.PluginClient) goplugin.HandshakeConfig
- func Deinit(ctx context.Context, conn grpc.ClientConnInterface) error
- func Init(ctx context.Context, conn grpc.ClientConnInterface, hostServiceNames []string) (pluginServiceNames []string, err error)
- func NewLogger() hclog.Logger
- func Register(s *grpc.Server, servers []api.ServiceServer, logger hclog.Logger, ...)
- func Serve(opts ...pluginoption.ServerOption) error
- func ServerHandshakeConfig(pluginServer api.PluginServer) goplugin.HandshakeConfig
- func ValidationUnaryInterceptor(v protovalidate.Validator, request, response bool) grpc.UnaryServerInterceptor
- type HostDialer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientHandshakeConfig ¶
func ClientHandshakeConfig(pluginClient api.PluginClient) goplugin.HandshakeConfig
ClientHandshakeConfig returns the handshake configuration for the given client implementation.
func Deinit ¶
func Deinit(ctx context.Context, conn grpc.ClientConnInterface) error
Deinit deinitializes the plugin. It should only be called right before the host unloads the plugin and will not be invoking any other plugin or service RPCs.
func Init ¶
func Init(ctx context.Context, conn grpc.ClientConnInterface, hostServiceNames []string) (pluginServiceNames []string, err error)
Init initializes the plugin and advertises the given host service names to the plugin for brokering. The list of service names implemented by the plugin are returned. This function is only intended to be used internally.
func Register ¶ added in v0.2.0
func Register(s *grpc.Server, servers []api.ServiceServer, logger hclog.Logger, dialer HostDialer)
register given servers with the gRPC server. The given dialer and logger will be used when the plugins are initialized.
func Serve ¶
func Serve( opts ...pluginoption.ServerOption, ) error
Serve serves the plugin with the given loggers and plugin/service servers and an optional test configuration.
func ServerHandshakeConfig ¶
func ServerHandshakeConfig(pluginServer api.PluginServer) goplugin.HandshakeConfig
ServerHandshakeConfig returns the handshake configuration for the given server implementation.
func ValidationUnaryInterceptor ¶ added in v0.9.3
func ValidationUnaryInterceptor(v protovalidate.Validator, request, response bool) grpc.UnaryServerInterceptor
Types ¶
type HostDialer ¶
type HostDialer interface {
DialHost(ctx context.Context) (grpc.ClientConnInterface, error)
}
HostDialer is a generic interface for dialing the host. This interface is only intended to be used internally.