processing

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExclusionNamesList []string = []string{
	".terraform",
	".git",
}

DefaultExclusionNamesList contains well-known file and folder names to be excluded from processing

Functions

func LevelFromString

func LevelFromString(logLevel string) (logging.Level, error)

LevelFromString converts string representation of log level to its typed version

Types

type Config

type Config struct {
	// Write indicates if files should be updated
	Write bool

	// Exclude files/folders by name
	ExcludeNames []string

	// ExcludeItemsFunc checks if the given item should be excluded or not
	ExcludeItemsFunc ExcludeFileFunc
}

Config holds configuration for revision manager

type ExcludeFileFunc

type ExcludeFileFunc func(fs.FileInfo) bool

ExcludeFileFunc makes a decision if particular file/folder should be excluded

var DefaultExclusionFunc ExcludeFileFunc = func(info fs.FileInfo) bool {
	return !strings.HasPrefix(info.Name(), ".")
}

DefaultExclusionFunc excludes all hidden, e.g. starting with dot ".", folders and files

type Result

type Result struct {
	Message string
	Level   logging.Level
}

Result wraps log message with a given log level

func (*Result) String

func (p *Result) String() string

type ResultFactory

type ResultFactory struct {
}

ResultFactory wraps building of Result messages with convenient logging functions

func NewResultFactory

func NewResultFactory() *ResultFactory

func (*ResultFactory) Debug

func (rf *ResultFactory) Debug(msg string) Result

func (*ResultFactory) Error

func (rf *ResultFactory) Error(msg string) Result

func (*ResultFactory) Info

func (rf *ResultFactory) Info(msg string) Result

func (*ResultFactory) Trace

func (rf *ResultFactory) Trace(msg string) Result

func (*ResultFactory) Warn

func (rf *ResultFactory) Warn(msg string) Result

type Results

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

Results holds a set of Result messages alongside with errors

func NewResults

func NewResults(level logging.Level) *Results

func (*Results) Append

func (p *Results) Append(new ...interface{})

Append adds more items to the results set which might be rendered later

func (*Results) HasErrors

func (p *Results) HasErrors() bool

HasErrors indicates that there was an error

func (*Results) String

func (p *Results) String() string

String renders result records as string

type RevisionManager

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

RevisionManager is responsible for managing module source updates

func NewManager

func NewManager(config Config, strategy strategies.Strategy) *RevisionManager

func (*RevisionManager) ProcessPaths

func (m *RevisionManager) ProcessPaths(paths []string, results *Results)

ProcessPaths processes Terraform in the given paths

The process is recursive and checks only files that are not ignored (see ignoredFile())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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