jsonx

package
v0.0.0-...-02246d9 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyArrayRawMessage

func EmptyArrayRawMessage() json.RawMessage

EmptyArrayRawMessage 空数组

func EmptyObjectRawMessage

func EmptyObjectRawMessage() json.RawMessage

EmptyObjectRawMessage 空对象

func IsEmptyRawMessage

func IsEmptyRawMessage(data json.RawMessage) bool

IsEmptyRawMessage 验证数据是否为空

func ToJson

func ToJson(i interface{}, defaultValue string) string

ToJson Change interface to json string

func ToPrettyJson

func ToPrettyJson(i interface{}) string

func ToRawMessage

func ToRawMessage(i interface{}, defaultValue string) (json.RawMessage, error)

Types

type ParseFinder

type ParseFinder Parser

func (ParseFinder) Bool

func (pf ParseFinder) Bool() bool

func (ParseFinder) Float32

func (pf ParseFinder) Float32() float32

func (ParseFinder) Float64

func (pf ParseFinder) Float64() float64

func (ParseFinder) Int

func (pf ParseFinder) Int() int

func (ParseFinder) Int64

func (pf ParseFinder) Int64() int64

func (ParseFinder) Interface

func (pf ParseFinder) Interface() interface{}

func (ParseFinder) String

func (pf ParseFinder) String() string

type Parser

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

func NewParser

func NewParser(s string) *Parser

func (Parser) Exists

func (p Parser) Exists(path string) bool

func (*Parser) Find

func (p *Parser) Find(path string, defaultValue ...interface{}) *ParseFinder

func (*Parser) LoadBytes

func (p *Parser) LoadBytes(bytes []byte) *Parser

func (*Parser) LoadString

func (p *Parser) LoadString(s string) *Parser

Jump to

Keyboard shortcuts

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