json

package
v0.0.0-...-6dbff61 Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidJSONText means invalid JSON text.
	ErrInvalidJSONText = terror.ClassJSON.New(mysql.ErrInvalidJSONText, mysql.MySQLErrName[mysql.ErrInvalidJSONText])
	// ErrInvalidJSONPath means invalid JSON path.
	ErrInvalidJSONPath = terror.ClassJSON.New(mysql.ErrInvalidJSONPath, mysql.MySQLErrName[mysql.ErrInvalidJSONPath])
	// ErrInvalidJSONData means invalid JSON data.
	ErrInvalidJSONData = terror.ClassJSON.New(mysql.ErrInvalidJSONData, mysql.MySQLErrName[mysql.ErrInvalidJSONData])
)

Functions

func CompareJSON

func CompareJSON(j1 JSON, j2 JSON) (cmp int, err error)

CompareJSON compares two json object.

func Serialize

func Serialize(j JSON) []byte

Serialize means serialize itself into bytes.

Types

type JSON

type JSON interface {

	// String returns JSON text.
	String() string
	// Type returns type string.
	Type() string
	// contains filtered or unexported methods
}

JSON is for MySQL JSON type.

func CreateJSON

func CreateJSON(in interface{}) JSON

CreateJSON creates a JSON from in. Return nil if in is not a valid JSON type.

func Deserialize

func Deserialize(data []byte) (j JSON, err error)

Deserialize means deserialize a json from bytes.

func ParseFromString

func ParseFromString(s string) (JSON, error)

ParseFromString parses a json from string.

Jump to

Keyboard shortcuts

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