Documentation ¶
Index ¶
- Variables
- func RegisterKeyStoreServer(s *grpc.Server, srv KeyStoreServer)
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)
- func (m *GetRequest) GetKey() string
- func (*GetRequest) ProtoMessage()
- func (m *GetRequest) Reset()
- func (m *GetRequest) String() string
- func (m *GetRequest) XXX_DiscardUnknown()
- func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetRequest) XXX_Merge(src proto.Message)
- func (m *GetRequest) XXX_Size() int
- func (m *GetRequest) XXX_Unmarshal(b []byte) error
- type GetResponse
- func (*GetResponse) Descriptor() ([]byte, []int)
- func (m *GetResponse) GetValue() string
- func (*GetResponse) ProtoMessage()
- func (m *GetResponse) Reset()
- func (m *GetResponse) String() string
- func (m *GetResponse) XXX_DiscardUnknown()
- func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetResponse) XXX_Merge(src proto.Message)
- func (m *GetResponse) XXX_Size() int
- func (m *GetResponse) XXX_Unmarshal(b []byte) error
- type KVGRPCPlugin
- type KeyStoreClient
- type KeyStoreServer
- type PutRequest
- func (*PutRequest) Descriptor() ([]byte, []int)
- func (m *PutRequest) GetKey() string
- func (m *PutRequest) GetValue() string
- func (*PutRequest) ProtoMessage()
- func (m *PutRequest) Reset()
- func (m *PutRequest) String() string
- func (m *PutRequest) XXX_DiscardUnknown()
- func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PutRequest) XXX_Merge(src proto.Message)
- func (m *PutRequest) XXX_Size() int
- func (m *PutRequest) XXX_Unmarshal(b []byte) error
- type PythonAPI
- type ShutdownRequest
- func (*ShutdownRequest) Descriptor() ([]byte, []int)
- func (m *ShutdownRequest) GetClientid() string
- func (*ShutdownRequest) ProtoMessage()
- func (m *ShutdownRequest) Reset()
- func (m *ShutdownRequest) String() string
- func (m *ShutdownRequest) XXX_DiscardUnknown()
- func (m *ShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ShutdownRequest) XXX_Merge(src proto.Message)
- func (m *ShutdownRequest) XXX_Size() int
- func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error
- type ShutdownResponse
- func (*ShutdownResponse) Descriptor() ([]byte, []int)
- func (m *ShutdownResponse) GetResult() bool
- func (*ShutdownResponse) ProtoMessage()
- func (m *ShutdownResponse) Reset()
- func (m *ShutdownResponse) String() string
- func (m *ShutdownResponse) XXX_DiscardUnknown()
- func (m *ShutdownResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ShutdownResponse) XXX_Merge(src proto.Message)
- func (m *ShutdownResponse) XXX_Size() int
- func (m *ShutdownResponse) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
Handshake is a common handshake that is shared by plugin and host.
View Source
var PluginMap = map[string]plugin.Plugin{ "kv_grpc": &KVGRPCPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
func RegisterKeyStoreServer ¶
func RegisterKeyStoreServer(s *grpc.Server, srv KeyStoreServer)
Types ¶
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type GetRequest ¶
type GetRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
the get request
func (*GetRequest) Descriptor ¶
func (*GetRequest) Descriptor() ([]byte, []int)
func (*GetRequest) GetKey ¶
func (m *GetRequest) GetKey() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) Reset ¶
func (m *GetRequest) Reset()
func (*GetRequest) String ¶
func (m *GetRequest) String() string
func (*GetRequest) XXX_DiscardUnknown ¶
func (m *GetRequest) XXX_DiscardUnknown()
func (*GetRequest) XXX_Marshal ¶
func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetRequest) XXX_Merge ¶
func (m *GetRequest) XXX_Merge(src proto.Message)
func (*GetRequest) XXX_Size ¶
func (m *GetRequest) XXX_Size() int
func (*GetRequest) XXX_Unmarshal ¶
func (m *GetRequest) XXX_Unmarshal(b []byte) error
type GetResponse ¶
type GetResponse struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetResponse) Descriptor ¶
func (*GetResponse) Descriptor() ([]byte, []int)
func (*GetResponse) GetValue ¶
func (m *GetResponse) GetValue() string
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) Reset ¶
func (m *GetResponse) Reset()
func (*GetResponse) String ¶
func (m *GetResponse) String() string
func (*GetResponse) XXX_DiscardUnknown ¶
func (m *GetResponse) XXX_DiscardUnknown()
func (*GetResponse) XXX_Marshal ¶
func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetResponse) XXX_Merge ¶
func (m *GetResponse) XXX_Merge(src proto.Message)
func (*GetResponse) XXX_Size ¶
func (m *GetResponse) XXX_Size() int
func (*GetResponse) XXX_Unmarshal ¶
func (m *GetResponse) XXX_Unmarshal(b []byte) error
type KVGRPCPlugin ¶
type KVGRPCPlugin struct { // GRPCPlugin must still implement the Plugin interface plugin.Plugin // Concrete implementation, written in Go. This is only used for plugins // that are written in Go. Impl PythonAPI }
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*KVGRPCPlugin) GRPCClient ¶
func (p *KVGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*KVGRPCPlugin) GRPCServer ¶
func (p *KVGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type KeyStoreClient ¶
type KeyStoreClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*Empty, error) Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error) }
KeyStoreClient is the client API for KeyStore service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewKeyStoreClient ¶
func NewKeyStoreClient(cc *grpc.ClientConn) KeyStoreClient
type KeyStoreServer ¶
type KeyStoreServer interface { Get(context.Context, *GetRequest) (*GetResponse, error) Put(context.Context, *PutRequest) (*Empty, error) Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error) }
KeyStoreServer is the server API for KeyStore service.
type PutRequest ¶
type PutRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PutRequest) Descriptor ¶
func (*PutRequest) Descriptor() ([]byte, []int)
func (*PutRequest) GetKey ¶
func (m *PutRequest) GetKey() string
func (*PutRequest) GetValue ¶
func (m *PutRequest) GetValue() string
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) Reset ¶
func (m *PutRequest) Reset()
func (*PutRequest) String ¶
func (m *PutRequest) String() string
func (*PutRequest) XXX_DiscardUnknown ¶
func (m *PutRequest) XXX_DiscardUnknown()
func (*PutRequest) XXX_Marshal ¶
func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PutRequest) XXX_Merge ¶
func (m *PutRequest) XXX_Merge(src proto.Message)
func (*PutRequest) XXX_Size ¶
func (m *PutRequest) XXX_Size() int
func (*PutRequest) XXX_Unmarshal ¶
func (m *PutRequest) XXX_Unmarshal(b []byte) error
type PythonAPI ¶
type PythonAPI interface { Put(key string, value string) error Get(key string) (string, error) Shutdown(clientID string) (bool, error) }
KV is the interface that we're exposing as a plugin.
type ShutdownRequest ¶
type ShutdownRequest struct { Clientid string `protobuf:"bytes,1,opt,name=clientid,proto3" json:"clientid,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ShutdownRequest) Descriptor ¶
func (*ShutdownRequest) Descriptor() ([]byte, []int)
func (*ShutdownRequest) GetClientid ¶
func (m *ShutdownRequest) GetClientid() string
func (*ShutdownRequest) ProtoMessage ¶
func (*ShutdownRequest) ProtoMessage()
func (*ShutdownRequest) Reset ¶
func (m *ShutdownRequest) Reset()
func (*ShutdownRequest) String ¶
func (m *ShutdownRequest) String() string
func (*ShutdownRequest) XXX_DiscardUnknown ¶
func (m *ShutdownRequest) XXX_DiscardUnknown()
func (*ShutdownRequest) XXX_Marshal ¶
func (m *ShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ShutdownRequest) XXX_Merge ¶
func (m *ShutdownRequest) XXX_Merge(src proto.Message)
func (*ShutdownRequest) XXX_Size ¶
func (m *ShutdownRequest) XXX_Size() int
func (*ShutdownRequest) XXX_Unmarshal ¶
func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error
type ShutdownResponse ¶
type ShutdownResponse struct { Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ShutdownResponse) Descriptor ¶
func (*ShutdownResponse) Descriptor() ([]byte, []int)
func (*ShutdownResponse) GetResult ¶
func (m *ShutdownResponse) GetResult() bool
func (*ShutdownResponse) ProtoMessage ¶
func (*ShutdownResponse) ProtoMessage()
func (*ShutdownResponse) Reset ¶
func (m *ShutdownResponse) Reset()
func (*ShutdownResponse) String ¶
func (m *ShutdownResponse) String() string
func (*ShutdownResponse) XXX_DiscardUnknown ¶
func (m *ShutdownResponse) XXX_DiscardUnknown()
func (*ShutdownResponse) XXX_Marshal ¶
func (m *ShutdownResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ShutdownResponse) XXX_Merge ¶
func (m *ShutdownResponse) XXX_Merge(src proto.Message)
func (*ShutdownResponse) XXX_Size ¶
func (m *ShutdownResponse) XXX_Size() int
func (*ShutdownResponse) XXX_Unmarshal ¶
func (m *ShutdownResponse) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.