json

package
v0.28.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

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

func New

func New(ds datasource.DataSource, options ...Option) (*Formatter, error)

func (*Formatter) Marshal

func (f *Formatter) Marshal(data datasource.Data) []byte

type Option

type Option func(*Formatter)

func WithFields

func WithFields(fields []string) Option

WithFields specifies exactly which fields to export using this formatter; field names can be prefixed with +/- to add or remove the field from the output - if all fields are prefixed, the default visible fields will be honored, otherwise only the fields specified will be considered. If fields is nil, the default will be used - if fields is empty, no field will be returned.

func WithPretty added in v0.28.0

func WithPretty(val bool, indent string) Option

func WithShowAll

func WithShowAll(val bool) Option

Jump to

Keyboard shortcuts

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