plugin

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MPL-2.0 Imports: 9 Imported by: 65

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(opts *ClientOpts) *plugin.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 use by the host

func (*Client) ApplyConfig

func (c *Client) ApplyConfig(config *tflint.Config) error

ApplyConfig queries the RPC server for ApplyConfig

func (*Client) Check

func (c *Client) Check(server tflint.Server) error

Check queries the RPC server for Check For bi-directional communication, you can pass a server that accepts Runner's queries

func (*Client) RuleNames

func (c *Client) RuleNames() ([]string, error)

RuleNames queries the RPC server for RuleNames

func (*Client) RuleSetName

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

RuleSetName queries the RPC server for RuleSetName

func (*Client) RuleSetVersion

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

RuleSetVersion queries the RPC server for RuleSetVersion

type ClientOpts

type ClientOpts struct {
	Cmd *exec.Cmd
}

ClientOpts is an option for initializing the RPC client

type RuleSetPlugin

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

RuleSetPlugin is a wrapper to satisfy the interface of go-plugin

func (RuleSetPlugin) Client

func (RuleSetPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

Client returns an RPC client for use by the host

func (*RuleSetPlugin) Server

func (p *RuleSetPlugin) Server(b *plugin.MuxBroker) (interface{}, error)

Server returns an RPC server acting as a plugin

type ServeOpts

type ServeOpts struct {
	RuleSet tflint.RuleSet
}

ServeOpts is an option for serving a plugin Each plugin can pass a RuleSet that represents its own functionality

type Server

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

Server is an RPC server acting as a plugin

func (*Server) ApplyConfig

func (s *Server) ApplyConfig(config *tflint.Config, resp *interface{}) error

ApplyConfig applies the passed config to its own plugin implementation

func (*Server) Check

func (s *Server) Check(brokerID uint32, resp *interface{}) error

Check initializes an RPC client that can query to the host process and pass it to the Check method

func (*Server) RuleNames

func (s *Server) RuleNames(args interface{}, resp *[]string) error

RuleNames replies its own the result of RuleNames

func (*Server) RuleSetName

func (s *Server) RuleSetName(args interface{}, resp *string) error

RuleSetName replies its own the result of RuleSetName

func (*Server) RuleSetVersion

func (s *Server) RuleSetVersion(args interface{}, resp *string) error

RuleSetVersion replies its own the result of RuleSetVersion

Jump to

Keyboard shortcuts

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