github.com/DaAlbrecht/cf-cli@v0.0.0-20231128151943-1fe19bb400b9/command/ui.go (about)

     1  package command
     2  
     3  import (
     4  	"io"
     5  	"time"
     6  
     7  	"code.cloudfoundry.org/cli/util/ui"
     8  )
     9  
    10  // UI is the interface to STDOUT, STDERR, and STDIN.
    11  //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . UI
    12  type UI interface {
    13  	DeferText(template string, data ...map[string]interface{})
    14  	DisplayBoolPrompt(defaultResponse bool, template string, templateValues ...map[string]interface{}) (bool, error)
    15  	DisplayChangesForPush(changeSet []ui.Change) error
    16  	DisplayDeprecationWarning()
    17  	DisplayDiffAddition(line string, depth int, addHyphen bool)
    18  	DisplayDiffRemoval(line string, depth int, addHyphen bool)
    19  	DisplayDiffUnchanged(line string, depth int, addHyphen bool)
    20  	DisplayError(err error)
    21  	DisplayFileDeprecationWarning()
    22  	DisplayHeader(text string)
    23  	DisplayInstancesTableForApp(table [][]string)
    24  	DisplayJSON(name string, jsonData interface{}) error
    25  	DisplayKeyValueTable(prefix string, table [][]string, padding int)
    26  	DisplayKeyValueTableForApp(table [][]string)
    27  	DisplayLogMessage(message ui.LogMessage, displayHeader bool)
    28  	DisplayNewline()
    29  	DisplayNonWrappingTable(prefix string, table [][]string, padding int)
    30  	DisplayOK()
    31  	DisplayOptionalTextPrompt(defaultValue string, template string, templateValues ...map[string]interface{}) (string, error)
    32  	DisplayPasswordPrompt(template string, templateValues ...map[string]interface{}) (string, error)
    33  	DisplayTableWithHeader(prefix string, table [][]string, padding int)
    34  	DisplayText(template string, data ...map[string]interface{})
    35  	DisplayTextMenu(choices []string, promptTemplate string, templateValues ...map[string]interface{}) (string, error)
    36  	DisplayTextPrompt(template string, templateValues ...map[string]interface{}) (string, error)
    37  	DisplayTextWithBold(text string, keys ...map[string]interface{})
    38  	DisplayTextWithFlavor(text string, keys ...map[string]interface{})
    39  	DisplayWarning(formattedString string, keys ...map[string]interface{})
    40  	DisplayWarnings(warnings []string)
    41  	GetErr() io.Writer
    42  	GetIn() io.Reader
    43  	GetOut() io.Writer
    44  	RequestLoggerFileWriter(filePaths []string) *ui.RequestLoggerFileWriter
    45  	RequestLoggerTerminalDisplay() *ui.RequestLoggerTerminalDisplay
    46  	TranslateText(template string, data ...map[string]interface{}) string
    47  	UserFriendlyDate(input time.Time) string
    48  	Writer() io.Writer
    49  }