plugin

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

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 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(opts *ClientOpts) *goplugin.Client

NewClient is a wrapper of plugin.NewClient.

func Serve

func Serve(opts *ServeOpts)

Serve is a wrapper of plugin.Serve. This is entrypoint of all plugins.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an RPC client for the host.

func (*Client) Execute

func (c *Client) Execute(args ExecuteArgs) (string, error)

Execute calls the server-side Execute method and returns generated output.

func (*Client) Name

func (c *Client) Name() (string, error)

Name calls the server-side Name method and returns its version.

func (*Client) Version

func (c *Client) Version() (string, error)

Version calls the server-side Version method and returns its version.

type ClientOpts

type ClientOpts struct {
	Cmd *exec.Cmd
}

ClientOpts is an option for initializing a Client.

type ExecuteArgs

type ExecuteArgs struct {
	Module   terraform.Module
	Settings *print.Settings
}

ExecuteArgs is the collection of arguments being sent by terraform-docs core while executing the plugin command.

type ServeOpts

type ServeOpts struct {
	Name    string
	Version string
	Engine  print.Engine
}

ServeOpts is an option for serving a plugin.

Jump to

Keyboard shortcuts

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