Documentation
¶
Index ¶
- Variables
- func APIBaseURL(raw string) string
- func EnsureScheme(raw string) string
- func ErrorIcon() string
- func FormatKeyValue(key string, value interface{}) string
- func InfoIcon() string
- func NormalizeURL(raw string) string
- func OriginURL(raw string) string
- func PrintError(format string, a ...interface{})
- func PrintHeading(format string, a ...interface{})
- func PrintInfo(format string, a ...interface{})
- func PrintSuccess(format string, a ...interface{})
- func PrintWarning(format string, a ...interface{})
- func SetupColoredHelp(rootCmd *cobra.Command)
- func SuccessIcon() string
- func WarningIcon() string
Constants ¶
This section is empty.
Variables ¶
var ( // Success prints text in green Success = color.New(color.FgGreen).SprintFunc() // Error prints text in red Error = color.New(color.FgRed).SprintFunc() // Warning prints text in yellow Warning = color.New(color.FgYellow).SprintFunc() // Info prints text in bright white (for better readability on dark backgrounds) Info = color.New(color.FgHiGreen).SprintFunc() // Bold prints text in bold Bold = color.New(color.Bold).SprintFunc() // Heading prints text in cyan and bold Heading = color.New(color.FgCyan, color.Bold).SprintFunc() // Cyan prints text in cyan Cyan = color.New(color.FgCyan).SprintFunc() // Gray prints text in gray Gray = color.New(color.FgHiBlack).SprintFunc() // White prints text in white White = color.New(color.FgWhite).SprintFunc() )
var ColoredHelpTemplate = `` /* 926-byte string literal not displayed */
ColoredHelpTemplate is a custom help template with color formatting
Functions ¶
func APIBaseURL ¶
APIBaseURL returns the base URL for Synkronus HTTP API routes in openapi/synkronus.yaml, which are all under the /api prefix from the deployment origin. If the configured URL already ends with /api, it is left unchanged so paths are not doubled.
func EnsureScheme ¶
EnsureScheme prepends https:// to the URL if it has no scheme (http:// or https://). Used so users can set api.url to "misha.synkronus.cloud" and the CLI still works.
func FormatKeyValue ¶
FormatKeyValue formats a key-value pair with the key in bold
func NormalizeURL ¶
NormalizeURL trims trailing slashes from a URL string (after EnsureScheme).
func OriginURL ¶
OriginURL strips a trailing /api segment (case-insensitive) so callers can reach routes served at the site root, e.g. GET /health in the OpenAPI spec.
func PrintError ¶
func PrintError(format string, a ...interface{})
PrintError prints an error message with a red X
func PrintHeading ¶
func PrintHeading(format string, a ...interface{})
PrintHeading prints a heading in cyan and bold
func PrintInfo ¶
func PrintInfo(format string, a ...interface{})
PrintInfo prints an info message with a blue information mark
func PrintSuccess ¶
func PrintSuccess(format string, a ...interface{})
PrintSuccess prints a success message with a green checkmark
func PrintWarning ¶
func PrintWarning(format string, a ...interface{})
PrintWarning prints a warning message with a yellow exclamation mark
func SetupColoredHelp ¶
SetupColoredHelp configures the command to use the colored help template
Types ¶
This section is empty.