diff options
author | appilon <apilon@hashicorp.com> | 2019-02-27 16:43:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 16:43:31 -0500 |
commit | 844b5a68d8af4791755b8f0ad293cc99f5959183 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/hashicorp/go-plugin/rpc_server.go | |
parent | 303b299eeb6b06e939e35905e4b34cb410dd9dc3 (diff) | |
parent | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (diff) | |
download | terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.tar.gz terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.tar.zst terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.zip |
Merge pull request #27 from terraform-providers/go-modules-2019-02-22
[MODULES] Switch to Go Modules
Diffstat (limited to 'vendor/github.com/hashicorp/go-plugin/rpc_server.go')
-rw-r--r-- | vendor/github.com/hashicorp/go-plugin/rpc_server.go | 20 |
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 | 38 | func (s *RPCServer) Init() error { return nil } |
39 | // it in a go statement. | 39 | |
40 | func (s *RPCServer) Accept(lis net.Listener) { | 40 | // ServerProtocol impl. |
41 | func (s *RPCServer) Config() string { return "" } | ||
42 | |||
43 | // ServerProtocol impl. | ||
44 | func (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. | ||
131 | func (c *controlServer) Ping( | ||
132 | null bool, response *struct{}) error { | ||
133 | *response = struct{}{} | ||
134 | return nil | ||
135 | } | ||
136 | |||
125 | func (c *controlServer) Quit( | 137 | func (c *controlServer) Quit( |
126 | null bool, response *struct{}) error { | 138 | null bool, response *struct{}) error { |
127 | // End the server | 139 | // End the server |