Documentation
¶
Index ¶
Constants ¶
View Source
const ( OK int32 = 0 ERR_BUF_TOO_SMALL int32 = -1 ERR_INVALID_UTF8 int32 = -2 ERR_EMPTY_INPUT int32 = -3 ERR_INTERNAL int32 = -4 ERR_FAILED_UNMARSHAL_MESSAGE int32 = -5 ERR_INIT_STORE int32 = -6 ERR_FAILED_VALUE_RETRIEVAL int32 = -7 )
Error codes shared with the host.
View Source
const ImplementationNetworkErr string = "implementation %s error: %v for token: %s"
Variables ¶
View Source
var ( ErrRetrieveFailed = errors.New("failed to retrieve config item") ErrClientInitialization = errors.New("failed to initialize the client") ErrEmptyResponse = errors.New("value retrieved but empty for token") ErrServiceCallFailed = errors.New("failed to complete the service call") )
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "CONFIGMANAGER_PLUGIN",
MagicCookieValue: "hello",
}
Handshake is a common handshake that is shared by plugin and host.
View Source
var PluginMap = map[string]plugin.Plugin{ "configmanager_token_store": &GRPCPlugin{}, }
// PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is the host process talking to the plugins i.e. the GRPCServer implementation of the TokenStore
type GRPCPlugin ¶
type GRPCPlugin 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 TokenStore
}
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*GRPCPlugin) GRPCClient ¶
func (p *GRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*GRPCPlugin) GRPCServer ¶
func (p *GRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type GRPCServer ¶
type GRPCServer struct {
// This is the real implementation
Impl TokenStore
}
Here is the gRPC server that GRPCClient talks to.
func (*GRPCServer) Value ¶
func (m *GRPCServer) Value(ctx context.Context, req *proto.TokenValueRequest) (*proto.TokenValueResponse, error)
Click to show internal directories.
Click to hide internal directories.