common

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROMPT_WARNING = `{{.warning}}
`

	PROMPT_COMMON_WARNING = `` /* 157-byte string literal not displayed */

	PROMPT_CLEAN_SERVICE = `` /* 144-byte string literal not displayed */

	PROMPT_COLLECT_SERVICE = `` /* 236-byte string literal not displayed */

	PROMPT_TOPOLOGY_CHANGE_NOTICE = `` /* 214-byte string literal not displayed */

	PROMPT_FORMAT = `` /* 248-byte string literal not displayed */

	PROMPT_CANCEL_OPERATION = `[x] {{.operation}} canceled`

	DEFAULT_CONFIRM_PROMPT = "Do you want to continue?"
)

Variables

View Source
var (
	PROMPT_ERROR_CODE = strings.Join([]string{
		color.CyanString("---"),
		color.CyanString("Error-Code: ") + "{{.code}}",
		color.CyanString("Error-Description: ") + "{{.description}}",
		"{{- if .clue}}",
		color.CyanString("Error-Clue: ") + "{{.clue}}",
		"{{- end}}",
		color.CyanString("How to Solve:"),
		color.CyanString("  * Website: ") + "{{.website}}",
		"{{- if .logpath}}",
		color.CyanString("  * Log: ") + "{{.logpath}}",
		"{{- end}}",
		color.CyanString("  * WeChat: ") + "{{.wechat}}",
	}, "\n")

	PROMPT_AUTO_UPGRADE = strings.Join([]string{
		color.MagentaString("CurveAdm {{.version}} released, we recommend you to upgrade it."),
		"Upgrade curveadm to {{.version}}?",
	}, "\n")
)

Functions

func ConfirmYes

func ConfirmYes(format string, a ...interface{}) bool

func CutColumn

func CutColumn(lines [][]interface{}, column int)

func FixedFormat

func FixedFormat(lines [][]interface{}, nspace int) string

func FormatTitle

func FormatTitle(title []string) ([]interface{}, []interface{})

func PromptAutoUpgrade added in v0.2.0

func PromptAutoUpgrade(version string) string

func PromptCancelOpetation added in v0.0.23

func PromptCancelOpetation(operation string) string

func PromptCleanService

func PromptCleanService(role, host string, items []string) string

func PromptCollectService

func PromptCollectService() string

func PromptErrorCode added in v0.1.0

func PromptErrorCode(code int, description, clue, logpath string) string

func PromptFormat added in v0.1.0

func PromptFormat() string

func PromptMigrate added in v0.0.23

func PromptMigrate() string

func PromptReloadService added in v0.1.0

func PromptReloadService(id, role, host string) string

func PromptRemoveCluster

func PromptRemoveCluster(clusterName string) string

func PromptRestartService added in v0.1.0

func PromptRestartService(id, role, host string) string

func PromptScaleOut added in v0.0.23

func PromptScaleOut() string

func PromptStartService added in v0.1.0

func PromptStartService(id, role, host string) string

func PromptStopService

func PromptStopService(id, role, host string) string

func TrimAddress added in v0.1.0

func TrimAddress(address string) string

func TrimContainerId

func TrimContainerId(containerId string) string

func TrimPluginDescription added in v0.0.23

func TrimPluginDescription(decscription string) string

Types

type DecorateMessage

type DecorateMessage struct {
	Message  string
	Decorate func(string) string
}

type Prompt

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

func NewPrompt

func NewPrompt(text string) *Prompt

func (*Prompt) Build

func (p *Prompt) Build() string

Jump to

Keyboard shortcuts

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