output

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatChannel

func FormatChannel(ch api.Channel) []string

FormatChannel formats a channel for table output.

func FormatContact

func FormatContact(contact api.Contact) []string

FormatContact formats a contact for table output.

func FormatConversation

func FormatConversation(conv api.Conversation) []string

FormatConversation formats a conversation for table output.

func FormatConversationWithUpdated added in v0.1.2

func FormatConversationWithUpdated(conv api.Conversation) []string

FormatConversationWithUpdated formats a conversation with UPDATED column. Shows waiting_since for snoozed, otherwise shows created_at.

func FormatInbox

func FormatInbox(inbox api.Inbox) []string

FormatInbox formats an inbox for table output.

func FormatMessage

func FormatMessage(msg api.Message) []string

FormatMessage formats a message for table output.

func FormatTag

func FormatTag(tag api.Tag) []string

FormatTag formats a tag for table output.

func FormatTeammate

func FormatTeammate(tm api.Teammate) []string

FormatTeammate formats a teammate for table output.

func FormatTimestamp

func FormatTimestamp(ts float64) string

func FormatTimestampLayout

func FormatTimestampLayout(ts float64, layout string) string

func FormatTimestampRFC3339

func FormatTimestampRFC3339(ts float64) string

func IsJSON

func IsJSON(ctx context.Context) bool

func WithMode

func WithMode(ctx context.Context, mode Mode) context.Context

func WriteJSON

func WriteJSON(w io.Writer, v any) error

Types

type Mode

type Mode struct {
	JSON  bool
	Plain bool
}

func FromContext

func FromContext(ctx context.Context) Mode

func FromEnv

func FromEnv() Mode

type PlainTable

type PlainTable struct {
	// contains filtered or unexported fields
}

func NewPlainTable

func NewPlainTable(out io.Writer) *PlainTable

func (*PlainTable) AddRow

func (t *PlainTable) AddRow(cols ...string)

func (*PlainTable) Flush

func (t *PlainTable) Flush() error

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table provides simple table output using tabwriter.

func NewTable

func NewTable(out io.Writer) *Table

func (*Table) AddRow

func (t *Table) AddRow(cols ...string)

func (*Table) Flush

func (t *Table) Flush() error

type TableWriter

type TableWriter interface {
	AddRow(cols ...string)
	Flush() error
}

func NewTableWriter

func NewTableWriter(out io.Writer, plain bool) TableWriter

Jump to

Keyboard shortcuts

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