output

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFormat = JSON

DefaultFormat matches the Etherscan API, which serves application/json for every endpoint. Tables remain available via -o table.

Variables

This section is empty.

Functions

func Rows

func Rows(raw json.RawMessage) ([]map[string]string, string, error)

func Write

func Write(w io.Writer, raw json.RawMessage, format Format, compact bool, columns []string) error

func WriteRows

func WriteRows(w io.Writer, rows []map[string]string, format Format, columns []string) error

Types

type Format

type Format string
const (
	Table Format = "table"
	JSON  Format = "json"
	CSV   Format = "csv"
)

func ParseFormat added in v1.0.1

func ParseFormat(value string) (Format, error)

ParseFormat validates a format name from --output or default_output. Unknown values are rejected rather than falling through to the table renderer, which is what Write would otherwise do: it tests for JSON and CSV, so anything else silently rendered as a table.

Jump to

Keyboard shortcuts

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