Versions in this module Expand all Collapse all v0 v0.0.1 Apr 21, 2022 Changes in this version + var DefOptions = &StFormatOptions + var ErrInvalidJSON = errors.New("invalid json") + var ErrNoChange = errors.New("no change") + var ErrNotAllowedArrayAccess = errors.New("array access character not allowed in path") + var ErrNotAllowedWildcard = errors.New("wildcard characters not allowed in path") + var ErrPathEmpty = errors.New("path cannot be empty") + var ErrTypeError = errors.New("json must be an object or array") + var Matches = []Map + func AddModifier(name string, fn func(json, arg string) string) + func Delete(json, path string) (string, error) + func DeleteBytes(json []byte, path string) ([]byte, error) + func Discard(json string) (string, error) + func ForEachLine(json string, iterator func(line Res) bool) + func Format(json []byte) []byte + func FormatOptions(json []byte, opts *StFormatOptions) []byte + func Marshal(json interface{}) ([]byte, error) + func ModifierExists(name string) bool + func ModifiersState() bool + func Set(json, path string, value interface{}) (string, error) + func SetBytes(json []byte, path string, value interface{}) ([]byte, error) + func SetBytesOptions(json []byte, path string, value interface{}, opts *Options) ([]byte, error) + func SetModifiersState(b bool) + func SetOptions(json, path string, value interface{}, opts *Options) (string, error) + func SetRaw(json, path, value string) (string, error) + func SetRawBytes(json []byte, path string, value []byte) ([]byte, error) + func SetRawBytesOptions(json []byte, path string, value []byte, opts *Options) ([]byte, error) + func SetRawOptions(json, path, value string, opts *Options) (string, error) + func Stringify(value interface{}) (json string) + func Ugly(json []byte) []byte + func Unmarshal(json, v interface{}) error + func UnmarshalValidationEnabled(enabled bool) + func Valid(json string) (ok bool) + func ValidBytes(json []byte) bool + type Map map[string]string + type Options struct + Optimistic bool + ReplaceInPlace bool + type Res struct + Index int + Num float64 + Raw string + Str string + Type Type + func Get(json, path string) Res + func GetBytes(json []byte, path string) Res + func GetMultiple(json string, path ...string) []Res + func GetMultipleBytes(json []byte, path ...string) []Res + func Parse(json string) Res + func ParseBytes(json []byte) Res + func (r Res) Array() []Res + func (r Res) Bool() bool + func (r Res) Exists() bool + func (r Res) Float() float64 + func (r Res) ForEach(iterator func(key, value Res) bool) + func (r Res) Get(path string) Res + func (r Res) Int() int + func (r Res) IsArray() bool + func (r Res) IsObject() bool + func (r Res) Map() map[string]Res + func (r Res) String() string + func (r Res) Time(format ...string) time.Time + func (r Res) Uint() uint + func (r Res) Unmarshal(v interface{}) error + func (r Res) Value() interface{} + type StFormatOptions struct + Indent string + Prefix string + SortKeys bool + Width int + type Type int + const False + const JSON + const Null + const Number + const String + const True + func (t Type) String() string