ui

package
v7.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobsReporter

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

func NewBlobsReporter

func NewBlobsReporter(ui UI) BlobsReporter

func (BlobsReporter) BlobDownloadFinished

func (r BlobsReporter) BlobDownloadFinished(path, blobID string, err error)

func (BlobsReporter) BlobDownloadStarted

func (r BlobsReporter) BlobDownloadStarted(path string, size int64, blobID, sha1 string)

func (BlobsReporter) BlobUploadFinished

func (r BlobsReporter) BlobUploadFinished(path, blobID string, err error)

func (BlobsReporter) BlobUploadStarted

func (r BlobsReporter) BlobUploadStarted(path string, size int64, sha1 string)

type ColorUI

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

func (*ColorUI) AskForChoice

func (ui *ColorUI) AskForChoice(label string, options []string) (int, error)

func (*ColorUI) AskForConfirmation

func (ui *ColorUI) AskForConfirmation() error

func (*ColorUI) AskForPassword

func (ui *ColorUI) AskForPassword(label string) (string, error)

func (*ColorUI) AskForText

func (ui *ColorUI) AskForText(label string) (string, error)

func (*ColorUI) BeginLinef

func (ui *ColorUI) BeginLinef(pattern string, args ...interface{})

func (*ColorUI) EndLinef

func (ui *ColorUI) EndLinef(pattern string, args ...interface{})

func (*ColorUI) ErrorLinef

func (ui *ColorUI) ErrorLinef(pattern string, args ...interface{})

func (*ColorUI) Flush

func (ui *ColorUI) Flush()

func (*ColorUI) IsInteractive

func (ui *ColorUI) IsInteractive() bool

func (*ColorUI) PrintBlock

func (ui *ColorUI) PrintBlock(block []byte)

func (*ColorUI) PrintErrorBlock

func (ui *ColorUI) PrintErrorBlock(block string)

func (*ColorUI) PrintLinef

func (ui *ColorUI) PrintLinef(pattern string, args ...interface{})

func (*ColorUI) PrintTable

func (ui *ColorUI) PrintTable(table Table)

func (*ColorUI) PrintTableFiltered

func (ui *ColorUI) PrintTableFiltered(table Table, filterHeader []Header)

type ComboWriter

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

func NewComboWriter

func NewComboWriter(ui UI) *ComboWriter

func (*ComboWriter) Writer

func (w *ComboWriter) Writer(prefix string) io.Writer

type ConfUI

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

func NewConfUI

func NewConfUI(logger boshlog.Logger) *ConfUI

func NewWrappingConfUI

func NewWrappingConfUI(parent UI, logger boshlog.Logger) *ConfUI

func (*ConfUI) AskForChoice

func (ui *ConfUI) AskForChoice(label string, options []string) (int, error)

func (*ConfUI) AskForConfirmation

func (ui *ConfUI) AskForConfirmation() error

func (*ConfUI) AskForPassword

func (ui *ConfUI) AskForPassword(label string) (string, error)

func (*ConfUI) AskForText

func (ui *ConfUI) AskForText(label string) (string, error)

func (*ConfUI) BeginLinef

func (ui *ConfUI) BeginLinef(pattern string, args ...interface{})

func (*ConfUI) EnableColor

func (ui *ConfUI) EnableColor()

func (*ConfUI) EnableJSON

func (ui *ConfUI) EnableJSON()

func (*ConfUI) EnableNonInteractive

func (ui *ConfUI) EnableNonInteractive()

func (*ConfUI) EnableTTY

func (ui *ConfUI) EnableTTY(force bool)

func (*ConfUI) EndLinef

func (ui *ConfUI) EndLinef(pattern string, args ...interface{})

func (*ConfUI) ErrorLinef

func (ui *ConfUI) ErrorLinef(pattern string, args ...interface{})

func (*ConfUI) Flush

func (ui *ConfUI) Flush()

func (*ConfUI) IsInteractive

func (ui *ConfUI) IsInteractive() bool

func (*ConfUI) PrintBlock

func (ui *ConfUI) PrintBlock(block []byte)

func (*ConfUI) PrintErrorBlock

func (ui *ConfUI) PrintErrorBlock(block string)

func (*ConfUI) PrintLinef

func (ui *ConfUI) PrintLinef(pattern string, args ...interface{})

func (*ConfUI) PrintTable

func (ui *ConfUI) PrintTable(table Table)

func (*ConfUI) PrintTableFiltered

func (ui *ConfUI) PrintTableFiltered(table Table, filterHeader []Header)

func (*ConfUI) ShowColumns

func (ui *ConfUI) ShowColumns(columns []Header)

type FileReporter

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

func NewFileReporter

func NewFileReporter(ui UI) FileReporter

func (FileReporter) TrackDownload

func (r FileReporter) TrackDownload(size int64, writer io.Writer) io.Writer

func (FileReporter) TrackUpload

func (r FileReporter) TrackUpload(size int64, reader io.ReadCloser) bio.ReadSeekCloser

func (FileReporter) Write

func (r FileReporter) Write(b []byte) (int, error)

type IndexReporter

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

func NewIndexReporter

func NewIndexReporter(ui UI) IndexReporter

func (IndexReporter) IndexEntryDownloadFinished

func (r IndexReporter) IndexEntryDownloadFinished(type_, desc string, err error)

func (IndexReporter) IndexEntryDownloadStarted

func (r IndexReporter) IndexEntryDownloadStarted(type_, desc string)

func (IndexReporter) IndexEntryFinishedAdding

func (r IndexReporter) IndexEntryFinishedAdding(type_, desc string, err error)

func (IndexReporter) IndexEntryStartedAdding

func (r IndexReporter) IndexEntryStartedAdding(type_, desc string)

func (IndexReporter) IndexEntryUploadFinished

func (r IndexReporter) IndexEntryUploadFinished(type_, desc string, err error)

func (IndexReporter) IndexEntryUploadStarted

func (r IndexReporter) IndexEntryUploadStarted(type_, desc string)

type NonTTYUI

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

func NewNonTTYUI

func NewNonTTYUI(parent UI) *NonTTYUI

func (*NonTTYUI) AskForChoice

func (ui *NonTTYUI) AskForChoice(label string, options []string) (int, error)

func (*NonTTYUI) AskForConfirmation

func (ui *NonTTYUI) AskForConfirmation() error

func (*NonTTYUI) AskForPassword

func (ui *NonTTYUI) AskForPassword(label string) (string, error)

func (*NonTTYUI) AskForText

func (ui *NonTTYUI) AskForText(label string) (string, error)

func (*NonTTYUI) BeginLinef

func (ui *NonTTYUI) BeginLinef(pattern string, args ...interface{})

func (*NonTTYUI) EndLinef

func (ui *NonTTYUI) EndLinef(pattern string, args ...interface{})

func (*NonTTYUI) ErrorLinef

func (ui *NonTTYUI) ErrorLinef(pattern string, args ...interface{})

func (*NonTTYUI) Flush

func (ui *NonTTYUI) Flush()

func (*NonTTYUI) IsInteractive

func (ui *NonTTYUI) IsInteractive() bool

func (*NonTTYUI) PrintBlock

func (ui *NonTTYUI) PrintBlock(block []byte)

func (*NonTTYUI) PrintErrorBlock

func (ui *NonTTYUI) PrintErrorBlock(block string)

func (*NonTTYUI) PrintLinef

func (ui *NonTTYUI) PrintLinef(pattern string, args ...interface{})

func (*NonTTYUI) PrintTable

func (ui *NonTTYUI) PrintTable(table Table)

func (*NonTTYUI) PrintTableFiltered

func (ui *NonTTYUI) PrintTableFiltered(table Table, filterHeader []Header)

type ReadCloserProxy

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

func (*ReadCloserProxy) Close

func (p *ReadCloserProxy) Close() error

func (*ReadCloserProxy) Read

func (p *ReadCloserProxy) Read(bs []byte) (int, error)

func (ReadCloserProxy) Seek

func (p ReadCloserProxy) Seek(offset int64, whence int) (int64, error)

type ReleaseIndexReporter

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

func NewReleaseIndexReporter

func NewReleaseIndexReporter(ui UI) ReleaseIndexReporter

func (ReleaseIndexReporter) ReleaseIndexAdded

func (r ReleaseIndexReporter) ReleaseIndexAdded(name, desc string, err error)

type SkipStageError

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

func NewSkipStageError

func NewSkipStageError(cause error, skipMessage string) SkipStageError

func (SkipStageError) Cause

func (e SkipStageError) Cause() error

func (SkipStageError) Error

func (e SkipStageError) Error() string

func (SkipStageError) SkipMessage

func (e SkipStageError) SkipMessage() string

type Stage

type Stage interface {
	Perform(name string, closure func() error) error
	PerformComplex(name string, closure func(Stage) error) error
}

func NewStage

func NewStage(ui UI, timeService clock.Clock, logger boshlog.Logger) Stage

type UI

type UI interface {
	ErrorLinef(pattern string, args ...interface{})
	PrintLinef(pattern string, args ...interface{})

	BeginLinef(pattern string, args ...interface{})
	EndLinef(pattern string, args ...interface{})

	PrintBlock([]byte) // takes []byte to avoid string copy
	PrintErrorBlock(string)

	PrintTable(Table)
	PrintTableFiltered(Table, []Header)

	AskForText(label string) (string, error)
	AskForChoice(label string, options []string) (int, error)
	AskForPassword(label string) (string, error)

	// AskForConfirmation returns error if user doesnt want to continue
	AskForConfirmation() error

	IsInteractive() bool

	Flush()
}

func NewColorUI

func NewColorUI(parent UI) UI

func NewIndentingUI

func NewIndentingUI(parent UI) UI

func NewJSONUI

func NewJSONUI(parent UI, logger boshlog.Logger) UI

func NewNonInteractiveUI

func NewNonInteractiveUI(parent UI) UI

func NewPaddingUI

func NewPaddingUI(parent UI) UI

type WriterUI

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

func NewConsoleUI

func NewConsoleUI(logger boshlog.Logger) *WriterUI

func NewWriterUI

func NewWriterUI(outWriter, errWriter io.Writer, logger boshlog.Logger) *WriterUI

func (*WriterUI) AskForChoice

func (ui *WriterUI) AskForChoice(label string, options []string) (int, error)

func (*WriterUI) AskForConfirmation

func (ui *WriterUI) AskForConfirmation() error

func (*WriterUI) AskForPassword

func (ui *WriterUI) AskForPassword(label string) (string, error)

func (*WriterUI) AskForText

func (ui *WriterUI) AskForText(label string) (string, error)

func (*WriterUI) BeginLinef

func (ui *WriterUI) BeginLinef(pattern string, args ...interface{})

PrintBeginf starts a text line

func (*WriterUI) EndLinef

func (ui *WriterUI) EndLinef(pattern string, args ...interface{})

PrintEndf ends a text line

func (*WriterUI) ErrorLinef

func (ui *WriterUI) ErrorLinef(pattern string, args ...interface{})

ErrorLinef starts and ends a text error line

func (*WriterUI) Flush

func (ui *WriterUI) Flush()

func (*WriterUI) IsInteractive

func (ui *WriterUI) IsInteractive() bool

func (*WriterUI) IsTTY

func (ui *WriterUI) IsTTY() bool

func (*WriterUI) PrintBlock

func (ui *WriterUI) PrintBlock(block []byte)

func (*WriterUI) PrintErrorBlock

func (ui *WriterUI) PrintErrorBlock(block string)

func (*WriterUI) PrintLinef

func (ui *WriterUI) PrintLinef(pattern string, args ...interface{})

Printlnf starts and ends a text line

func (*WriterUI) PrintTable

func (ui *WriterUI) PrintTable(table Table)

func (*WriterUI) PrintTableFiltered

func (ui *WriterUI) PrintTableFiltered(table Table, filterHeader []Header)

Directories

Path Synopsis
taskfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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