json

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: BSD-2-Clause Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

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

func Format

func Format(in io.Reader, out io.Writer) error

func Get

func Get(v interface{}, url string) (err error)

Decodes a URL to interface

func OExecute

func OExecute(t JsonTemplate) error

func Parse

func Parse(out, in interface{}) error

Encodes a struct into json and then Parses it as a go/template. It then decodes it back into a complete struct.

func Read

func Read(v interface{}, path string) (err error)

Reads a json file and decodes it into interface

func ReadGz

func ReadGz(v interface{}, file string) (err error)

Read a gzipped json file and decodes it into an interface.

func ReadGzIo

func ReadGzIo(v interface{}, r io.Reader) (err error)

func Write

func Write(v interface{}, path string) (err error)

Write marshals a interface and writes it to a file

func WriteGz

func WriteGz(v interface{}, file string) (err error)

Marshal's a interface, and writes it to a gzipped file.

func WriteGzIo

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

func WritePretty

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

PrintPretty marshal's an interface and ouputs formatted json to writer.

Types

type JsonTemplate

type JsonTemplate interface {
	SetTemplate(interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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