json

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPrettyPrint

func WithPrettyPrint() func(*Options)

Types

type Formatter

type Formatter[T any] struct {
	// contains filtered or unexported fields
}

func NewFormatter

func NewFormatter[T any](cols columns.ColumnMap[T], options ...Option) *Formatter[T]

NewFormatter returns a Formatter that will turn entries of type T into JSON representation

func (*Formatter[T]) FormatEntries added in v0.22.0

func (f *Formatter[T]) FormatEntries(entries []*T) string

FormatEntries returns a slice of entries as a formatted string, respecting the given formatting settings

func (*Formatter[T]) FormatEntry

func (f *Formatter[T]) FormatEntry(entry *T) string

FormatEntry returns an entry as a formatted string, respecting the given formatting settings

type Option

type Option func(*Options)

type Options

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

func DefaultOptions

func DefaultOptions() *Options

Jump to

Keyboard shortcuts

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