grpc

package
v4.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	IPv4 = "IPv4"
	IPv6 = "IPv6"
)

Variables

This section is empty.

Functions

func BuildCallId

func BuildCallId() string

BuildCallId generates a unique id based on the current time this can be passed into plugin calls to assist with tracking parallel calls

func BuildConnectionCallId

func BuildConnectionCallId(callId, connectionName string) string

func CreateCarrierFromContext

func CreateCarrierFromContext(ctx context.Context) *proto.TraceContext

func ExtractContextFromCarrier

func ExtractContextFromCarrier(ctx context.Context, traceCtx *proto.TraceContext) context.Context

func GetQualValue

func GetQualValue(v *proto.QualValue) interface{}

func HandleGrpcError

func HandleGrpcError(err error, plugin, call string) error

func IsEOFError

func IsEOFError(err error) bool

func IsGRPCConnectivityError

func IsGRPCConnectivityError(err error) bool

func IsNotImplementedError

func IsNotImplementedError(err error) bool

func QualMapToJSONString

func QualMapToJSONString(qualMap map[string]*proto.Quals) (string, error)

func QualMapToString

func QualMapToString(qualMap map[string]*proto.Quals, pretty bool) string

func QualMapsEqual

func QualMapsEqual(l map[string]*proto.Quals, r map[string]*proto.Quals) bool

func QualToString

func QualToString(q *proto.Qual) string

Types

type ExecuteFunc

type ExecuteFunc func(req *proto.ExecuteRequest, stream proto.WrapperPlugin_ExecuteServer) error

type GetSchemaFunc

type GetSchemaFunc func(string) (*PluginSchema, error)

type PluginClient

type PluginClient struct {
	Name string
	Stub pluginshared.WrapperPluginClient
	// contains filtered or unexported fields
}

PluginClient is the client object used by clients of the plugin

func NewPluginClient

func NewPluginClient(client *plugin.Client, pluginName string) (*PluginClient, error)

func NewPluginClientFromReattach

func NewPluginClientFromReattach(reattach *plugin.ReattachConfig, pluginName string) (*PluginClient, error)

func (*PluginClient) Execute

func (*PluginClient) Exited

func (c *PluginClient) Exited() bool

Exited returned whether the underlying client has exited, i.e. the plugin has terminated

func (*PluginClient) GetSchema

func (c *PluginClient) GetSchema(connectionName string) (*proto.Schema, error)

func (*PluginClient) GetSupportedOperations

func (c *PluginClient) GetSupportedOperations() (*proto.GetSupportedOperationsResponse, error)

func (*PluginClient) SetAllConnectionConfigs

func (c *PluginClient) SetAllConnectionConfigs(req *proto.SetAllConnectionConfigsRequest) error

func (*PluginClient) SetConnectionConfig

func (c *PluginClient) SetConnectionConfig(req *proto.SetConnectionConfigRequest) error

type PluginSchema

type PluginSchema struct {
	Schema map[string]*proto.TableSchema
	Mode   string
}

type PluginServer

type PluginServer struct {
	proto.UnimplementedWrapperPluginServer
	// contains filtered or unexported fields
}

PluginServer is the server for a single plugin

func NewPluginServer

func NewPluginServer(pluginName string, setConnectionConfigFunc SetConnectionConfigFunc, setAllConnectionConfigsFunc SetAllConnectionConfigsFunc, getSchemaFunc GetSchemaFunc, executeFunc ExecuteFunc) *PluginServer

func (PluginServer) Execute

func (PluginServer) GetSchema

func (s PluginServer) GetSchema(req *proto.GetSchemaRequest) (res *proto.GetSchemaResponse, err error)

func (PluginServer) Serve

func (s PluginServer) Serve()

func (PluginServer) SetAllConnectionConfigs

func (s PluginServer) SetAllConnectionConfigs(req *proto.SetAllConnectionConfigsRequest) (res *proto.SetConnectionConfigResponse, err error)

func (PluginServer) SetConnectionConfig

func (s PluginServer) SetConnectionConfig(req *proto.SetConnectionConfigRequest) (res *proto.SetConnectionConfigResponse, err error)

type SetAllConnectionConfigsFunc

type SetAllConnectionConfigsFunc func([]*proto.ConnectionConfig, int) error

type SetConnectionConfigFunc

type SetConnectionConfigFunc func(string, string) error

Directories

Path Synopsis
Package shared contains shared data between the host and plugins.
Package shared contains shared data between the host and plugins.

Jump to

Keyboard shortcuts

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