json

package
v0.0.0-...-512269d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(str string, t interface{}) error

func ToJsonStr

func ToJsonStr(t interface{}) string

func ToStr

func ToStr(t interface{}) (string, error)

Types

type JsonMap

type JsonMap map[string]string

func FastJsonMap

func FastJsonMap(data string) (JsonMap, error)

FastJsonMap 快速解析单层jsonmap, eg: {"a": "1", "b": "2"}

type JsonResult

type JsonResult struct {
	ErrorCode int         `json:"errorCode"`
	Message   string      `json:"message"`
	Data      interface{} `json:"data"`
	Success   bool        `json:"success"`
}

func JsonErrorCode

func JsonErrorCode(code int, message string) *JsonResult

Jump to

Keyboard shortcuts

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