Documentation ¶
Overview ¶
Package grpc contains the definition of the PluginServer which runs the GRPC plugin, and the PluginClient, which provides a simple interface to access the plugin functions.
Index ¶
- Constants
- func BuildCallId() string
- func BuildConnectionCallId(callId, connectionName string) string
- func CreateCarrierFromContext(ctx context.Context) *proto.TraceContext
- func ExtractContextFromCarrier(ctx context.Context, traceCtx *proto.TraceContext) context.Context
- func GetQualValue(v *proto.QualValue) interface{}
- func GetQualValueString(v *proto.QualValue) string
- func HandleGrpcError(err error, plugin, call string) error
- func IsEOFError(err error) bool
- func IsGRPCConnectivityError(err error) bool
- func IsNotImplementedError(err error) bool
- func QualMapToLogLine(qualMap map[string]*proto.Quals) string
- func QualMapToString(qualMap map[string]*proto.Quals, pretty bool) string
- func QualMapsEqual(l map[string]*proto.Quals, r map[string]*proto.Quals) bool
- func QualToString(q *proto.Qual) string
- type EstablishMessageStreamFunc
- type ExecuteFunc
- type GetRateLimitersFunc
- type GetSchemaFunc
- type GetSchemaModeFunc
- type PluginClient
- func (c *PluginClient) EstablishMessageStream() (proto.WrapperPlugin_EstablishMessageStreamClient, error)
- func (c *PluginClient) Execute(req *proto.ExecuteRequest) (str proto.WrapperPlugin_ExecuteClient, ctx context.Context, ...)
- func (c *PluginClient) Exited() bool
- func (c *PluginClient) GetRateLimiters(req *proto.GetRateLimitersRequest) (*proto.GetRateLimitersResponse, error)
- func (c *PluginClient) GetSchema(connectionName string) (*proto.Schema, error)
- func (c *PluginClient) GetSupportedOperations() (*proto.GetSupportedOperationsResponse, error)
- func (c *PluginClient) SetAllConnectionConfigs(req *proto.SetAllConnectionConfigsRequest) (*proto.SetConnectionConfigResponse, error)
- func (c *PluginClient) SetCacheOptions(req *proto.SetCacheOptionsRequest) (*proto.SetCacheOptionsResponse, error)
- func (c *PluginClient) SetConnectionCacheOptions(req *proto.SetConnectionCacheOptionsRequest) (*proto.SetConnectionCacheOptionsResponse, error)
- func (c *PluginClient) SetConnectionConfig(req *proto.SetConnectionConfigRequest) error
- func (c *PluginClient) SetRateLimiters(req *proto.SetRateLimitersRequest) (*proto.SetRateLimitersResponse, error)
- func (c *PluginClient) UpdateConnectionConfigs(req *proto.UpdateConnectionConfigsRequest) error
- type PluginSchema
- type PluginServer
- func (s PluginServer) CallExecuteAsync(req *proto.ExecuteRequest, stream *anywhere.LocalPluginStream)
- func (s PluginServer) EstablishMessageStream(stream proto.WrapperPlugin_EstablishMessageStreamServer) error
- func (s PluginServer) Execute(req *proto.ExecuteRequest, stream proto.WrapperPlugin_ExecuteServer) (err error)
- func (s PluginServer) GetRateLimiters(*proto.GetRateLimitersRequest) (*proto.GetRateLimitersResponse, error)
- func (s PluginServer) GetSchema(req *proto.GetSchemaRequest) (res *proto.GetSchemaResponse, err error)
- func (s PluginServer) GetSchemaMode() string
- func (s PluginServer) GetSupportedOperations(*proto.GetSupportedOperationsRequest) (*proto.GetSupportedOperationsResponse, error)
- func (s PluginServer) Serve()
- func (s PluginServer) SetAllConnectionConfigs(req *proto.SetAllConnectionConfigsRequest) (res *proto.SetConnectionConfigResponse, err error)
- func (s PluginServer) SetCacheOptions(req *proto.SetCacheOptionsRequest) (*proto.SetCacheOptionsResponse, error)
- func (s PluginServer) SetConnectionCacheOptions(req *proto.SetConnectionCacheOptionsRequest) (*proto.SetConnectionCacheOptionsResponse, error)
- func (s PluginServer) SetConnectionConfig(req *proto.SetConnectionConfigRequest) (res *proto.SetConnectionConfigResponse, err error)
- func (s PluginServer) SetRateLimiters(req *proto.SetRateLimitersRequest) (*proto.SetRateLimitersResponse, error)
- func (s PluginServer) UpdateConnectionConfigs(req *proto.UpdateConnectionConfigsRequest) (res *proto.UpdateConnectionConfigsResponse, err error)
- type SerializableQual
- type SetAllConnectionConfigsFunc
- type SetCacheOptionsFunc
- type SetConnectionCacheOptionsFunc
- type SetConnectionConfigFunc
- type SetRateLimitersFunc
- type UpdateConnectionConfigsFunc
Constants ¶
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 CreateCarrierFromContext ¶
func CreateCarrierFromContext(ctx context.Context) *proto.TraceContext
func GetQualValue ¶
func GetQualValueString ¶ added in v5.6.0
func HandleGrpcError ¶
func IsEOFError ¶
func IsGRPCConnectivityError ¶
func IsNotImplementedError ¶
func QualMapToLogLine ¶ added in v5.2.0
func QualToString ¶
Types ¶
type EstablishMessageStreamFunc ¶
type EstablishMessageStreamFunc func(stream proto.WrapperPlugin_EstablishMessageStreamServer) error
type ExecuteFunc ¶
type ExecuteFunc func(req *proto.ExecuteRequest, stream row_stream.Sender) error
type GetRateLimitersFunc ¶ added in v5.6.0
type GetRateLimitersFunc func() []*proto.RateLimiterDefinition
type GetSchemaFunc ¶
type GetSchemaFunc func(string) (*PluginSchema, error)
type GetSchemaModeFunc ¶ added in v5.8.0
type GetSchemaModeFunc func() string
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) EstablishMessageStream ¶
func (c *PluginClient) EstablishMessageStream() (proto.WrapperPlugin_EstablishMessageStreamClient, error)
func (*PluginClient) Execute ¶
func (c *PluginClient) Execute(req *proto.ExecuteRequest) (str proto.WrapperPlugin_ExecuteClient, ctx context.Context, cancel context.CancelFunc, err error)
func (*PluginClient) Exited ¶
func (c *PluginClient) Exited() bool
Exited returned whether the underlying client has exited, i.e. the plugin has terminated
func (*PluginClient) GetRateLimiters ¶ added in v5.6.0
func (c *PluginClient) GetRateLimiters(req *proto.GetRateLimitersRequest) (*proto.GetRateLimitersResponse, error)
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) (*proto.SetConnectionConfigResponse, error)
func (*PluginClient) SetCacheOptions ¶ added in v5.4.0
func (c *PluginClient) SetCacheOptions(req *proto.SetCacheOptionsRequest) (*proto.SetCacheOptionsResponse, error)
func (*PluginClient) SetConnectionCacheOptions ¶ added in v5.6.1
func (c *PluginClient) SetConnectionCacheOptions(req *proto.SetConnectionCacheOptionsRequest) (*proto.SetConnectionCacheOptionsResponse, error)
func (*PluginClient) SetConnectionConfig ¶
func (c *PluginClient) SetConnectionConfig(req *proto.SetConnectionConfigRequest) error
func (*PluginClient) SetRateLimiters ¶ added in v5.6.0
func (c *PluginClient) SetRateLimiters(req *proto.SetRateLimitersRequest) (*proto.SetRateLimitersResponse, error)
func (*PluginClient) UpdateConnectionConfigs ¶
func (c *PluginClient) UpdateConnectionConfigs(req *proto.UpdateConnectionConfigsRequest) error
type PluginSchema ¶
type PluginSchema struct { Schema map[string]*proto.TableSchema Mode string RateLimiters []*proto.RateLimiterDefinition }
func NewPluginSchema ¶ added in v5.2.0
func NewPluginSchema(mode string) *PluginSchema
func (*PluginSchema) Equals ¶ added in v5.2.0
func (x *PluginSchema) Equals(other *PluginSchema) bool
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, updateConnectionConfigsFunc UpdateConnectionConfigsFunc, getSchemaFunc GetSchemaFunc, executeFunc ExecuteFunc, establishMessageStreamFunc EstablishMessageStreamFunc, setCacheOptionsFunc SetCacheOptionsFunc, setRateLimitersFunc SetRateLimitersFunc, getRateLimitersFunc GetRateLimitersFunc, setConnectionCacheOptionsFunc SetConnectionCacheOptionsFunc, GetSchemaModeFunc GetSchemaModeFunc, ) *PluginServer
func (PluginServer) CallExecuteAsync ¶ added in v5.8.0
func (s PluginServer) CallExecuteAsync(req *proto.ExecuteRequest, stream *anywhere.LocalPluginStream)
CallExecuteAsync directly calls the execute function and is used to execute in-process
func (PluginServer) EstablishMessageStream ¶
func (s PluginServer) EstablishMessageStream(stream proto.WrapperPlugin_EstablishMessageStreamServer) error
func (PluginServer) Execute ¶
func (s PluginServer) Execute(req *proto.ExecuteRequest, stream proto.WrapperPlugin_ExecuteServer) (err error)
Execute implements the WrapperPluginServer interface and is used to execute calls vis GRPC
func (PluginServer) GetRateLimiters ¶ added in v5.6.0
func (s PluginServer) GetRateLimiters(*proto.GetRateLimitersRequest) (*proto.GetRateLimitersResponse, error)
func (PluginServer) GetSchema ¶
func (s PluginServer) GetSchema(req *proto.GetSchemaRequest) (res *proto.GetSchemaResponse, err error)
func (PluginServer) GetSchemaMode ¶ added in v5.8.0
func (s PluginServer) GetSchemaMode() string
func (PluginServer) GetSupportedOperations ¶
func (s PluginServer) GetSupportedOperations(*proto.GetSupportedOperationsRequest) (*proto.GetSupportedOperationsResponse, 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) SetCacheOptions ¶ added in v5.4.0
func (s PluginServer) SetCacheOptions(req *proto.SetCacheOptionsRequest) (*proto.SetCacheOptionsResponse, error)
func (PluginServer) SetConnectionCacheOptions ¶ added in v5.6.1
func (s PluginServer) SetConnectionCacheOptions(req *proto.SetConnectionCacheOptionsRequest) (*proto.SetConnectionCacheOptionsResponse, error)
func (PluginServer) SetConnectionConfig ¶
func (s PluginServer) SetConnectionConfig(req *proto.SetConnectionConfigRequest) (res *proto.SetConnectionConfigResponse, err error)
func (PluginServer) SetRateLimiters ¶ added in v5.6.0
func (s PluginServer) SetRateLimiters(req *proto.SetRateLimitersRequest) (*proto.SetRateLimitersResponse, error)
func (PluginServer) UpdateConnectionConfigs ¶
func (s PluginServer) UpdateConnectionConfigs(req *proto.UpdateConnectionConfigsRequest) (res *proto.UpdateConnectionConfigsResponse, err error)
type SerializableQual ¶ added in v5.10.0
type SerializableQual struct { Column string `json:"column"` Operator string `json:"operator"` Value any `json:"value"` }
func QualMapToSerializableSlice ¶ added in v5.10.0
func QualMapToSerializableSlice(qualMap map[string]*proto.Quals) []SerializableQual
type SetCacheOptionsFunc ¶ added in v5.4.0
type SetCacheOptionsFunc func(*proto.SetCacheOptionsRequest) error
type SetConnectionCacheOptionsFunc ¶ added in v5.6.1
type SetConnectionCacheOptionsFunc func(*proto.SetConnectionCacheOptionsRequest) error
type SetConnectionConfigFunc ¶
type SetRateLimitersFunc ¶ added in v5.6.0
type SetRateLimitersFunc func(*proto.SetRateLimitersRequest) error
type UpdateConnectionConfigsFunc ¶
type UpdateConnectionConfigsFunc func([]*proto.ConnectionConfig, []*proto.ConnectionConfig, []*proto.ConnectionConfig) (map[string]error, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package proto contains [protobuf] definitions and auto generated code for the plugin service interface.
|
Package proto contains [protobuf] definitions and auto generated code for the plugin service interface. |
Package shared contains types which are shared between plugin implementation and plugin clients
|
Package shared contains types which are shared between plugin implementation and plugin clients |