Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataObject ¶
type IPogoPlugin ¶
type IPogoPlugin interface { // Returns info about the plugin. Most importantly API version. Info() *PluginInfoRes // Executes a url-encoded json string, and returns one. Execute(req string) string // Notifies the plugin that a project exists. It is the plugin's responsibility // to decide when and to what extent action should be taken. ProcessProject(req *IProcessProjectReq) error }
The interface that plugins should implement
type IProcessProjectReq ¶
type IProcessProjectReq interface {
Path() string
}
type PluginInfoRes ¶
type PluginInfoRes struct {
Version string `json:"version"`
}
type PluginRPC ¶
type PluginRPC struct {
// contains filtered or unexported fields
}
Here is an implementation that talks over RPC
func (*PluginRPC) Info ¶
func (g *PluginRPC) Info() *PluginInfoRes
func (*PluginRPC) ProcessProject ¶
func (g *PluginRPC) ProcessProject(req *IProcessProjectReq) error
type PluginRPCServer ¶
type PluginRPCServer struct { // This is the real implementation Impl IPogoPlugin }
Here is the RPC server that PluginRPC talks to, conforming to the requirements of net/rpc
func (*PluginRPCServer) Info ¶
func (s *PluginRPCServer) Info(args interface{}, resp **PluginInfoRes) error
func (*PluginRPCServer) ProcessProject ¶
func (s *PluginRPCServer) ProcessProject(args interface{}, resp *error) error
type PogoPlugin ¶
type PogoPlugin struct { // Impl Injection Impl IPogoPlugin }
This is the implementation of plugin.Plugin so we can serve/consume this
This has two methods: Server must return an RPC server for this plugin type. We construct a PluginRPCServer for this.
Client must return an implementation of our interface that communicates over an RPC client. We return PluginRPC for this.
Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.
func (PogoPlugin) Client ¶
func (PogoPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (*PogoPlugin) Server ¶
func (p *PogoPlugin) Server(*plugin.MuxBroker) (interface{}, error)
type ProcessProjectReq ¶
type ProcessProjectReq struct {
PathVar string
}
func (ProcessProjectReq) Path ¶
func (r ProcessProjectReq) Path() string
Click to show internal directories.
Click to hide internal directories.