progress

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogFunc

func LogFunc(w io.Writer, format string, v ...interface{})

func LogFuncBold

func LogFuncBold() func(io.Writer, string, ...interface{})

Types

type Counter

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

func NewCounter

func NewCounter(total int) *Counter

func (*Counter) Current

func (c *Counter) Current() string

func (*Counter) SetCount

func (c *Counter) SetCount(value int)

func (*Counter) Stop

func (c *Counter) Stop()

func (*Counter) TerminalOnly

func (c *Counter) TerminalOnly() bool

func (*Counter) UpdateChan

func (c *Counter) UpdateChan() <-chan struct{}

type Dots

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

func NewDots

func NewDots() *Dots

func (*Dots) Current

func (d *Dots) Current() string

func (*Dots) Stop

func (d *Dots) Stop()

func (*Dots) TerminalOnly

func (d *Dots) TerminalOnly() bool

func (*Dots) UpdateChan

func (d *Dots) UpdateChan() <-chan struct{}

type Element

type Element interface {
	UpdateChan() <-chan struct{}
	Current() string
	Stop()
	TerminalOnly() bool
}

type ParserState

type ParserState int
const (
	StateInitial ParserState = iota
	StateInitializing
	StatePlanning
	StateCreating
	StateUpdating
	StateDestroying
	StateDone
)

type Progress

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

func New

func New(prefix string, printFunc func(w io.Writer, format string, v ...interface{}), elements ...Element) *Progress

func (*Progress) Abort

func (p *Progress) Abort()

func (*Progress) Done

func (p *Progress) Done()

func (*Progress) Run

func (p *Progress) Run()

type Terraform

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

func NewTerraform

func NewTerraform() *Terraform

func (*Terraform) Parse

func (p *Terraform) Parse(line string)

type TerraformParser

type TerraformParser struct {
	Outputs map[string]string
	// contains filtered or unexported fields
}

func NewTerraformParser

func NewTerraformParser() *TerraformParser

NewTerraformParser creates terraform log parser. Prepares log lines for showing to the user. Collects terraform output in Outputs map.

func (*TerraformParser) CurrentResourceCount

func (p *TerraformParser) CurrentResourceCount() int

func (*TerraformParser) Error

func (p *TerraformParser) Error() error

func (*TerraformParser) IsApplying

func (p *TerraformParser) IsApplying() bool

func (*TerraformParser) Parse

func (p *TerraformParser) Parse(line string) bool

Parse terraform line returns false if this is not log line from terraform.

func (*TerraformParser) State

func (p *TerraformParser) State() ParserState

func (*TerraformParser) StateLabel

func (p *TerraformParser) StateLabel() string

func (*TerraformParser) TotalResourceCount

func (p *TerraformParser) TotalResourceCount() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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