xjson

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "json"

Variables

This section is empty.

Functions

func Jsonify added in v0.1.1

func Jsonify(v interface{}) string

Types

type Int64String

type Int64String int64

Int64String is a go int64 type.

which can marshal into json string, and unmarshal from json string or json number.

type User struct {
  UID Int64String `json:"uid"`
}

so we can marshal into

{"uid": "123456"}

unmarshal from both

{"uid": 123456}

and

{"uid": "123456"}

func (Int64String) Int

func (i Int64String) Int() int

func (Int64String) Int16

func (i Int64String) Int16() int16

func (Int64String) Int32

func (i Int64String) Int32() int32

func (Int64String) Int64

func (i Int64String) Int64() int64

func (Int64String) Int8

func (i Int64String) Int8() int8

func (Int64String) MarshalJSON

func (i Int64String) MarshalJSON() ([]byte, error)

func (*Int64String) UnmarshalJSON

func (i *Int64String) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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