ui

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlertDanger

func AlertDanger(text string) string

func AlertInfo

func AlertInfo(text string) string

func AlertWarning

func AlertWarning(text string) string

func BlockQuote

func BlockQuote(text string) string

BlockQuote adds two space characters to the start of every line in the text

func BlueText

func BlueText(payload string) _aurora.Value

func Bold

func Bold(payload string) _aurora.Value

func GrayText

func GrayText(payload string) _aurora.Value

func GreenText

func GreenText(payload string) _aurora.Value

func Heading

func Heading(text string) string

func Indent

func Indent(text string) string

Indent adds two space characters to the start of every line in the text

func KeyValues

func KeyValues(items map[string]string, hidden bool) string

func LightGrayText

func LightGrayText(payload string) _aurora.Value

func MagentaText

func MagentaText(payload string) _aurora.Value

func ObscureText

func ObscureText(text string) string

func OrderedList

func OrderedList(items []string) string

func Paragraph

func Paragraph(text string) string

Paragraph automatically wraps text (by word) to 60 chars

func PrefixLines

func PrefixLines(text, prefix string) string

PrefixLines adds a string to the start of every line in the text

func PromptConfirmProjectName

func PromptConfirmProjectName() (string, error)

func PromptEnvVars

func PromptEnvVars(envVars []*entity.StarterEnvVar) (map[string]string, error)

func PromptEnvironments

func PromptEnvironments(environments []*entity.Environment) (*entity.Environment, error)

func PromptGitHubScopes

func PromptGitHubScopes(scopes []string) (string, error)

PromptGitHubScopes prompts the user to select one of the provides scopes

func PromptIsRepoPrivate

func PromptIsRepoPrivate() (bool, error)

func PromptPlugins

func PromptPlugins(plugins []string) (string, error)

func PromptProjectName

func PromptProjectName() (string, error)

func PromptProjects

func PromptProjects(projects []*entity.Project) (*entity.Project, error)

func PromptServices

func PromptServices(services []*entity.Service) (*entity.Service, error)

func PromptStarterTemplates

func PromptStarterTemplates(starters []*entity.Starter) (*entity.Starter, error)

PromptStarterTemplates prompts the user to select one of the provided starter templates

func PromptText

func PromptText(text string) (string, error)

func PromptYesNo

func PromptYesNo(msg string) (bool, error)

PromptYesNo prompts the user to continue an action using the common (y/N) action

func RedText

func RedText(payload string) _aurora.Value

func StartSpinner

func StartSpinner(cfg *SpinnerCfg)

func StopSpinner

func StopSpinner(msg string)

func SupportsANSICodes

func SupportsANSICodes() bool

func Truncate

func Truncate(text string, maxLength int) string

func UnorderedList

func UnorderedList(items []string) string

func VerboseInfo

func VerboseInfo(isVerbose bool, text string) string

func YellowText

func YellowText(payload string) _aurora.Value

Types

type Prompt

type Prompt string

type Selection

type Selection string
const (
	InitNew          Selection = "Empty Project"
	InitFromTemplate Selection = "Starter Template"
)

func PromptInit

func PromptInit() (Selection, error)

type SpinnerCfg

type SpinnerCfg struct {
	// Message specifies the text label that appears while loading
	Message string
	// Tokens is a list of emoji to rotate through, during loading
	Tokens []string
	// Duration is the amount of delay between each spinner "frame"
	Duration time.Duration
}

type TrainSpinner

type TrainSpinner []string
var (
	TrainEmojis TrainSpinner = []string{"🚝", "🚅", "🚄", "🚇", "🚞", "🚈", "🚉", "🚂", "🚃", "🚊", "🚋"}
)

Jump to

Keyboard shortcuts

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