aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/go-plugin/rpc_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/go-plugin/rpc_server.go')
-rw-r--r--vendor/github.com/hashicorp/go-plugin/rpc_server.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/vendor/github.com/hashicorp/go-plugin/rpc_server.go b/vendor/github.com/hashicorp/go-plugin/rpc_server.go
index 3984dc8..5bb18dd 100644
--- a/vendor/github.com/hashicorp/go-plugin/rpc_server.go
+++ b/vendor/github.com/hashicorp/go-plugin/rpc_server.go
@@ -34,10 +34,14 @@ type RPCServer struct {
34 lock sync.Mutex 34 lock sync.Mutex
35} 35}
36 36
37// Accept accepts connections on a listener and serves requests for 37// ServerProtocol impl.
38// each incoming connection. Accept blocks; the caller typically invokes 38func (s *RPCServer) Init() error { return nil }
39// it in a go statement. 39
40func (s *RPCServer) Accept(lis net.Listener) { 40// ServerProtocol impl.
41func (s *RPCServer) Config() string { return "" }
42
43// ServerProtocol impl.
44func (s *RPCServer) Serve(lis net.Listener) {
41 for { 45 for {
42 conn, err := lis.Accept() 46 conn, err := lis.Accept()
43 if err != nil { 47 if err != nil {
@@ -122,6 +126,14 @@ type controlServer struct {
122 server *RPCServer 126 server *RPCServer
123} 127}
124 128
129// Ping can be called to verify the connection (and likely the binary)
130// is still alive to a plugin.
131func (c *controlServer) Ping(
132 null bool, response *struct{}) error {
133 *response = struct{}{}
134 return nil
135}
136
125func (c *controlServer) Quit( 137func (c *controlServer) Quit(
126 null bool, response *struct{}) error { 138 null bool, response *struct{}) error {
127 // End the server 139 // End the server