]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/go-plugin/rpc_server.go
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / go-plugin / rpc_server.go
index 3984dc891ba6fa5afaf2db1dca4666f7895ad4fc..5bb18dd5db16309f838d4b0f8ddb8f99698e6a08 100644 (file)
@@ -34,10 +34,14 @@ type RPCServer struct {
        lock sync.Mutex
 }
 
-// Accept accepts connections on a listener and serves requests for
-// each incoming connection. Accept blocks; the caller typically invokes
-// it in a go statement.
-func (s *RPCServer) Accept(lis net.Listener) {
+// ServerProtocol impl.
+func (s *RPCServer) Init() error { return nil }
+
+// ServerProtocol impl.
+func (s *RPCServer) Config() string { return "" }
+
+// ServerProtocol impl.
+func (s *RPCServer) Serve(lis net.Listener) {
        for {
                conn, err := lis.Accept()
                if err != nil {
@@ -122,6 +126,14 @@ type controlServer struct {
        server *RPCServer
 }
 
+// Ping can be called to verify the connection (and likely the binary)
+// is still alive to a plugin.
+func (c *controlServer) Ping(
+       null bool, response *struct{}) error {
+       *response = struct{}{}
+       return nil
+}
+
 func (c *controlServer) Quit(
        null bool, response *struct{}) error {
        // End the server