controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, param Param) (Controller, Param, error)

Types

type CompiledResourcePathComputer

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

func (*CompiledResourcePathComputer) Parse

func (crpc *CompiledResourcePathComputer) Parse(rsc interface{}) (string, error)

type CompiledRule

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

func (*CompiledRule) Match

func (cr *CompiledRule) Match(rsc interface{}) (bool, error)

type Config

type Config struct {
	Items []Item
}

type Controller

type Controller struct {
	ResourcePathComputer ResourcePathComputer
	Stdin                io.Reader
	Stdout               io.Writer
	Stderr               io.Writer
	Matcher              Matcher
}

func (*Controller) Run

func (ctrl *Controller) Run(ctx context.Context, param Param) error

type Item

type Item struct {
	Rule                 string
	Exclude              bool
	StateOut             string                       `yaml:"state_out"`
	ResourceName         string                       `yaml:"resource_name"`
	TFPath               string                       `yaml:"tf_path"`
	CompiledRule         CompiledRule                 `yaml:"-"`
	CompiledResourceName CompiledResourcePathComputer `yaml:"-"`
}

type Matcher

type Matcher struct{}

func (*Matcher) Compile

func (matcher *Matcher) Compile(rule string) (CompiledRule, error)

type Param

type Param struct {
	ConfigFilePath string
	LogLevel       string
	StatePath      string
	Items          []Item
	SkipState      bool
}

type Resource

type Resource struct {
	Address string                 `json:"address"`
	Type    string                 `json:"type"`
	Name    string                 `json:"name"`
	Values  map[string]interface{} `json:"values"`
}

type ResourcePath

type ResourcePath struct {
	Type string
	Name string
}

func (*ResourcePath) Path

func (rp *ResourcePath) Path() string

type ResourcePathComputer

type ResourcePathComputer struct{}

func (*ResourcePathComputer) Compile

type RootModule

type RootModule struct {
	Resources []Resource `json:"resources"`
}

type State

type State struct {
	Values Values `json:"values"`
}

type Values

type Values struct {
	RootModule RootModule `json:"root_module"`
}

Jump to

Keyboard shortcuts

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