-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unused net/rpc based plugin implementations (#147)
- Loading branch information
Showing
42 changed files
with
163 additions
and
2,803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
// Package plugin contains the implementations needed to make | ||
// the built binary act as a plugin. | ||
// | ||
// A plugin is implemented as an RPC server and the host acts | ||
// A plugin is implemented as an gRPC server and the host acts | ||
// as the client, sending analysis requests to the plugin. | ||
// Note that the server-client relationship here is the opposite of | ||
// the communication that takes place during the checking phase. | ||
// | ||
// Implementation details are hidden in go-plugin. This package is | ||
// essentially a wrapper for go-plugin. | ||
// See host2plugin for implementation details. | ||
package plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,15 @@ | ||
package plugin | ||
|
||
import ( | ||
"encoding/gob" | ||
"net/rpc" | ||
|
||
plugin "github.com/hashicorp/go-plugin" | ||
"github.com/terraform-linters/tflint-plugin-sdk/tflint" | ||
"github.com/terraform-linters/tflint-plugin-sdk/plugin/host2plugin" | ||
|
||
// Import this package to initialize the global logger | ||
_ "github.com/terraform-linters/tflint-plugin-sdk/logger" | ||
) | ||
|
||
// handShakeConfig is used for UX. ProcotolVersion will be updated by incompatible changes. | ||
var handshakeConfig = plugin.HandshakeConfig{ | ||
ProtocolVersion: 9, | ||
MagicCookieKey: "TFLINT_RULESET_PLUGIN", | ||
MagicCookieValue: "5adSn1bX8nrDfgBqiAqqEkC6OE1h3iD8SqbMc5UUONx8x3xCF0KlPDsBRNDjoYDP", | ||
} | ||
|
||
// RuleSetPlugin is a wrapper to satisfy the interface of go-plugin. | ||
type RuleSetPlugin struct { | ||
impl tflint.RPCRuleSet | ||
} | ||
|
||
// Server returns an RPC server acting as a plugin. | ||
func (p *RuleSetPlugin) Server(b *plugin.MuxBroker) (interface{}, error) { | ||
return &Server{impl: p.impl, broker: b}, nil | ||
} | ||
|
||
// Client returns an RPC client for the host. | ||
func (RuleSetPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error) { | ||
return &Client{rpcClient: c, broker: b}, nil | ||
} | ||
// ServeOpts is an option for serving a plugin. | ||
// Each plugin can pass a RuleSet that represents its own functionality. | ||
type ServeOpts = host2plugin.ServeOpts | ||
|
||
func init() { | ||
gob.Register(tflint.Error{}) | ||
} | ||
// Serve is a wrapper of plugin.Serve. This is entrypoint of all plugins. | ||
var Serve = host2plugin.Serve |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.