tablew

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package tablew implements text table output writers.

The actual rendering of the text table is handled by a modified version ofolekukonko/tablewriter which can be found in the internal sub-package. At the time, tablewriter didn't provide all the functionality that sq required. However, that package has been significantly developed since then fork, and it may be possible that we could dispense with the forked version entirely and directly use a newer version of tablewriter.

This entire package could use a rewrite, a lot has changed with sq since this package was first created. So, if you see code in here that doesn't make sense to you, you're probably judging it correctly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorWriter

func NewErrorWriter(w io.Writer, f *output.Formatting) output.ErrorWriter

NewErrorWriter returns an output.ErrorWriter that outputs in text format.

func NewMetadataWriter

func NewMetadataWriter(out io.Writer, fm *output.Formatting) output.MetadataWriter

NewMetadataWriter returns a new output.MetadataWriter instance that outputs metadata in table format.

func NewRecordWriter

func NewRecordWriter(out io.Writer, fm *output.Formatting) output.RecordWriter

NewRecordWriter returns a RecordWriter for text table output.

func NewSourceWriter

func NewSourceWriter(out io.Writer, fm *output.Formatting) output.SourceWriter

NewSourceWriter returns a source writer that outputs source details in text table format.

func NewVersionWriter added in v0.21.0

func NewVersionWriter(out io.Writer, fm *output.Formatting) output.VersionWriter

NewVersionWriter returns a new output.VersionWriter instance that outputs version info in JSON.

Types

type PingWriter

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

PingWriter implements output.PingWriter.

func NewPingWriter

func NewPingWriter(out io.Writer, fm *output.Formatting) *PingWriter

NewPingWriter returns a new instance. It is not safe for concurrent use.

func (*PingWriter) Close

func (w *PingWriter) Close() error

func (*PingWriter) Open

func (w *PingWriter) Open(srcs []*source.Source) error

func (*PingWriter) Result

func (w *PingWriter) Result(src *source.Source, d time.Duration, err error) error

Directories

Path Synopsis
Package tablewriter creates & generates text based table
Package tablewriter creates & generates text based table

Jump to

Keyboard shortcuts

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