scripted

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyString = `ZVaXr3jCd80vqJRhBP9t83LrpWIdNKWJ` // String representing empty value, can be set to anything (eg. generate random each time)
View Source
var Stderr = os.Stderr

Store original os.Stderr and os.Stdout, because it gets overwritten by go-plugin/server:Serve()

View Source
var Stdout = os.Stdout
View Source
var TemplateFuncs = getTemplateFuncs()
View Source
var ValidLevelsStrings = []string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"}

Functions

func Provider

func Provider() terraform.ResourceProvider

func RandomSafeString

func RandomSafeString(length int) string

func RandomString

func RandomString(length int) string

func RandomStringWithCharset

func RandomStringWithCharset(length int, charset string) string

Types

type ChangeMap

type ChangeMap struct {
	Old map[string]string
	New map[string]string
	Cur map[string]string
}

type CommandTemplates

type CommandTemplates struct {
	Create       string
	Delete       string
	Exists       string
	Id           string
	Interpreter  []string
	Prefix       string
	Read         string
	ShouldUpdate string
	Update       string
}

type CommandsConfig

type CommandsConfig struct {
	Environment          *EnvironmentConfig
	Templates            *CommandTemplates
	Output               *OutputConfig
	CreateAfterUpdate    bool
	DeleteBeforeUpdate   bool
	DeleteOnNotExists    bool
	DeleteOnReadFailure  bool
	ExistsExpectedStatus int
	Separator            string
	WorkingDirectory     string
}

type EnvironmentConfig

type EnvironmentConfig struct {
	PrefixNew     string
	PrefixOld     string
	IncludeParent bool
}

type LoggedOutput

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

func (*LoggedOutput) Close

func (lo *LoggedOutput) Close()

func (*LoggedOutput) Start

func (lo *LoggedOutput) Start() *os.File

type Logger

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

func (*Logger) Log

func (l *Logger) Log(level hclog.Level, msg string, args ...interface{})

func (*Logger) With

func (l *Logger) With(args ...interface{}) *Logger

type Logging

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

func (*Logging) Clone

func (ls *Logging) Clone() *Logging

func (*Logging) Log

func (ls *Logging) Log(level hclog.Level, msg string, args ...interface{})

func (*Logging) PopIf

func (ls *Logging) PopIf(expected *Logger) *Logger

func (*Logging) Push

func (ls *Logging) Push(args ...interface{}) *Logger

type Operation

type Operation string
const (
	Create Operation = "create"
	Read   Operation = "read"
	Exists Operation = "exists"
	Update Operation = "update"
	Delete Operation = "delete"
)

type OutputConfig

type OutputConfig struct {
	LogLevel  hclog.Level
	LineWidth int
}

type ProviderConfig

type ProviderConfig struct {
	Commands          *CommandsConfig
	Logging           *Logging
	Templates         *TemplatesConfig
	EmptyString       string
	LoggingBufferSize int64
	OutputLinePrefix  string
	OutputFormat      string
	StateFormat       string
	StateLinePrefix   string
}

type ResourceConfig

type ResourceConfig struct {
	LogName              string
	EnvironmentTemplates []string
	Context              *ChangeMap
	// contains filtered or unexported fields
}

type Scripted

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

func New

func New(d *schema.ResourceData, meta interface{}, operation Operation, old bool) (*Scripted, error)

func (*Scripted) Environment

func (s *Scripted) Environment() (*ChangeMap, error)

type TemplateContext

type TemplateContext struct {
	*ChangeMap
	Operation    Operation
	EmptyString  string
	StatePrefix  string
	OutputPrefix string
	Output       map[string]string
	State        *ChangeMap
}

type TemplatesConfig

type TemplatesConfig struct {
	LeftDelim  string
	RightDelim string
}

Jump to

Keyboard shortcuts

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