diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
commit | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/hashicorp/go-plugin/rpc_server.go | |
parent | 07971ca38143c5faf951d152fba370ddcbe26ad5 (diff) | |
download | terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip |
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
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 |