jl package - github.com/bayashi/go-jl - Go Packages

jl

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 5 Imported by: 0

README

go-jl

MIT License go-jl CI

Show the "JSON within JSON" log nicely

Usage

Simple case:

$ echo '{"foo":"{\"bar\":\"{\\\"baz\\\":123}\"}"}' | jl -p
{
 "foo": {
  "bar": {
   "baz": 123
  }
 }
}

Full options:

Usage: jl [OPTIONS] FILE
Options:
  -h, --help         Display help (This message) and exit
  -p, --prettify     Prettify the JSON
  -e, --show-error   Set this option to show errors
  -v, --version      Display version and build info and exit

Installation

homebrew install

If you are using Mac:

brew tap bayashi/go-jl
brew install bayashi/go-jl/jl
binary install

Download binary from here: https://github.com/bayashi/go-jl/releases

go install

If you have golang envvironment:

go install github.com/bayashi/go-jl/cmd/jl@latest

License

MIT License

Author

Dai Okabayashi: https://github.com/bayashi

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(o *Options, origJson []byte) []byte

Process tries to convert "JSON within JSON" line to JUST Nested JSON line. If there would be an error, return original JSON straightfarward.

Types

type Flatter

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

Flatter stores path data for each value

type JsonArray

type JsonArray []json.RawMessage

type JsonObject

type JsonObject map[string]json.RawMessage

type KeyType

type KeyType int

KeyType represents either an object or an array

type Options

type Options struct {
	Prettify bool
	ShowErr  bool
}

Options is just an option data for a process

type PathKey

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

PathKey represents a path

Directories

Path Synopsis
cmd
jl command

Jump to

Keyboard shortcuts

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