format

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONFormat = "json"
	YAMLFormat = "yaml"
	TextFormat = "text"
	JQFormat   = "jq"
)

Variables

This section is empty.

Functions

func Apply added in v0.0.5

func Apply(format Format, input any, opts Options) (string, error)

func ChangesAsText added in v0.0.5

func ChangesAsText(changes *diff.Changes, opts Options) string

func JQ added in v0.0.5

func JQ(data interface{}, opts ...any) (string, error)

func JSON added in v0.0.5

func JSON(data any) (string, error)

func Text added in v0.0.5

func Text(input any, opts ...any) (string, error)

func YAML

func YAML(data interface{}) (string, error)

Types

type Format added in v0.0.5

type Format struct {
	Name       string
	Expression string
}

func (*Format) Set added in v0.0.5

func (f *Format) Set(s string) error

func (*Format) String added in v0.0.5

func (f *Format) String() string

func (*Format) Type added in v0.0.5

func (f *Format) Type() string

type InvalidFormatError added in v0.0.5

type InvalidFormatError struct {
	Format string
}

func (*InvalidFormatError) Error added in v0.0.5

func (e *InvalidFormatError) Error() string

type Options added in v0.0.5

type Options struct {
	Indent    int
	StatsOnly bool
}

type UnknownFormatError added in v0.0.5

type UnknownFormatError struct {
	Format string
}

func (*UnknownFormatError) Error added in v0.0.5

func (e *UnknownFormatError) Error() string

type UnknownInputTypeError added in v0.0.5

type UnknownInputTypeError struct {
	Type string
}

func (*UnknownInputTypeError) Error added in v0.0.5

func (e *UnknownInputTypeError) Error() string

Jump to

Keyboard shortcuts

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