plugin

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

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{...},
    })
}

Types

type ServeOpts

type ServeOpts struct {
	// RuleSet is the plugin's rule set implementation.
	RuleSet tflint.RuleSet
}

ServeOpts contains options for serving the plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL