tablew

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Package tablew implements text table output writers.

The actual rendering of the text table is handled by a heavily 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 NewConfigWriter added in v0.34.0

func NewConfigWriter(out io.Writer, pr *output.Printing) output.ConfigWriter

NewConfigWriter returns a new output.ConfigWriter.

func NewDiffWriter added in v0.48.0

func NewDiffWriter(pr *output.Printing) diff.RecordHunkWriter

NewDiffWriter returns a diff.RecordHunkWriter for format "text".

func NewErrorWriter

func NewErrorWriter(w io.Writer, pr *output.Printing, stacktrace bool) output.ErrorWriter

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

func NewMetadataWriter

func NewMetadataWriter(out io.Writer, pr *output.Printing) output.MetadataWriter

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

func NewRecordWriter

func NewRecordWriter(out io.Writer, pr *output.Printing) output.RecordWriter

NewRecordWriter returns a RecordWriter for text table output.

func NewSourceWriter

func NewSourceWriter(out io.Writer, pr *output.Printing) 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, pr *output.Printing) output.VersionWriter

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

Types

type PingWriter

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

PingWriter implements output.PingWriter.

func NewPingWriter

func NewPingWriter(out io.Writer, pr *output.Printing) *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

Open implements output.PingWriter.

func (*PingWriter) Result

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

Result implements output.PingWriter.

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