jsn

package
v0.0.0-...-f284434 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package jsn is built on top of bin; focus on json, not binary. Meant to be used directly in the CLI application (main function in the root directory of the repository).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSliceToJsn

func ByteSliceToJsn(b []byte) (interface{}, error)

func ByteSliceToJsnObj

func ByteSliceToJsnObj(b []byte) (map[string]interface{}, error)

func Get

func Get(path string) (rJ interface{}, rErr error)

func GetObj

func GetObj(path string) (map[string]interface{}, error)

func JsnObjToByteSlice

func JsnObjToByteSlice(jo map[string]interface{}) ([]byte, error)

func JsnObjToReader

func JsnObjToReader(jo map[string]interface{}) io.Reader

func JsnObjToStr

func JsnObjToStr(jo map[string]interface{}) (string, error)

func JsnToByteSlice

func JsnToByteSlice(j interface{}) ([]byte, error)

func JsnToReader

func JsnToReader(j interface{}) io.Reader

func JsnToStr

func JsnToStr(j interface{}) (string, error)

func New

func New(path string, j interface{}) error

func Over

func Over(path string, j interface{}) error

func ReaderToJsn

func ReaderToJsn(r io.Reader) (interface{}, error)

func ReaderToJsnObj

func ReaderToJsnObj(r io.Reader) (map[string]interface{}, error)

func Rm

func Rm(path string) error

func StrToJsn

func StrToJsn(s string) (interface{}, error)

func StrToJsnObj

func StrToJsnObj(s string) (map[string]interface{}, error)

func Up

func Up(path string, j interface{}) (rErr error)

Types

type Dir

type Dir bin.Dir

func NewDir

func NewDir(d string) *Dir

func (*Dir) All

func (d *Dir) All() ([]string, error)

func (*Dir) BinDir

func (d *Dir) BinDir() *bin.Dir

func (*Dir) Get

func (d *Dir) Get(name string) (interface{}, error)

func (*Dir) GetObj

func (d *Dir) GetObj(name string) (map[string]interface{}, error)

func (*Dir) New

func (d *Dir) New(name string, j interface{}) error

func (*Dir) Over

func (d *Dir) Over(name string, j interface{}) error

func (*Dir) Path

func (d *Dir) Path(name string) string

func (*Dir) Rm

func (d *Dir) Rm(name string) error

func (*Dir) Up

func (d *Dir) Up(name string, j interface{}) error

Jump to

Keyboard shortcuts

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