output

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeNotFound          = "not_found"
	ErrCodeInvalidInput      = "invalid_input"
	ErrCodeConflict          = "conflict"
	ErrCodeCannotSelfApprove = "cannot_self_approve"
	ErrCodeHandoffRequired   = "handoff_required"
	ErrCodeDatabaseError     = "database_error"
	ErrCodeGitError          = "git_error"
	ErrCodeNoActiveSession   = "no_active_session"
)

Error codes for structured JSON output

Variables

This section is empty.

Functions

func Error

func Error(format string, args ...interface{})

Error prints an error message

func FormatGitState

func FormatGitState(sha, branch string, dirty int) string

FormatGitState formats git state for display

func FormatIssueDeleted

func FormatIssueDeleted(issue *models.Issue) string

FormatIssueDeleted formats a deleted issue showing [deleted] marker instead of status

func FormatIssueLong

func FormatIssueLong(issue *models.Issue, logs []models.Log, handoff *models.Handoff) string

FormatIssueLong formats an issue in long format

func FormatIssueShort

func FormatIssueShort(issue *models.Issue) string

FormatIssueShort formats an issue in short format

func FormatPoints

func FormatPoints(points int) string

FormatPoints returns empty string if points is 0, otherwise "Npts"

func FormatPointsSuffix

func FormatPointsSuffix(points int) string

FormatPointsSuffix returns " Npts" if points > 0, empty string otherwise Useful for appending to format strings

func FormatPriority

func FormatPriority(p models.Priority) string

FormatPriority formats a priority

func FormatStatus

func FormatStatus(s models.Status) string

FormatStatus formats a status with color

func FormatTimeAgo

func FormatTimeAgo(t time.Time) string

FormatTimeAgo formats a time as a human-readable "ago" string

func Info

func Info(format string, args ...interface{})

Info prints an info message

func JSON

func JSON(v interface{}) error

JSON outputs data as JSON

func JSONError

func JSONError(code, message string)

JSONError outputs an error as JSON

func JSONErrorWithDetails

func JSONErrorWithDetails(code, message string, details map[string]interface{})

JSONErrorWithDetails outputs an error as JSON with additional context

func ShortSHA

func ShortSHA(sha string) string

ShortSHA safely shortens a git SHA to 7 characters or returns as-is if shorter

func Success

func Success(format string, args ...interface{})

Success prints a success message

func Warning

func Warning(format string, args ...interface{})

Warning prints a warning message

Types

type OutputMode

type OutputMode int

OutputMode determines output format

const (
	ModeShort OutputMode = iota
	ModeLong
	ModeJSON
)

Jump to

Keyboard shortcuts

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