replacer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package replacer contains the app with methods replace env vars.

Index

Constants

This section is empty.

Variables

View Source
var MissingVariablesErr = errors.New("missing variables")

Functions

func NewWalker

func NewWalker(r *Reporter, opts *Options) *walker

Types

type App

type App struct{}

App contains the methods to scan files and replace env vars.

func (*App) Run

func (a *App) Run(opts *Options) (*Reporter, error)

type EnvReplacer

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

func New

func New(opts *Options) EnvReplacer

func (EnvReplacer) GetMissingVars

func (e EnvReplacer) GetMissingVars() []string

func (*EnvReplacer) Process

func (e *EnvReplacer) Process(r io.Reader, w io.Writer) ([]string, error)

type MissingVars

type MissingVars struct {
	Path string
	Vars []string
}

type Options

type Options struct {
	BasePath      string
	FilePattern   string
	ShowReport    bool
	ScanRecursive bool
	TruncateFiles bool
	StopOnErrors  bool
	StopOnMissing bool
	StopOnEmpty   bool
	Strict        bool
}

func WithPipedOptions

func WithPipedOptions() *Options

type Reporter

type Reporter struct {
	Files       []string
	Matches     []string
	Dirs        []string
	Errors      []error
	MissesFiles []MissingVars

	MissesVars []string
	// contains filtered or unexported fields
}

func NewReporter

func NewReporter(w io.Writer) *Reporter

func (*Reporter) CollectError

func (r *Reporter) CollectError(err error, quitOnError bool) error

func (*Reporter) Dir

func (r *Reporter) Dir(p string)

func (*Reporter) File

func (r *Reporter) File(p string)

func (*Reporter) Header

func (r *Reporter) Header(pattern string)

func (*Reporter) Match

func (r *Reporter) Match(p string)

func (*Reporter) Missing

func (r *Reporter) Missing(path string, vars []string)

func (Reporter) Print

func (r Reporter) Print()

type Stats

type Stats struct {
}

Jump to

Keyboard shortcuts

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