Documentation
¶
Overview ¶
Package plugin provides the entry point for tfbreak plugins.
Plugins use this package to register their RuleSet with tfbreak-core. The Serve function is called from main() and handles all communication with the tfbreak host process.
Example plugin main.go:
package main
import (
"github.com/jokarl/tfbreak-plugin-sdk/plugin"
"github.com/jokarl/tfbreak-plugin-sdk/tflint"
)
func main() {
plugin.Serve(&plugin.ServeOpts{
RuleSet: &AzurermRuleSet{
BuiltinRuleSet: tflint.BuiltinRuleSet{
Name: "azurerm",
Version: "0.1.0",
Rules: rules.Rules,
},
},
})
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(opts *ServeOpts)
Serve starts the plugin server.
This function registers the plugin's RuleSet and handles communication with the tfbreak host process. It should be called from the plugin's main() function.
Current implementation (v0.1.0): This is a stub implementation that allows plugins to be built as standalone binaries. The plugin will compile and can be executed, but actual host communication is not yet implemented.
Future implementation: Will use HashiCorp's go-plugin library with gRPC for communication between tfbreak-core and plugins. The API (ServeOpts, Serve) will remain stable.
Example:
func main() {
plugin.Serve(&plugin.ServeOpts{
RuleSet: &MyRuleSet{...},
})
}