Documentation ¶
Index ¶
- Variables
- func Join(ui UI, messages ...app_msg.Message) app_msg.Message
- func MakeConsoleDemo(mc app_msg_container.Container, f func(ui UI)) string
- func MakeMarkdown(mc app_msg_container.Container, f func(ui UI)) string
- func ShowLongRunningProgress(ui UI, seed string, msg app_msg.Message)
- func ShowProgress(ui UI)
- func ShowProgressWithMessage(ui UI, msg app_msg.Message)
- type MsgConsole
- type MsgProgress
- type RowLimiter
- type Syntax
- type Table
- type UI
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MConsole = app_msg.Apply(&MsgConsole{}).(*MsgConsole)
)
View Source
var (
MProgress = app_msg.Apply(&MsgProgress{}).(*MsgProgress)
)
Functions ¶
func MakeConsoleDemo ¶
func MakeConsoleDemo(mc app_msg_container.Container, f func(ui UI)) string
func MakeMarkdown ¶
func MakeMarkdown(mc app_msg_container.Container, f func(ui UI)) string
func ShowLongRunningProgress ¶
func ShowProgress ¶
func ShowProgress(ui UI)
func ShowProgressWithMessage ¶
Types ¶
type MsgConsole ¶
type MsgProgress ¶
type RowLimiter ¶
type RowLimiter interface { Row(f func()) Flush() }
func NewRowLimiter ¶
func NewRowLimiter(sy Syntax, name string) RowLimiter
type Syntax ¶
type Syntax interface { // Header Header(m app_msg.Message) // Sub header SubHeader(m app_msg.Message) // Info Info(m app_msg.Message) // Create information table InfoTable(name string) Table // Error Error(m app_msg.Message) // Break Break() // Ask to continue. This confirmation step may be skipped on some UI implementation. // If you want to ensure actual user acknowledge, please use AskCont instead. AskProceed(m app_msg.Message) // Ask continue AskCont(m app_msg.Message) (cont bool) // Ask for a text AskText(m app_msg.Message) (text string, cancel bool) // Ask for a credentials AskSecure(m app_msg.Message) (secure string, cancel bool) // Display success message Success(m app_msg.Message) // Display failure message Failure(m app_msg.Message) // Display progress Progress(m app_msg.Message) // Code block Code(code string) // Quote Quote(m app_msg.Message) // Link to artifact Link(artifact rp_artifact.Artifact) // True when the syntax is for console IsConsole() bool // True when the syntax is for web IsWeb() bool // New UI with given message syntax WithContainerSyntax(mc app_msg_container.Container) Syntax // Message container of this UI Messages() app_msg_container.Container }
type UI ¶
type UI interface { Syntax // Test existence of the message key Exists(m app_msg.Message) bool // Dealing with table. Table will be automatically closed after the f finished. WithTable(name string, f func(t Table)) // Compile text Text(m app_msg.Message) string // Compile text, returns empty string if the key is not found TextOrEmpty(m app_msg.Message) string // Unique identifier of this UI Id() string // New UI with given message container WithContainer(mc app_msg_container.Container) UI }
func NewConsole ¶
func NewConsole(mc app_msg_container.Container, lg esl.Logger, wr io.Writer, dg es_dialogue.Dialogue) UI
func NewDiscard ¶
func NewDiscard(mc app_msg_container.Container, lg esl.Logger) UI
func NewMarkdown ¶
func NewMarkdown(mc app_msg_container.Container, lg esl.Logger, wr io.Writer, dg es_dialogue.Dialogue) UI
Click to show internal directories.
Click to hide internal directories.