output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset   = "\033[0m"
	Red     = "\033[31m"
	Green   = "\033[32m"
	Yellow  = "\033[33m"
	Blue    = "\033[34m"
	Magenta = "\033[35m"
	Cyan    = "\033[36m"
	Gray    = "\033[90m"
	Bold    = "\033[1m"
)

ANSI color codes

Variables

This section is empty.

Functions

func ColorBlue

func ColorBlue(text string) string

func ColorBold

func ColorBold(text string) string

func ColorCyan

func ColorCyan(text string) string

func ColorGray

func ColorGray(text string) string

func ColorGreen

func ColorGreen(text string) string

func ColorRed

func ColorRed(text string) string

Helper functions for common colors

func ColorStatus

func ColorStatus(status string) string

ColorStatus colors event statuses

func ColorYellow

func ColorYellow(text string) string

func Colorize

func Colorize(color, text string) string

Colorize wraps text with color codes if colors are enabled

func CompactEmail

func CompactEmail(email *api.Email, opts CompactOptions) *api.Email

CompactEmail applies compact transformations to a single email

func CompactEmailsResponse

func CompactEmailsResponse(resp *api.EmailsResponse, opts CompactOptions) *api.EmailsResponse

CompactEmailsResponse applies compact transformations to an emails response

func CompactEvent

func CompactEvent(event *api.Event, opts CompactOptions) *api.Event

CompactEvent applies compact transformations to a single event

func CompactEventsResponse

func CompactEventsResponse(resp *api.EventsResponse, opts CompactOptions) *api.EventsResponse

CompactEventsResponse applies compact transformations to an events response

func CompactThreadResponse

func CompactThreadResponse(resp *api.ThreadResponse, opts CompactOptions) *api.ThreadResponse

CompactThreadResponse applies compact transformations to a thread response

func FormatLocalTime

func FormatLocalTime(utc time.Time) string

FormatLocalTime converts a UTC time to the output timezone and formats it as RFC3339.

func GetLocalEnd

func GetLocalEnd(endLocal string, endUtc time.Time) string

GetLocalEnd returns the local end time string. If endLocal is provided and non-empty, it's returned as-is. Otherwise, endUtc is converted to local time.

func GetLocalStart

func GetLocalStart(startLocal string, startUtc time.Time) string

GetLocalStart returns the local start time string. If startLocal is provided and non-empty, it's returned as-is. Otherwise, startUtc is converted to local time.

func GetOutputLocation

func GetOutputLocation() *time.Location

GetOutputLocation returns the timezone location for output formatting. It checks PE_TIMEZONE environment variable first, falling back to time.Local.

func Print

func Print(data interface{}, format Format)

func PrintBanner

func PrintBanner()

PrintBanner displays the branded PortEden CLI header.

func PrintCompletion

func PrintCompletion(profile string)

PrintCompletion prints the final success block with quick-start hints.

func PrintDivider

func PrintDivider()

PrintDivider prints a thin separator line.

func PrintInfo

func PrintInfo(msg string)

PrintInfo prints an indented gray info line.

func PrintStep

func PrintStep(n, total int, msg string)

PrintStep prints a numbered wizard step, e.g. "1/3 Opening browser..."

func PrintSuccess

func PrintSuccess(msg string)

PrintSuccess prints a green checkmark line.

func PrintWithOptions

func PrintWithOptions(data interface{}, format Format, opts PrintOptions)

func SetColorEnabled

func SetColorEnabled(enabled bool)

SetColorEnabled allows overriding color detection

Types

type CompactOptions

type CompactOptions struct {
	MaxDescriptionLength int  // default: 100
	FilterAttendees      bool // default: true
	MaxAttendees         int  // default: 10 (0 = unlimited)
}

CompactOptions configures compact mode transformations

func DefaultCompactOptions

func DefaultCompactOptions() CompactOptions

DefaultCompactOptions returns the default compact mode settings

type Format

type Format string
const (
	FormatJSON  Format = "json"
	FormatTable Format = "table"
	FormatPlain Format = "plain"
)

type PrintOptions

type PrintOptions struct {
	Compact bool
}

PrintOptions configures output behavior

Jump to

Keyboard shortcuts

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