types

package
v0.0.0-...-2eb6bad Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 16 Imported by: 0

README

Types

The JSON spec allows the user to assign null value which was used to distinguish null from the omitempty, so we refine the scalar type here that allows to marshal the value from null. Also encapsulate types to support polymorphism, for example in some parsing scenarios

Warning: json.Marshal won't omit the empty struct, you MUST use the jsoniter.Marshal to do that

Quickstarts

Example 1: unmarshal the json with null

	jsonStr := ` 
{
"v1": null,
"v2": 2
}
`

	var s struct {
		V1 types.Int `json:"v1"`
		V2 types.Int `json:"v2"`
		V3 types.Int `json:"v3"`
	}
	err := json.Unmarshal([]byte(jsonStr), &s)

Example 2: replace the empty string with json null

    var s struct {
        V1 types.String `json:"v1"`
    }
    types.EmptyString2Null(&s)
    bytes, err := json.Marshal(s)
    fmt.Println(string(bytes))
    // output: {"v1": null}

Example 3: Create a new types.String based on its type reflection by NewWrappedType()

    val := "string"
    s, err := types.NewWrappedType(types.StringType, val, false)
    if err != nil {
        return 
    }
    if s.Assigned() {
        fmt.Println(s.String())
    }

Validator

The inner type of wrapped type was structure, so we need to use the coustom type func to tell the validator which value to check.

How To Use Validator

var MyStruct struct {
   Name types.String `validate:"required"`
}

types.Validate().Struct(&MyStruct)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WrappedTypeInterface = reflect.TypeOf((*WrappedType)(nil)).Elem()

	StringType  = reflect.TypeOf(String{})
	Int64Type   = reflect.TypeOf(Int64{})
	Float64Type = reflect.TypeOf(Float64{})
	BoolType    = reflect.TypeOf(Bool{})
	TimeType    = reflect.TypeOf(Datetime{})
	//DateType    = reflect.TypeOf(Date{})
	BytesType = reflect.TypeOf(Bytes{})
)
View Source
var (
	NullString = String{/* contains filtered or unexported fields */}
)

Functions

func EmptyString2Null

func EmptyString2Null(i interface{})

EmptyString2Null would replace all empty string fields to null, since empty string was NOT allowed in some legacy systems.

func SetDatetimeLayout

func SetDatetimeLayout(val interface{}, inputLayout string, layout ...string) error

func Validate

func Validate() *validator.Validate

Types

type Bool

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

func MakeBool

func MakeBool(val bool) Bool

func NewBool

func NewBool(val bool) *Bool

func (Bool) Assigned

func (b Bool) Assigned() bool

func (Bool) Bool

func (b Bool) Bool() bool

func (*Bool) DecodeSpanner

func (b *Bool) DecodeSpanner(val interface{}) (err error)

func (*Bool) Encode

func (b *Bool) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Bool) EncodeSpanner

func (b Bool) EncodeSpanner() (interface{}, error)

func (*Bool) IsEmbeddedPtrNil

func (b *Bool) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Bool) IsEmpty

func (b *Bool) IsEmpty(ptr unsafe.Pointer) bool

func (Bool) IsNull

func (b Bool) IsNull() bool

func (Bool) MarshalJSON

func (b Bool) MarshalJSON() ([]byte, error)

func (*Bool) SetNull

func (b *Bool) SetNull()

func (*Bool) SetValue

func (b *Bool) SetValue(val bool)

func (*Bool) UnmarshalJSON

func (b *Bool) UnmarshalJSON(data []byte) error

func (Bool) Val

func (b Bool) Val() bool

func (Bool) Value

func (b Bool) Value() interface{}

type Bytes

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

func MakeBytes

func MakeBytes(val []byte) Bytes

func NewBytes

func NewBytes(val []byte) *Bytes

func (Bytes) Assigned

func (b Bytes) Assigned() bool

func (Bytes) Bytes

func (b Bytes) Bytes() []byte

func (*Bytes) DecodeSpanner

func (b *Bytes) DecodeSpanner(val interface{}) (err error)

func (*Bytes) Encode

func (b *Bytes) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Bytes) EncodeSpanner

func (b Bytes) EncodeSpanner() (interface{}, error)

func (*Bytes) IsEmbeddedPtrNil

func (b *Bytes) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Bytes) IsEmpty

func (b *Bytes) IsEmpty(ptr unsafe.Pointer) bool

func (Bytes) IsNull

func (b Bytes) IsNull() bool

func (Bytes) MarshalJSON

func (b Bytes) MarshalJSON() ([]byte, error)

func (*Bytes) SetNull

func (b *Bytes) SetNull()

func (*Bytes) SetValue

func (b *Bytes) SetValue(val []byte)

func (*Bytes) UnmarshalJSON

func (b *Bytes) UnmarshalJSON(data []byte) error

func (Bytes) Val

func (b Bytes) Val() []byte

func (Bytes) Value

func (b Bytes) Value() interface{}

type Datetime

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

func MakeDatetime

func MakeDatetime(val time.Time, layouts ...string) Datetime

func NewDatetime

func NewDatetime(val time.Time, layouts ...string) *Datetime

func (Datetime) Assigned

func (dt Datetime) Assigned() bool

func (Datetime) Datetime

func (dt Datetime) Datetime() time.Time

func (*Datetime) DecodeSpanner

func (dt *Datetime) DecodeSpanner(val interface{}) (err error)

func (*Datetime) Encode

func (dt *Datetime) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Datetime) EncodeSpanner

func (dt Datetime) EncodeSpanner() (interface{}, error)

func (*Datetime) IsEmbeddedPtrNil

func (dt *Datetime) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Datetime) IsEmpty

func (dt *Datetime) IsEmpty(ptr unsafe.Pointer) bool

func (Datetime) IsNull

func (dt Datetime) IsNull() bool

func (Datetime) MarshalJSON

func (dt Datetime) MarshalJSON() ([]byte, error)

func (*Datetime) SetLayouts

func (dt *Datetime) SetLayouts(inputLayout string, layouts ...string)

SetLayouts was used to set custom layouts for datetime. inputLayout would be used when unmarshal and second parameter would be regarded as outputLayout if exists, or would assign inputLayout as outputLayout.

func (*Datetime) SetNull

func (dt *Datetime) SetNull()

func (*Datetime) SetValue

func (dt *Datetime) SetValue(val time.Time)

func (*Datetime) UnmarshalJSON

func (dt *Datetime) UnmarshalJSON(data []byte) error

func (Datetime) Val

func (dt Datetime) Val() time.Time

func (Datetime) Value

func (dt Datetime) Value() interface{}

type Float32

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

func MakeFloat32

func MakeFloat32(val float32) Float32

func NewFloat32

func NewFloat32(val float32) *Float32

func (*Float32) Add

func (i *Float32) Add(v *Float32) *Float32

func (Float32) Assigned

func (i Float32) Assigned() bool

func (*Float32) DecodeSpanner

func (i *Float32) DecodeSpanner(val interface{}) (err error)

func (*Float32) Div

func (i *Float32) Div(v *Float32) *Float32

func (*Float32) Encode

func (i *Float32) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Float32) EncodeSpanner

func (i Float32) EncodeSpanner() (interface{}, error)

func (Float32) Float32

func (i Float32) Float32() float32

func (*Float32) IsEmbeddedPtrNil

func (i *Float32) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Float32) IsEmpty

func (i *Float32) IsEmpty(ptr unsafe.Pointer) bool

func (Float32) IsNull

func (i Float32) IsNull() bool

func (Float32) MarshalJSON

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

func (*Float32) Minus

func (i *Float32) Minus(v *Float32) *Float32

func (*Float32) Mul

func (i *Float32) Mul(v *Float32) *Float32

func (*Float32) SetNull

func (i *Float32) SetNull()

func (*Float32) SetValue

func (i *Float32) SetValue(val float32)

func (*Float32) UnmarshalJSON

func (i *Float32) UnmarshalJSON(data []byte) error

func (Float32) Value

func (i Float32) Value() interface{}

type Float64

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

func MakeFloat64

func MakeFloat64(val float64) Float64

func NewFloat64

func NewFloat64(val float64) *Float64

func (*Float64) Add

func (i *Float64) Add(v *Float64) *Float64

func (Float64) Assigned

func (i Float64) Assigned() bool

func (*Float64) DecodeSpanner

func (i *Float64) DecodeSpanner(val interface{}) (err error)

func (*Float64) Div

func (i *Float64) Div(v *Float64) *Float64

func (*Float64) Encode

func (i *Float64) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Float64) EncodeSpanner

func (i Float64) EncodeSpanner() (interface{}, error)

func (Float64) Float64

func (i Float64) Float64() float64

func (*Float64) IsEmbeddedPtrNil

func (i *Float64) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Float64) IsEmpty

func (i *Float64) IsEmpty(ptr unsafe.Pointer) bool

func (Float64) IsNull

func (i Float64) IsNull() bool

func (Float64) MarshalJSON

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

func (*Float64) Minus

func (i *Float64) Minus(v *Float64) *Float64

func (*Float64) Mul

func (i *Float64) Mul(v *Float64) *Float64

func (*Float64) SetNull

func (i *Float64) SetNull()

func (*Float64) SetValue

func (i *Float64) SetValue(val float64)

func (*Float64) UnmarshalJSON

func (i *Float64) UnmarshalJSON(data []byte) error

func (Float64) Value

func (i Float64) Value() interface{}

type Int

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

func MakeInt

func MakeInt(val int) Int

func NewInt

func NewInt(val int) *Int

func (*Int) Add

func (i *Int) Add(v *Int) *Int

func (Int) Assigned

func (i Int) Assigned() bool

func (*Int) DecodeSpanner

func (i *Int) DecodeSpanner(val interface{}) (err error)

func (*Int) Div

func (i *Int) Div(v *Int) *Int

func (*Int) Encode

func (i *Int) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Int) EncodeSpanner

func (i Int) EncodeSpanner() (interface{}, error)

func (Int) Int

func (i Int) Int() int

func (*Int) IsEmbeddedPtrNil

func (i *Int) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Int) IsEmpty

func (i *Int) IsEmpty(ptr unsafe.Pointer) bool

func (Int) IsNull

func (i Int) IsNull() bool

func (Int) MarshalJSON

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

func (*Int) Minus

func (i *Int) Minus(v *Int) *Int

func (*Int) Mul

func (i *Int) Mul(v *Int) *Int

func (*Int) SetNull

func (i *Int) SetNull()

func (*Int) SetValue

func (i *Int) SetValue(val int)

func (*Int) UnmarshalJSON

func (i *Int) UnmarshalJSON(data []byte) error

func (Int) Value

func (i Int) Value() interface{}

type Int16

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

func MakeInt16

func MakeInt16(val int16) Int16

func NewInt16

func NewInt16(val int16) *Int16

func (*Int16) Add

func (i *Int16) Add(v *Int16) *Int16

func (Int16) Assigned

func (i Int16) Assigned() bool

func (*Int16) DecodeSpanner

func (i *Int16) DecodeSpanner(val interface{}) (err error)

func (*Int16) Div

func (i *Int16) Div(v *Int16) *Int16

func (*Int16) Encode

func (i *Int16) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Int16) EncodeSpanner

func (i Int16) EncodeSpanner() (interface{}, error)

func (Int16) Int16

func (i Int16) Int16() int16

func (*Int16) IsEmbeddedPtrNil

func (i *Int16) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Int16) IsEmpty

func (i *Int16) IsEmpty(ptr unsafe.Pointer) bool

func (Int16) IsNull

func (i Int16) IsNull() bool

func (Int16) MarshalJSON

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

func (*Int16) Minus

func (i *Int16) Minus(v *Int16) *Int16

func (*Int16) Mul

func (i *Int16) Mul(v *Int16) *Int16

func (*Int16) SetNull

func (i *Int16) SetNull()

func (*Int16) SetValue

func (i *Int16) SetValue(val int16)

func (*Int16) UnmarshalJSON

func (i *Int16) UnmarshalJSON(data []byte) error

func (Int16) Value

func (i Int16) Value() interface{}

type Int32

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

func MakeInt32

func MakeInt32(val int32) Int32

func NewInt32

func NewInt32(val int32) *Int32

func (*Int32) Add

func (i *Int32) Add(v *Int32) *Int32

func (Int32) Assigned

func (i Int32) Assigned() bool

func (*Int32) DecodeSpanner

func (i *Int32) DecodeSpanner(val interface{}) (err error)

func (*Int32) Div

func (i *Int32) Div(v *Int32) *Int32

func (*Int32) Encode

func (i *Int32) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Int32) EncodeSpanner

func (i Int32) EncodeSpanner() (interface{}, error)

func (Int32) Int32

func (i Int32) Int32() int32

func (*Int32) IsEmbeddedPtrNil

func (i *Int32) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Int32) IsEmpty

func (i *Int32) IsEmpty(ptr unsafe.Pointer) bool

func (Int32) IsNull

func (i Int32) IsNull() bool

func (Int32) MarshalJSON

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

func (*Int32) Minus

func (i *Int32) Minus(v *Int32) *Int32

func (*Int32) Mul

func (i *Int32) Mul(v *Int32) *Int32

func (*Int32) SetNull

func (i *Int32) SetNull()

func (*Int32) SetValue

func (i *Int32) SetValue(val int32)

func (*Int32) UnmarshalJSON

func (i *Int32) UnmarshalJSON(data []byte) error

func (Int32) Value

func (i Int32) Value() interface{}

type Int64

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

func MakeInt64

func MakeInt64(val int64) Int64

func NewInt64

func NewInt64(val int64) *Int64

func (*Int64) Add

func (i *Int64) Add(v *Int64) *Int64

func (Int64) Assigned

func (i Int64) Assigned() bool

func (*Int64) DecodeSpanner

func (i *Int64) DecodeSpanner(val interface{}) (err error)

func (*Int64) Div

func (i *Int64) Div(v *Int64) *Int64

func (*Int64) Encode

func (i *Int64) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Int64) EncodeSpanner

func (i Int64) EncodeSpanner() (interface{}, error)

func (Int64) Int64

func (i Int64) Int64() int64

func (*Int64) IsEmbeddedPtrNil

func (i *Int64) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Int64) IsEmpty

func (i *Int64) IsEmpty(ptr unsafe.Pointer) bool

func (Int64) IsNull

func (i Int64) IsNull() bool

func (Int64) MarshalJSON

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

func (*Int64) Minus

func (i *Int64) Minus(v *Int64) *Int64

func (*Int64) Mul

func (i *Int64) Mul(v *Int64) *Int64

func (*Int64) SetNull

func (i *Int64) SetNull()

func (*Int64) SetValue

func (i *Int64) SetValue(val int64)

func (*Int64) UnmarshalJSON

func (i *Int64) UnmarshalJSON(data []byte) error

func (Int64) Value

func (i Int64) Value() interface{}

type Int8

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

func MakeInt8

func MakeInt8(val int8) Int8

func NewInt8

func NewInt8(val int8) *Int8

func (*Int8) Add

func (i *Int8) Add(v *Int8) *Int8

func (Int8) Assigned

func (i Int8) Assigned() bool

func (*Int8) DecodeSpanner

func (i *Int8) DecodeSpanner(val interface{}) (err error)

func (*Int8) Div

func (i *Int8) Div(v *Int8) *Int8

func (*Int8) Encode

func (i *Int8) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Int8) EncodeSpanner

func (i Int8) EncodeSpanner() (interface{}, error)

func (Int8) Int8

func (i Int8) Int8() int8

func (*Int8) IsEmbeddedPtrNil

func (i *Int8) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Int8) IsEmpty

func (i *Int8) IsEmpty(ptr unsafe.Pointer) bool

func (Int8) IsNull

func (i Int8) IsNull() bool

func (Int8) MarshalJSON

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

func (*Int8) Minus

func (i *Int8) Minus(v *Int8) *Int8

func (*Int8) Mul

func (i *Int8) Mul(v *Int8) *Int8

func (*Int8) SetNull

func (i *Int8) SetNull()

func (*Int8) SetValue

func (i *Int8) SetValue(val int8)

func (*Int8) UnmarshalJSON

func (i *Int8) UnmarshalJSON(data []byte) error

func (Int8) Value

func (i Int8) Value() interface{}

type InvalidTypeValue

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

func (InvalidTypeValue) Error

func (v InvalidTypeValue) Error() string

type Option

type Option func(class WrappedType)

type String

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

func MakeString

func MakeString(val string) String

func NewString

func NewString(val string) *String

func (String) Assigned

func (s String) Assigned() bool

func (*String) DecodeSpanner

func (s *String) DecodeSpanner(val interface{}) (err error)

func (String) Empty

func (s String) Empty() bool

func (*String) Encode

func (s *String) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (String) EncodeSpanner

func (s String) EncodeSpanner() (interface{}, error)

func (*String) IsEmbeddedPtrNil

func (s *String) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*String) IsEmpty

func (s *String) IsEmpty(ptr unsafe.Pointer) bool

func (String) IsNull

func (s String) IsNull() bool

func (String) MarshalJSON

func (s String) MarshalJSON() ([]byte, error)

func (*String) SetNull

func (s *String) SetNull()

func (*String) SetValue

func (s *String) SetValue(val string)

func (String) String

func (s String) String() string

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(data []byte) error

func (String) Val

func (s String) Val() string

func (String) Value

func (s String) Value() interface{}

type Uint

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

func MakeUint

func MakeUint(val uint) Uint

func NewUint

func NewUint(val uint) *Uint

func (*Uint) Add

func (i *Uint) Add(v *Uint) *Uint

func (Uint) Assigned

func (i Uint) Assigned() bool

func (*Uint) DecodeSpanner

func (i *Uint) DecodeSpanner(val interface{}) (err error)

func (*Uint) Div

func (i *Uint) Div(v *Uint) *Uint

func (*Uint) Encode

func (i *Uint) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Uint) EncodeSpanner

func (i Uint) EncodeSpanner() (interface{}, error)

func (*Uint) IsEmbeddedPtrNil

func (i *Uint) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Uint) IsEmpty

func (i *Uint) IsEmpty(ptr unsafe.Pointer) bool

func (Uint) IsNull

func (i Uint) IsNull() bool

func (Uint) MarshalJSON

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

func (*Uint) Minus

func (i *Uint) Minus(v *Uint) *Uint

func (*Uint) Mul

func (i *Uint) Mul(v *Uint) *Uint

func (*Uint) SetNull

func (i *Uint) SetNull()

func (*Uint) SetValue

func (i *Uint) SetValue(val uint)

func (Uint) Uint

func (i Uint) Uint() uint

func (*Uint) UnmarshalJSON

func (i *Uint) UnmarshalJSON(data []byte) error

func (Uint) Value

func (i Uint) Value() interface{}

type Uint16

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

func MakeUint16

func MakeUint16(val uint16) Uint16

func NewUint16

func NewUint16(val uint16) *Uint16

func (*Uint16) Add

func (i *Uint16) Add(v *Uint16) *Uint16

func (Uint16) Assigned

func (i Uint16) Assigned() bool

func (*Uint16) DecodeSpanner

func (i *Uint16) DecodeSpanner(val interface{}) (err error)

func (*Uint16) Div

func (i *Uint16) Div(v *Uint16) *Uint16

func (*Uint16) Encode

func (i *Uint16) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Uint16) EncodeSpanner

func (i Uint16) EncodeSpanner() (interface{}, error)

func (*Uint16) IsEmbeddedPtrNil

func (i *Uint16) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Uint16) IsEmpty

func (i *Uint16) IsEmpty(ptr unsafe.Pointer) bool

func (Uint16) IsNull

func (i Uint16) IsNull() bool

func (Uint16) MarshalJSON

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

func (*Uint16) Minus

func (i *Uint16) Minus(v *Uint16) *Uint16

func (*Uint16) Mul

func (i *Uint16) Mul(v *Uint16) *Uint16

func (*Uint16) SetNull

func (i *Uint16) SetNull()

func (*Uint16) SetValue

func (i *Uint16) SetValue(val uint16)

func (Uint16) Uint16

func (i Uint16) Uint16() uint16

func (*Uint16) UnmarshalJSON

func (i *Uint16) UnmarshalJSON(data []byte) error

func (Uint16) Value

func (i Uint16) Value() interface{}

type Uint32

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

func MakeUint32

func MakeUint32(val uint32) Uint32

func NewUint32

func NewUint32(val uint32) *Uint32

func (*Uint32) Add

func (i *Uint32) Add(v *Uint32) *Uint32

func (Uint32) Assigned

func (i Uint32) Assigned() bool

func (*Uint32) DecodeSpanner

func (i *Uint32) DecodeSpanner(val interface{}) (err error)

func (*Uint32) Div

func (i *Uint32) Div(v *Uint32) *Uint32

func (*Uint32) Encode

func (i *Uint32) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Uint32) EncodeSpanner

func (i Uint32) EncodeSpanner() (interface{}, error)

func (*Uint32) IsEmbeddedPtrNil

func (i *Uint32) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Uint32) IsEmpty

func (i *Uint32) IsEmpty(ptr unsafe.Pointer) bool

func (Uint32) IsNull

func (i Uint32) IsNull() bool

func (Uint32) MarshalJSON

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

func (*Uint32) Minus

func (i *Uint32) Minus(v *Uint32) *Uint32

func (*Uint32) Mul

func (i *Uint32) Mul(v *Uint32) *Uint32

func (*Uint32) SetNull

func (i *Uint32) SetNull()

func (*Uint32) SetValue

func (i *Uint32) SetValue(val uint32)

func (Uint32) Uint32

func (i Uint32) Uint32() uint32

func (*Uint32) UnmarshalJSON

func (i *Uint32) UnmarshalJSON(data []byte) error

func (Uint32) Value

func (i Uint32) Value() interface{}

type Uint64

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

func MakeUint64

func MakeUint64(val uint64) Uint64

func NewUint64

func NewUint64(val uint64) *Uint64

func (*Uint64) Add

func (i *Uint64) Add(v *Uint64) *Uint64

func (Uint64) Assigned

func (i Uint64) Assigned() bool

func (*Uint64) DecodeSpanner

func (i *Uint64) DecodeSpanner(val interface{}) (err error)

func (*Uint64) Div

func (i *Uint64) Div(v *Uint64) *Uint64

func (*Uint64) Encode

func (i *Uint64) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Uint64) EncodeSpanner

func (i Uint64) EncodeSpanner() (interface{}, error)

func (*Uint64) IsEmbeddedPtrNil

func (i *Uint64) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Uint64) IsEmpty

func (i *Uint64) IsEmpty(ptr unsafe.Pointer) bool

func (Uint64) IsNull

func (i Uint64) IsNull() bool

func (Uint64) MarshalJSON

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

func (*Uint64) Minus

func (i *Uint64) Minus(v *Uint64) *Uint64

func (*Uint64) Mul

func (i *Uint64) Mul(v *Uint64) *Uint64

func (*Uint64) SetNull

func (i *Uint64) SetNull()

func (*Uint64) SetValue

func (i *Uint64) SetValue(val uint64)

func (Uint64) Uint64

func (i Uint64) Uint64() uint64

func (*Uint64) UnmarshalJSON

func (i *Uint64) UnmarshalJSON(data []byte) error

func (Uint64) Value

func (i Uint64) Value() interface{}

type Uint8

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

func MakeUint8

func MakeUint8(val uint8) Uint8

func NewUint8

func NewUint8(val uint8) *Uint8

func (*Uint8) Add

func (i *Uint8) Add(v *Uint8) *Uint8

func (Uint8) Assigned

func (i Uint8) Assigned() bool

func (*Uint8) DecodeSpanner

func (i *Uint8) DecodeSpanner(val interface{}) (err error)

func (*Uint8) Div

func (i *Uint8) Div(v *Uint8) *Uint8

func (*Uint8) Encode

func (i *Uint8) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (Uint8) EncodeSpanner

func (i Uint8) EncodeSpanner() (interface{}, error)

func (*Uint8) IsEmbeddedPtrNil

func (i *Uint8) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool

func (*Uint8) IsEmpty

func (i *Uint8) IsEmpty(ptr unsafe.Pointer) bool

func (Uint8) IsNull

func (i Uint8) IsNull() bool

func (Uint8) MarshalJSON

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

func (*Uint8) Minus

func (i *Uint8) Minus(v *Uint8) *Uint8

func (*Uint8) Mul

func (i *Uint8) Mul(v *Uint8) *Uint8

func (*Uint8) SetNull

func (i *Uint8) SetNull()

func (*Uint8) SetValue

func (i *Uint8) SetValue(val uint8)

func (Uint8) Uint8

func (i Uint8) Uint8() uint8

func (*Uint8) UnmarshalJSON

func (i *Uint8) UnmarshalJSON(data []byte) error

func (Uint8) Value

func (i Uint8) Value() interface{}

type WrappedType

type WrappedType interface {
	Assigned() bool
	IsNull() bool
	Value() interface{}
}

func NewWrappedType

func NewWrappedType(typ reflect.Type, val interface{}, isNull bool) (WrappedType, error)

Jump to

Keyboard shortcuts

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