json_v1

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJsonInt64

func GetJsonInt64(dJson interface{}, keys ...interface{}) (int64, error)

JSON格式相关获取函数3: 获取一个节点int64格式 fmt.Println(getJsonInterface(J, "def", "bbb", 3, "errorcode"))

func GetJsonInt64Force

func GetJsonInt64Force(dJson interface{}, keys ...interface{}) (int64, error)

JSON格式相关获取函数4: 获取一个节点int64格式,如果是字符串数字,则转换成int64后返回

func GetJsonInterface

func GetJsonInterface(dJson interface{}, keys ...interface{}) (interface{}, error)

JSON格式相关获取函数1: 获取一个节点内容

func GetJsonString

func GetJsonString(dJson interface{}, keys ...interface{}) (string, error)

JSON格式相关获取函数2: 获取一个节点string格式

func JsonDecode

func JsonDecode(jsonStr string) (interface{}, error)

*------------------------- // 名称:获取将字符参数转换为map的参数 // @jsonStr=`{"ip": "127.0.0.1", "device": "ABESSF0023"}` // @jsonStr=`[{"ip": "127.0.0.1", "device": "ABESSF0023"}]` ***-----------------------

func JsonEncode

func JsonEncode(maps interface{}) (string, error)

*------------------------- // 名称:map参数转换为字符串 // @maps={"ip": "127.0.0.1", "device": "ABESSF0023"} // @maps=[{"ip": "127.0.0.1", "device": "ABESSF0023"}] ***-----------------------

Types

This section is empty.

Jump to

Keyboard shortcuts

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