table

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package table provides the Builder type which is used to produce nice looking tables for printing to the command-line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

The Builder type is used to produce nice looking tables.

func NewBuilder

func NewBuilder(headers []string) *Builder

NewBuilder returns a new instance of the Builder type that provides methods for building tables. The provided headers will show at the top of the table. Headers are automatically made upper case.

func (*Builder) AddRow

func (b *Builder) AddRow(items ...interface{})

AddRow adds a row to the table, formatting items as strings.

func (*Builder) Build

func (b *Builder) Build(output io.Writer) error

Build the table, flushing it to the configured io.Writer.

Jump to

Keyboard shortcuts

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