keystore

package
v0.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

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) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

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

Jump to

Keyboard shortcuts

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