output

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 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 CompactDriveFilesResponse added in v0.2.0

func CompactDriveFilesResponse(resp *api.DriveFilesResponse, opts CompactOptions) *api.DriveFilesResponse

CompactDriveFilesResponse applies compact transformations to a drive files response

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 CompactSheetBulkContentResponse added in v0.3.0

func CompactSheetBulkContentResponse(resp *api.SheetBulkContentResponse, opts CompactOptions) *api.SheetBulkContentResponse

CompactSheetBulkContentResponse trims per-tab values to a reasonable head in compact mode so an LLM agent doesn't drown in untouched ranges. The Clipped/FullRange hints from the server are preserved so the agent still knows where to drill in.

func CompactTaskBlockListResponse added in v0.3.0

func CompactTaskBlockListResponse(resp *api.TaskBlockListResponse, opts CompactOptions) *api.TaskBlockListResponse

CompactTaskBlockListResponse truncates each block's text. Metadata is small (typically a single language or checked field) and kept intact.

func CompactTaskItem added in v0.3.0

func CompactTaskItem(item *api.TaskItemDto, opts CompactOptions) *api.TaskItemDto

CompactTaskItem trims a single TaskItemDto. Returns the compacted item (or nil if input was nil).

func CompactTaskItemResponse added in v0.3.0

func CompactTaskItemResponse(resp *api.TaskItemResponse, opts CompactOptions) *api.TaskItemResponse

CompactTaskItemResponse trims a single-item response.

func CompactTaskItemResult added in v0.3.0

func CompactTaskItemResult(resp *api.TaskItemResult, opts CompactOptions) *api.TaskItemResult

CompactTaskItemResult trims the embedded Item on create/update responses. The error fields are left untouched.

func CompactTaskItemsResponse added in v0.3.0

func CompactTaskItemsResponse(resp *api.TaskItemsResponse, opts CompactOptions) *api.TaskItemsResponse

CompactTaskItemsResponse trims every item in a list response.

func CompactTaskSearchResponse added in v0.3.0

func CompactTaskSearchResponse(resp *api.TaskSearchResponse, opts CompactOptions) *api.TaskSearchResponse

CompactTaskSearchResponse trims each search result's embedded item.

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 FormatLocalTimePtr added in v0.3.0

func FormatLocalTimePtr(utc *time.Time) string

FormatLocalTimePtr formats a nullable UTC time pointer; returns "" on nil so the caller doesn't have to branch. Mirrors the wire's "field absent ≡ no value" contract for our nullable DTO fields.

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