Documentation
¶
Overview ¶
Package productv1 is the API for the V1 product interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
Functions ¶
func Run ¶
func Run(p ProductDeployer)
Run runs a ProductDeployer as an RPC server. It should be called from a plugin's func main.
Types ¶
type ProductDeployer ¶
type ProductDeployer interface {
GetProduct(args []string, cloudConfig []byte, cs cred.Store) ([]byte, error)
}
ProductDeployer is the interface implemented by V1 product plugins.
type ProductPlugin ¶
type ProductPlugin struct {
Plugin ProductDeployer
}
ProductPlugin wraps up the RPC server and client into a single type.
func NewProductPlugin ¶
func NewProductPlugin(pd ProductDeployer) ProductPlugin
NewProductPlugin decorates a ProductDeployer with the RPC functionality requried to operate as a product plugin.
type ProductRPC ¶
type ProductRPC struct {
// contains filtered or unexported fields
}
ProductRPC is an implementation of ProductDeployer that talks over RPC.
func (*ProductRPC) GetProduct ¶
GetProduct calls a plugin's GetProduct method over RPC.
type ProductRPCServer ¶
type ProductRPCServer struct {
Impl ProductDeployer
}
ProductRPCServer is the RPC server that ProductRPC connects to. It conforms to the requirements of net/rpc.
func (*ProductRPCServer) GetProduct ¶
func (p *ProductRPCServer) GetProduct(args Args, resp *Response) error
GetProduct forwards the RPC request to the plugin's GetProduct method and sends back the results.