render

package
v0.0.347-pre-2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocationEvents

func AllocationEvents(w io.Writer, title string, events ...api.AllocationEvent) error

func AllocationStatuses

func AllocationStatuses(w io.Writer, title string, backupRegions []api.Region, statuses ...*api.AllocationStatus) error

func JSON

func JSON(w io.Writer, v interface{}) error

func LogEntry

func LogEntry(w io.Writer, entry logs.LogEntry, opts ...LogOption) (err error)

func Table

func Table(w io.Writer, title string, rows [][]string, cols ...string) error

Table renders the table defined by the given properties into w. Both title & cols are optional.

func TitledJSON

func TitledJSON(w io.Writer, title string, v interface{}) error

func VerticalTable

func VerticalTable(w io.Writer, title string, objects [][]string, cols ...string) error

Types

type LogOption

type LogOption func(o *LogOptions)

LogOption is a func type that returns a LogOption.

func HideAllocID

func HideAllocID() LogOption

HideAllocID removes the allocation ID from the log output.

func HideRegion

func HideRegion() LogOption

HideRegion removes the region from the log output.

func RemoveNewlines

func RemoveNewlines() LogOption

RemoveNewlines removes newlines from the log output.

type LogOptions

type LogOptions struct {
	RemoveNewlines bool
	HideRegion     bool
	HideAllocID    bool
}

type TextBlock

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

func NewTextBlock

func NewTextBlock(ctx context.Context, v ...interface{}) (tb *TextBlock)

func (*TextBlock) Detail

func (tb *TextBlock) Detail(v ...interface{})

Detail prints to the output ctx carries. It behaves similarly to log.Print.

func (*TextBlock) Detailf

func (tb *TextBlock) Detailf(format string, v ...interface{})

Detailf prints to the output ctx carries. It behaves similarly to log.Printf.

func (*TextBlock) Done

func (tb *TextBlock) Done(v ...interface{})

func (*TextBlock) Donef

func (tb *TextBlock) Donef(format string, v ...interface{})

func (*TextBlock) Overwrite

func (tb *TextBlock) Overwrite()

func (*TextBlock) Print

func (tb *TextBlock) Print(v ...interface{})

func (*TextBlock) Printf

func (tb *TextBlock) Printf(format string, v ...interface{})

func (*TextBlock) Println

func (tb *TextBlock) Println(v ...interface{})

Jump to

Keyboard shortcuts

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