Documentation ¶
Index ¶
- type ExecutableStore
- type ExecutableStoreFilesystem
- type Execute
- type Greeter
- type GreeterPlugin
- type GreeterRPC
- type GreeterRPCServer
- type Response
- type Runnable
- type RunnableEndpoint
- type SimpleRunnable
- func (r *SimpleRunnable) Attach(endpoint string, pid int) error
- func (r SimpleRunnable) Build(store ExecutableStore) error
- func (r *SimpleRunnable) Execute(s string) (string, error)
- func (s *SimpleRunnable) FilePath() string
- func (r *SimpleRunnable) IsUp() (bool, error)
- func (r *SimpleRunnable) Run(store ExecutableStore) (RunnableEndpoint, error)
- func (r *SimpleRunnable) RunForever(store ExecutableStore) error
- func (r *SimpleRunnable) RunPlugin(path string, ac chan *plugin.ReattachConfig)
- func (r SimpleRunnable) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutableStore ¶ added in v0.2.0
type ExecutableStoreFilesystem ¶ added in v0.2.0
type ExecutableStoreFilesystem struct {
Root string
}
func (ExecutableStoreFilesystem) Add ¶ added in v0.2.0
func (s ExecutableStoreFilesystem) Add(p string, b *[]byte) error
func (ExecutableStoreFilesystem) Exists ¶ added in v0.2.0
func (s ExecutableStoreFilesystem) Exists(p string) (bool, error)
func (ExecutableStoreFilesystem) GetPath ¶ added in v0.2.0
func (s ExecutableStoreFilesystem) GetPath(p string) string
type Greeter ¶ added in v0.2.0
type Greeter interface {
Greet() Response
}
Greeter is the interface that we're exposing as a plugin.
type GreeterPlugin ¶ added in v0.2.0
type GreeterPlugin struct { // Impl Injection Impl Greeter }
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 GreeterRPCServer for this.
Client must return an implementation of our interface that communicates over an RPC client. We return GreeterRPC for this.
Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.
func (GreeterPlugin) Client ¶ added in v0.2.0
func (GreeterPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (*GreeterPlugin) Server ¶ added in v0.2.0
func (p *GreeterPlugin) Server(*plugin.MuxBroker) (interface{}, error)
type GreeterRPC ¶ added in v0.2.0
type GreeterRPC struct {
// contains filtered or unexported fields
}
Here is an implementation that talks over RPC
func (*GreeterRPC) Greet ¶ added in v0.2.0
func (g *GreeterRPC) Greet() string
type GreeterRPCServer ¶ added in v0.2.0
type GreeterRPCServer struct { // This is the real implementation Impl Greeter }
Here is the RPC server that GreeterRPC talks to, conforming to the requirements of net/rpc
func (*GreeterRPCServer) Greet ¶ added in v0.2.0
func (s *GreeterRPCServer) Greet(args interface{}, resp *Response) error
type Runnable ¶
type Runnable interface { Build(ExecutableStore) error Run(ExecutableStore) error Stop() error }
type RunnableEndpoint ¶ added in v0.2.0
type SimpleRunnable ¶
type SimpleRunnable struct { Name string //Code []byte Location string Client *plugin.Client KV shared.KV }
func GetRunnableForProject ¶ added in v0.2.0
func GetRunnableForProject(p *models.Service) (SimpleRunnable, error)
func (*SimpleRunnable) Attach ¶ added in v0.2.0
func (r *SimpleRunnable) Attach(endpoint string, pid int) error
func (SimpleRunnable) Build ¶
func (r SimpleRunnable) Build(store ExecutableStore) error
func (*SimpleRunnable) Execute ¶ added in v0.2.0
func (r *SimpleRunnable) Execute(s string) (string, error)
func (*SimpleRunnable) FilePath ¶ added in v0.2.0
func (s *SimpleRunnable) FilePath() string
func (*SimpleRunnable) IsUp ¶ added in v0.2.0
func (r *SimpleRunnable) IsUp() (bool, error)
func (*SimpleRunnable) Run ¶
func (r *SimpleRunnable) Run(store ExecutableStore) (RunnableEndpoint, error)
func (*SimpleRunnable) RunForever ¶ added in v0.2.0
func (r *SimpleRunnable) RunForever(store ExecutableStore) error
func (*SimpleRunnable) RunPlugin ¶ added in v0.2.0
func (r *SimpleRunnable) RunPlugin(path string, ac chan *plugin.ReattachConfig)
func (SimpleRunnable) Stop ¶ added in v0.2.0
func (r SimpleRunnable) Stop() error