output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Account

func Account(mode Mode, account *api.Account) error

Account outputs a single account.

func Accounts

func Accounts(mode Mode, accounts []api.Account) error

Accounts outputs a list of accounts.

func FinancialInstitution

func FinancialInstitution(mode Mode, fi *api.FinancialInstitution) error

FinancialInstitution outputs a single financial institution.

func FinancialInstitutions

func FinancialInstitutions(mode Mode, institutions []api.FinancialInstitution) error

FinancialInstitutions outputs a list of financial institutions.

func JSON

func JSON(v any) error

JSON outputs data as JSON.

func JSONCompact

func JSONCompact(v any) error

JSONCompact outputs data as compact JSON.

func Organization

func Organization(mode Mode, org *api.Organization) error

Organization outputs organization info.

func PendingTransactions

func PendingTransactions(mode Mode, txns []api.PendingTransaction) error

PendingTransactions outputs a list of pending transactions.

func Sync

func Sync(mode Mode, sync *api.Synchronization) error

Sync outputs a sync.

func Syncs

func Syncs(mode Mode, syncs []api.Synchronization) error

Syncs outputs a list of syncs.

func Transaction

func Transaction(mode Mode, tx *api.Transaction) error

Transaction outputs a single transaction.

func Transactions

func Transactions(mode Mode, txns []api.Transaction) error

Transactions outputs a list of transactions.

func Truncate

func Truncate(s string, maxLen int) string

Truncate truncates a string to maxLen runes, adding "..." if truncated.

func WithMode

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

WithMode adds the output mode to the context.

Types

type CSV

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

CSV provides RFC 4180 compliant CSV output.

func NewCSV

func NewCSV() *CSV

NewCSV creates a new CSV writer.

func (*CSV) Flush

func (c *CSV) Flush() error

Flush flushes the CSV output.

func (*CSV) Header

func (c *CSV) Header(cols ...string) error

Header writes the CSV header.

func (*CSV) Row

func (c *CSV) Row(cols ...string) error

Row writes a CSV row.

type Mode

type Mode int

Mode represents the output format.

const (
	ModeTable Mode = iota
	ModeJSON
	ModeCSV
	ModePlain
)

func ModeFrom

func ModeFrom(ctx context.Context) Mode

ModeFrom retrieves the output mode from the context.

type Table

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

Table provides aligned table output.

func NewTable

func NewTable() *Table

NewTable creates a new table writer.

func (*Table) Flush

func (t *Table) Flush() error

Flush flushes the table output.

func (*Table) Header

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

Header writes the table header.

func (*Table) Row

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

Row writes a table row.

Jump to

Keyboard shortcuts

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