Documentation ¶
Index ¶
- Variables
- func EmptyString2Null(i interface{})
- func SetDatetimeLayout(val interface{}, inputLayout string, layout ...string) error
- func Validate() *validator.Validate
- type Bool
- func (b Bool) Assigned() bool
- func (b Bool) Bool() bool
- func (b *Bool) DecodeSpanner(val interface{}) (err error)
- func (b *Bool) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (b Bool) EncodeSpanner() (interface{}, error)
- func (b *Bool) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (b *Bool) IsEmpty(ptr unsafe.Pointer) bool
- func (b Bool) IsNull() bool
- func (b Bool) MarshalJSON() ([]byte, error)
- func (b *Bool) SetNull()
- func (b *Bool) SetValue(val bool)
- func (b *Bool) UnmarshalJSON(data []byte) error
- func (b Bool) Val() bool
- func (b Bool) Value() interface{}
- type Bytes
- func (b Bytes) Assigned() bool
- func (b Bytes) Bytes() []byte
- func (b *Bytes) DecodeSpanner(val interface{}) (err error)
- func (b *Bytes) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (b Bytes) EncodeSpanner() (interface{}, error)
- func (b *Bytes) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (b *Bytes) IsEmpty(ptr unsafe.Pointer) bool
- func (b Bytes) IsNull() bool
- func (b Bytes) MarshalJSON() ([]byte, error)
- func (b *Bytes) SetNull()
- func (b *Bytes) SetValue(val []byte)
- func (b *Bytes) UnmarshalJSON(data []byte) error
- func (b Bytes) Val() []byte
- func (b Bytes) Value() interface{}
- type Datetime
- func (dt Datetime) Assigned() bool
- func (dt Datetime) Datetime() time.Time
- func (dt *Datetime) DecodeSpanner(val interface{}) (err error)
- func (dt *Datetime) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (dt Datetime) EncodeSpanner() (interface{}, error)
- func (dt *Datetime) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (dt *Datetime) IsEmpty(ptr unsafe.Pointer) bool
- func (dt Datetime) IsNull() bool
- func (dt Datetime) MarshalJSON() ([]byte, error)
- func (dt *Datetime) SetLayouts(inputLayout string, layouts ...string)
- func (dt *Datetime) SetNull()
- func (dt *Datetime) SetValue(val time.Time)
- func (dt *Datetime) UnmarshalJSON(data []byte) error
- func (dt Datetime) Val() time.Time
- func (dt Datetime) Value() interface{}
- type Float32
- func (i *Float32) Add(v *Float32) *Float32
- func (i Float32) Assigned() bool
- func (i *Float32) DecodeSpanner(val interface{}) (err error)
- func (i *Float32) Div(v *Float32) *Float32
- func (i *Float32) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Float32) EncodeSpanner() (interface{}, error)
- func (i Float32) Float32() float32
- func (i *Float32) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Float32) IsEmpty(ptr unsafe.Pointer) bool
- func (i Float32) IsNull() bool
- func (i Float32) MarshalJSON() ([]byte, error)
- func (i *Float32) Minus(v *Float32) *Float32
- func (i *Float32) Mul(v *Float32) *Float32
- func (i *Float32) SetNull()
- func (i *Float32) SetValue(val float32)
- func (i *Float32) UnmarshalJSON(data []byte) error
- func (i Float32) Value() interface{}
- type Float64
- func (i *Float64) Add(v *Float64) *Float64
- func (i Float64) Assigned() bool
- func (i *Float64) DecodeSpanner(val interface{}) (err error)
- func (i *Float64) Div(v *Float64) *Float64
- func (i *Float64) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Float64) EncodeSpanner() (interface{}, error)
- func (i Float64) Float64() float64
- func (i *Float64) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Float64) IsEmpty(ptr unsafe.Pointer) bool
- func (i Float64) IsNull() bool
- func (i Float64) MarshalJSON() ([]byte, error)
- func (i *Float64) Minus(v *Float64) *Float64
- func (i *Float64) Mul(v *Float64) *Float64
- func (i *Float64) SetNull()
- func (i *Float64) SetValue(val float64)
- func (i *Float64) UnmarshalJSON(data []byte) error
- func (i Float64) Value() interface{}
- type Int
- func (i *Int) Add(v *Int) *Int
- func (i Int) Assigned() bool
- func (i *Int) DecodeSpanner(val interface{}) (err error)
- func (i *Int) Div(v *Int) *Int
- func (i *Int) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Int) EncodeSpanner() (interface{}, error)
- func (i Int) Int() int
- func (i *Int) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Int) IsEmpty(ptr unsafe.Pointer) bool
- func (i Int) IsNull() bool
- func (i Int) MarshalJSON() ([]byte, error)
- func (i *Int) Minus(v *Int) *Int
- func (i *Int) Mul(v *Int) *Int
- func (i *Int) SetNull()
- func (i *Int) SetValue(val int)
- func (i *Int) UnmarshalJSON(data []byte) error
- func (i Int) Value() interface{}
- type Int16
- func (i *Int16) Add(v *Int16) *Int16
- func (i Int16) Assigned() bool
- func (i *Int16) DecodeSpanner(val interface{}) (err error)
- func (i *Int16) Div(v *Int16) *Int16
- func (i *Int16) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Int16) EncodeSpanner() (interface{}, error)
- func (i Int16) Int16() int16
- func (i *Int16) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Int16) IsEmpty(ptr unsafe.Pointer) bool
- func (i Int16) IsNull() bool
- func (i Int16) MarshalJSON() ([]byte, error)
- func (i *Int16) Minus(v *Int16) *Int16
- func (i *Int16) Mul(v *Int16) *Int16
- func (i *Int16) SetNull()
- func (i *Int16) SetValue(val int16)
- func (i *Int16) UnmarshalJSON(data []byte) error
- func (i Int16) Value() interface{}
- type Int32
- func (i *Int32) Add(v *Int32) *Int32
- func (i Int32) Assigned() bool
- func (i *Int32) DecodeSpanner(val interface{}) (err error)
- func (i *Int32) Div(v *Int32) *Int32
- func (i *Int32) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Int32) EncodeSpanner() (interface{}, error)
- func (i Int32) Int32() int32
- func (i *Int32) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Int32) IsEmpty(ptr unsafe.Pointer) bool
- func (i Int32) IsNull() bool
- func (i Int32) MarshalJSON() ([]byte, error)
- func (i *Int32) Minus(v *Int32) *Int32
- func (i *Int32) Mul(v *Int32) *Int32
- func (i *Int32) SetNull()
- func (i *Int32) SetValue(val int32)
- func (i *Int32) UnmarshalJSON(data []byte) error
- func (i Int32) Value() interface{}
- type Int64
- func (i *Int64) Add(v *Int64) *Int64
- func (i Int64) Assigned() bool
- func (i *Int64) DecodeSpanner(val interface{}) (err error)
- func (i *Int64) Div(v *Int64) *Int64
- func (i *Int64) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Int64) EncodeSpanner() (interface{}, error)
- func (i Int64) Int64() int64
- func (i *Int64) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Int64) IsEmpty(ptr unsafe.Pointer) bool
- func (i Int64) IsNull() bool
- func (i Int64) MarshalJSON() ([]byte, error)
- func (i *Int64) Minus(v *Int64) *Int64
- func (i *Int64) Mul(v *Int64) *Int64
- func (i *Int64) SetNull()
- func (i *Int64) SetValue(val int64)
- func (i *Int64) UnmarshalJSON(data []byte) error
- func (i Int64) Value() interface{}
- type Int8
- func (i *Int8) Add(v *Int8) *Int8
- func (i Int8) Assigned() bool
- func (i *Int8) DecodeSpanner(val interface{}) (err error)
- func (i *Int8) Div(v *Int8) *Int8
- func (i *Int8) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Int8) EncodeSpanner() (interface{}, error)
- func (i Int8) Int8() int8
- func (i *Int8) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Int8) IsEmpty(ptr unsafe.Pointer) bool
- func (i Int8) IsNull() bool
- func (i Int8) MarshalJSON() ([]byte, error)
- func (i *Int8) Minus(v *Int8) *Int8
- func (i *Int8) Mul(v *Int8) *Int8
- func (i *Int8) SetNull()
- func (i *Int8) SetValue(val int8)
- func (i *Int8) UnmarshalJSON(data []byte) error
- func (i Int8) Value() interface{}
- type InvalidTypeValue
- type Option
- type String
- func (s String) Assigned() bool
- func (s *String) DecodeSpanner(val interface{}) (err error)
- func (s String) Empty() bool
- func (s *String) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (s String) EncodeSpanner() (interface{}, error)
- func (s *String) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (s *String) IsEmpty(ptr unsafe.Pointer) bool
- func (s String) IsNull() bool
- func (s String) MarshalJSON() ([]byte, error)
- func (s *String) SetNull()
- func (s *String) SetValue(val string)
- func (s String) String() string
- func (s *String) UnmarshalJSON(data []byte) error
- func (s String) Val() string
- func (s String) Value() interface{}
- type Uint
- func (i *Uint) Add(v *Uint) *Uint
- func (i Uint) Assigned() bool
- func (i *Uint) DecodeSpanner(val interface{}) (err error)
- func (i *Uint) Div(v *Uint) *Uint
- func (i *Uint) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Uint) EncodeSpanner() (interface{}, error)
- func (i *Uint) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Uint) IsEmpty(ptr unsafe.Pointer) bool
- func (i Uint) IsNull() bool
- func (i Uint) MarshalJSON() ([]byte, error)
- func (i *Uint) Minus(v *Uint) *Uint
- func (i *Uint) Mul(v *Uint) *Uint
- func (i *Uint) SetNull()
- func (i *Uint) SetValue(val uint)
- func (i Uint) Uint() uint
- func (i *Uint) UnmarshalJSON(data []byte) error
- func (i Uint) Value() interface{}
- type Uint16
- func (i *Uint16) Add(v *Uint16) *Uint16
- func (i Uint16) Assigned() bool
- func (i *Uint16) DecodeSpanner(val interface{}) (err error)
- func (i *Uint16) Div(v *Uint16) *Uint16
- func (i *Uint16) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Uint16) EncodeSpanner() (interface{}, error)
- func (i *Uint16) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Uint16) IsEmpty(ptr unsafe.Pointer) bool
- func (i Uint16) IsNull() bool
- func (i Uint16) MarshalJSON() ([]byte, error)
- func (i *Uint16) Minus(v *Uint16) *Uint16
- func (i *Uint16) Mul(v *Uint16) *Uint16
- func (i *Uint16) SetNull()
- func (i *Uint16) SetValue(val uint16)
- func (i Uint16) Uint16() uint16
- func (i *Uint16) UnmarshalJSON(data []byte) error
- func (i Uint16) Value() interface{}
- type Uint32
- func (i *Uint32) Add(v *Uint32) *Uint32
- func (i Uint32) Assigned() bool
- func (i *Uint32) DecodeSpanner(val interface{}) (err error)
- func (i *Uint32) Div(v *Uint32) *Uint32
- func (i *Uint32) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Uint32) EncodeSpanner() (interface{}, error)
- func (i *Uint32) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Uint32) IsEmpty(ptr unsafe.Pointer) bool
- func (i Uint32) IsNull() bool
- func (i Uint32) MarshalJSON() ([]byte, error)
- func (i *Uint32) Minus(v *Uint32) *Uint32
- func (i *Uint32) Mul(v *Uint32) *Uint32
- func (i *Uint32) SetNull()
- func (i *Uint32) SetValue(val uint32)
- func (i Uint32) Uint32() uint32
- func (i *Uint32) UnmarshalJSON(data []byte) error
- func (i Uint32) Value() interface{}
- type Uint64
- func (i *Uint64) Add(v *Uint64) *Uint64
- func (i Uint64) Assigned() bool
- func (i *Uint64) DecodeSpanner(val interface{}) (err error)
- func (i *Uint64) Div(v *Uint64) *Uint64
- func (i *Uint64) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Uint64) EncodeSpanner() (interface{}, error)
- func (i *Uint64) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Uint64) IsEmpty(ptr unsafe.Pointer) bool
- func (i Uint64) IsNull() bool
- func (i Uint64) MarshalJSON() ([]byte, error)
- func (i *Uint64) Minus(v *Uint64) *Uint64
- func (i *Uint64) Mul(v *Uint64) *Uint64
- func (i *Uint64) SetNull()
- func (i *Uint64) SetValue(val uint64)
- func (i Uint64) Uint64() uint64
- func (i *Uint64) UnmarshalJSON(data []byte) error
- func (i Uint64) Value() interface{}
- type Uint8
- func (i *Uint8) Add(v *Uint8) *Uint8
- func (i Uint8) Assigned() bool
- func (i *Uint8) DecodeSpanner(val interface{}) (err error)
- func (i *Uint8) Div(v *Uint8) *Uint8
- func (i *Uint8) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func (i Uint8) EncodeSpanner() (interface{}, error)
- func (i *Uint8) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
- func (i *Uint8) IsEmpty(ptr unsafe.Pointer) bool
- func (i Uint8) IsNull() bool
- func (i Uint8) MarshalJSON() ([]byte, error)
- func (i *Uint8) Minus(v *Uint8) *Uint8
- func (i *Uint8) Mul(v *Uint8) *Uint8
- func (i *Uint8) SetNull()
- func (i *Uint8) SetValue(val uint8)
- func (i Uint8) Uint8() uint8
- func (i *Uint8) UnmarshalJSON(data []byte) error
- func (i Uint8) Value() interface{}
- type WrappedType
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 ¶
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
func (*Bool) DecodeSpanner ¶
func (Bool) EncodeSpanner ¶
func (Bool) MarshalJSON ¶
func (*Bool) UnmarshalJSON ¶
type Bytes ¶
type Bytes struct {
// contains filtered or unexported fields
}
func (*Bytes) DecodeSpanner ¶
func (Bytes) EncodeSpanner ¶
func (Bytes) MarshalJSON ¶
func (*Bytes) UnmarshalJSON ¶
type Datetime ¶
type Datetime struct {
// contains filtered or unexported fields
}
func (*Datetime) DecodeSpanner ¶
func (Datetime) EncodeSpanner ¶
func (Datetime) MarshalJSON ¶
func (*Datetime) SetLayouts ¶
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) UnmarshalJSON ¶
type Float32 ¶
type Float32 struct {
// contains filtered or unexported fields
}
func MakeFloat32 ¶
func NewFloat32 ¶
func (*Float32) DecodeSpanner ¶
func (Float32) EncodeSpanner ¶
func (Float32) MarshalJSON ¶
func (*Float32) UnmarshalJSON ¶
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
func MakeFloat64 ¶
func NewFloat64 ¶
func (*Float64) DecodeSpanner ¶
func (Float64) EncodeSpanner ¶
func (Float64) MarshalJSON ¶
func (*Float64) UnmarshalJSON ¶
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
func (*Int) DecodeSpanner ¶
func (Int) EncodeSpanner ¶
func (Int) MarshalJSON ¶
func (*Int) UnmarshalJSON ¶
type Int16 ¶
type Int16 struct {
// contains filtered or unexported fields
}
func (*Int16) DecodeSpanner ¶
func (Int16) EncodeSpanner ¶
func (Int16) MarshalJSON ¶
func (*Int16) UnmarshalJSON ¶
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
func (*Int32) DecodeSpanner ¶
func (Int32) EncodeSpanner ¶
func (Int32) MarshalJSON ¶
func (*Int32) UnmarshalJSON ¶
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
func (*Int64) DecodeSpanner ¶
func (Int64) EncodeSpanner ¶
func (Int64) MarshalJSON ¶
func (*Int64) UnmarshalJSON ¶
type Int8 ¶
type Int8 struct {
// contains filtered or unexported fields
}
func (*Int8) DecodeSpanner ¶
func (Int8) EncodeSpanner ¶
func (Int8) MarshalJSON ¶
func (*Int8) UnmarshalJSON ¶
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 (*String) DecodeSpanner ¶
func (String) EncodeSpanner ¶
func (String) MarshalJSON ¶
func (*String) UnmarshalJSON ¶
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
func (*Uint) DecodeSpanner ¶
func (Uint) EncodeSpanner ¶
func (Uint) MarshalJSON ¶
func (*Uint) UnmarshalJSON ¶
type Uint16 ¶
type Uint16 struct {
// contains filtered or unexported fields
}
func MakeUint16 ¶
func (*Uint16) DecodeSpanner ¶
func (Uint16) EncodeSpanner ¶
func (Uint16) MarshalJSON ¶
func (*Uint16) UnmarshalJSON ¶
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
func MakeUint32 ¶
func (*Uint32) DecodeSpanner ¶
func (Uint32) EncodeSpanner ¶
func (Uint32) MarshalJSON ¶
func (*Uint32) UnmarshalJSON ¶
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
func MakeUint64 ¶
func (*Uint64) DecodeSpanner ¶
func (Uint64) EncodeSpanner ¶
func (Uint64) MarshalJSON ¶
func (*Uint64) UnmarshalJSON ¶
type Uint8 ¶
type Uint8 struct {
// contains filtered or unexported fields
}
func (*Uint8) DecodeSpanner ¶
func (Uint8) EncodeSpanner ¶
func (Uint8) MarshalJSON ¶
func (*Uint8) UnmarshalJSON ¶
type WrappedType ¶
func NewWrappedType ¶
func NewWrappedType(typ reflect.Type, val interface{}, isNull bool) (WrappedType, error)
Click to show internal directories.
Click to hide internal directories.