display

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package display provides centralized message constants and console output functions. All messages in Better-Curl-Saul use these constants to maintain the characteristic "Saul Goodman" personality throughout the application.

Package display provides centralized console output functions with consistent formatting. All console output in Better-Curl-Saul should use these functions instead of direct fmt.Print* calls to maintain consistent styling, proper stderr/stdout separation, and Unix philosophy compliance.

Index

Constants

View Source
const (
	DefaultWidth    = 80
	MinWidth        = 40
	MaxWidth        = 120
	SeparatorChar   = "─"
	BulletSeparator = " • "
)
View Source
const (
	// Error Messages - Casual tone throughout
	ErrInvalidMethod         = "Whoa whoa whoa there, counselor! '%s'? That's not gonna fly. We're talking GET, POST, PUT, DELETE - the classics!"
	ErrMissingURL            = "Listen pal, I can't work with nothing here! You gotta give me a URL - that's Internet Law 101!"
	ErrInvalidURL            = "That URL? Not gonna hold up in court, friend! Give me something that actually works!"
	ErrInvalidTimeout        = "Time(out) is money, friend! Give me actual seconds for timeout, not whatever that was supposed to be."
	ErrPresetNotFound        = "Here's the deal, sport - preset '%s' doesn't exist in my files! Do I look like a magician to you?"
	ErrKeyNotFound           = "Let me tell you something, gentlemen - key '%s' is nowhere in %s. Case closed!"
	ErrInvalidTarget         = "" /* 148-byte string literal not displayed */
	ErrPresetNameRequired    = "Hey hey hey! Can't work magic without knowing which preset we're talking about here!(this one is good)"
	ErrTargetRequired        = "Trust me on this one - gonna need to specify body, headers, query, request, variables, or filters."
	ErrKeyValueRequired      = "Bottom line, chief - I need actual key=value pairs to work with, not thin air! (this one is great)"
	ErrInvalidKeyValue       = "Yeah, that key=value thing you got there? Not gonna cut it in my operation"
	ErrArgumentsNeeded       = "Between you and me, amigo - gonna need more 'arguments' than that to make this case"
	ErrUnsupportedMethod     = "Look, look, look - method '%s' isn't in my professional repertoire (idk if needs more explanation or conclusion but is okay)"
	ErrRequestBuildFailed    = "Well well well, request building just fell apart - that's a technical breach of contract!"
	ErrHTTPRequestFailed     = "Here's the situation - network rejected the request! Money talks, but apparently not loud enough today!"
	ErrVariableLoadFailed    = "Let me break this down for you - variables won't load! File system's pleading the fifth!"
	ErrVariableSaveFailed    = "This is how it works - variable didn't save! Storage system's in contempt!"
	ErrFileLoadFailed        = "File '%s' went MIA, plain and simple - either moved or never existed! Case closed!"
	ErrFileSaveFailed        = "Here's what happened - can't save file '%s'! That's a permissions violation, no negotiation!"
	ErrDirectoryFailed       = "Directory access denied, counselor - file system's exercising its rights! End of story!"
	ErrReadlineSetup         = "Terminal's not accepting input - that's a critical system failure! We got a problem here!"
	ErrInputRead             = "Input went haywire on me - communication breakdown! Let's retry this case!"
	ErrEditorNotFound        = "No editor found in evidence! Set $EDITOR or install nano/vim - that's due process!"
	ErrEditorFailed          = "Editor crashed and burned - technical malpractice in progress: %v"
	ErrNoCurrentPreset       = "No active case on file! Use: saul [preset] [command] to open proceedings - that's the law!"
	ErrFieldNameRequired     = "Listen, counselor - need to specify what field you want! Options are: body, headers, status, url, method, duration"
	ErrUnknownResponseField  = "That field '%s'? Not in my case files! Stick to the evidence: body, headers, status, url, method, duration"
	ErrResponseProcessFailed = "Response processing went sideways - technical difficulties in the evidence room: %v"
	ErrTempFileCreate        = "Can't create temporary file - system's not cooperating with me here! Technical difficulties!"
	ErrTempFileRead          = "Temp file's playing hard to get - can't read it! Something went sideways!"
	ErrEmptyCurlCommand      = "Come on now, friend - you gave me an empty file! I need an actual curl command to work with!"
	ErrCurlParseFailed       = "That curl command's not holding up under scrutiny - syntax error, plain and simple: %v"
	ErrNoCurlURL             = "Listen pal, that curl command's missing the most important part - the URL! Can't make a case without an address!"
)
View Source
const (
	// Warning Messages
	WarnNoFiltersMatch    = "Heads up champ - no fields matched filters %v, might wanna check that syntax"
	WarnPresetExists      = "Just so we're clear, pal - preset '%s' already exists! No harm, no foul!"
	WarnResponseLarge     = "That response is huge (%d bytes), even 'loco' maybe - giving you raw JSON instead of TOML! That's just good business!"
	WarnHistoryFailed     = "Listen, buddy - couldn't save that response to history! No biggie, but thought you should know!"
	WarnUpdateCheckFailed = "Listen friend, couldn't check for updates right now - network's being difficult! Try again later, no big deal!"
)
View Source
const (
	// Update Messages
	InfoUpdateAvailable = `` /* 363-byte string literal not displayed */

	InfoUpToDate = "You're golden, amigo! Already running the latest and greatest version."
)

Variables

This section is empty.

Functions

func Error

func Error(msg string)

Error prints error messages to stderr with consistent formatting

func FormatFileDisplay

func FormatFileDisplay(fileType, size, entryCount string, content string) string

FormatFileDisplay creates formatted file content display with file metadata

func FormatResponse

func FormatResponse(status, contentType, timing, size string, content string) string

FormatResponse creates formatted response display with status metadata

func FormatSection

func FormatSection(title, content, metadata string) string

FormatSection creates clean formatting with simple header and footer separators

func FormatSimpleSection

func FormatSimpleSection(title, content string) string

FormatSimpleSection creates basic section formatting without metadata

func Info

func Info(msg string)

Info prints informational messages to stdout

func Plain

func Plain(msg string)

Plain prints messages without any formatting or prefixes

func Success

func Success(msg string)

Success prints success messages to stdout

func Tip

func Tip(msg string)

Tip prints helpful tips/hints to stdout

func Warning

func Warning(msg string)

Warning prints warning messages to stdout

Types

This section is empty.

Jump to

Keyboard shortcuts

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