Documentation ¶
Index ¶
- Constants
- Variables
- func BoolSlice(null []BoolAccessor, valid bool) []bool
- func Complex64Slice(null []Complex64Accessor, valid bool) []complex64
- func ComplexSlice(null []ComplexAccessor, valid bool) []complex128
- func Float32Slice(null []Float32Accessor, valid bool) []float32
- func FloatSlice(null []FloatAccessor, valid bool) []float64
- func Int16Slice(null []Int16Accessor, valid bool) []int16
- func Int32Slice(null []Int32Accessor, valid bool) []int32
- func Int64Slice(null []Int64Accessor, valid bool) []int64
- func Int8Slice(null []Int8Accessor, valid bool) []int8
- func IntSlice(null []IntAccessor, valid bool) []int
- func InterfaceSlice(null []InterfaceAccessor, valid bool) []interface{}
- func NumericToString(v interface{}, base int, fmtByte byte, prec int) string
- func StringSlice(null []StringAccessor, valid bool) []string
- func TimeSlice(null []TimeAccessor, valid bool) []time.Time
- func Uint16Slice(null []Uint16Accessor, valid bool) []uint16
- func Uint32Slice(null []Uint32Accessor, valid bool) []uint32
- func Uint64Slice(null []Uint64Accessor, valid bool) []uint64
- func Uint8Slice(null []Uint8Accessor, valid bool) []uint8
- func UintSlice(null []UintAccessor, valid bool) []uint
- type BoolAccessor
- type BoolCommon
- func (n BoolCommon) Err() error
- func (n BoolCommon) MarshalJSON() ([]byte, error)
- func (n BoolCommon) Present() bool
- func (n *BoolCommon) Scan(value interface{}) error
- func (n *BoolCommon) Set(value bool)
- func (n BoolCommon) Typ(options ...Option) *Type
- func (n *BoolCommon) UnmarshalJSON(b []byte) error
- func (n BoolCommon) V() bool
- func (n BoolCommon) Valid() bool
- func (n BoolCommon) Value() (driver.Value, error)
- type Common
- type Complex64Accessor
- func Complex64(from complex128, defaultValue ...complex64) Complex64Accessor
- func Float32Complex64(from float32, defaultValue ...complex64) Complex64Accessor
- func FloatComplex64(from float64, defaultValue ...complex64) Complex64Accessor
- func IntComplex64(from int64, defaultValue ...complex64) Complex64Accessor
- func NComplex64(value complex64) Complex64Accessor
- func NNComplex64(value complex64) Complex64Accessor
- func StringComplex64(from string, defaultValue ...complex64) Complex64Accessor
- func UintComplex64(from uint64, defaultValue ...complex64) Complex64Accessor
- type Complex64Common
- func (n Complex64Common) Err() error
- func (n Complex64Common) MarshalJSON() ([]byte, error)
- func (n Complex64Common) Present() bool
- func (n *Complex64Common) Scan(value interface{}) error
- func (n *Complex64Common) Set(value complex64)
- func (n Complex64Common) Typ(options ...Option) *Type
- func (n *Complex64Common) UnmarshalJSON(b []byte) error
- func (n Complex64Common) V() complex64
- func (n Complex64Common) Valid() bool
- func (n Complex64Common) Value() (driver.Value, error)
- type ComplexAccessor
- func IntComplex(from int64, defaultValue ...complex128) ComplexAccessor
- func NComplex(value complex128) ComplexAccessor
- func NNComplex(value complex128) ComplexAccessor
- func StringComplex(from string, defaultValue ...complex128) ComplexAccessor
- func UintComplex(from uint64, defaultValue ...complex128) ComplexAccessor
- type ComplexCommon
- func (n ComplexCommon) Err() error
- func (n ComplexCommon) MarshalJSON() ([]byte, error)
- func (n ComplexCommon) Present() bool
- func (n *ComplexCommon) Scan(value interface{}) error
- func (n *ComplexCommon) Set(value complex128)
- func (n ComplexCommon) Typ(options ...Option) *Type
- func (n *ComplexCommon) UnmarshalJSON(b []byte) error
- func (n ComplexCommon) V() complex128
- func (n ComplexCommon) Valid() bool
- func (n ComplexCommon) Value() (driver.Value, error)
- type ComplexStringOption
- type ErrorConvert
- type ErrorInvalidArgument
- type ErrorOutOfBounds
- type ErrorOutOfRange
- type ErrorPanic
- type ErrorUnexpectedValue
- type Float32Accessor
- func Complex64Float32(from complex64, defaultValue ...float32) Float32Accessor
- func ComplexFloat32(from complex128, defaultValue ...float32) Float32Accessor
- func Float32(from float64, defaultValue ...float32) Float32Accessor
- func IntFloat32(from int64, defaultValue ...float32) Float32Accessor
- func NFloat32(value float32) Float32Accessor
- func NNFloat32(value float32) Float32Accessor
- func StringFloat32(from string, defaultValue ...float32) Float32Accessor
- func UintFloat32(from uint64, defaultValue ...float32) Float32Accessor
- type Float32Common
- func (n Float32Common) Err() error
- func (n Float32Common) MarshalJSON() ([]byte, error)
- func (n Float32Common) Present() bool
- func (n *Float32Common) Scan(value interface{}) error
- func (n *Float32Common) Set(value float32)
- func (n Float32Common) Typ(options ...Option) *Type
- func (n *Float32Common) UnmarshalJSON(b []byte) error
- func (n Float32Common) V() float32
- func (n Float32Common) Valid() bool
- func (n Float32Common) Value() (driver.Value, error)
- type FloatAccessor
- func Complex64Float64(from complex64, defaultValue ...float64) FloatAccessor
- func ComplexFloat64(from complex128, defaultValue ...float64) FloatAccessor
- func IntFloat(from int64, defaultValue ...float64) FloatAccessor
- func NFloat(value float64) FloatAccessor
- func NNFloat(value float64) FloatAccessor
- func StringFloat(from string, defaultValue ...float64) FloatAccessor
- func UintFloat(from uint64, defaultValue ...float64) FloatAccessor
- type FloatCommon
- func (n FloatCommon) Err() error
- func (n FloatCommon) MarshalJSON() ([]byte, error)
- func (n FloatCommon) Present() bool
- func (n *FloatCommon) Scan(value interface{}) error
- func (n *FloatCommon) Set(value float64)
- func (n FloatCommon) Typ(options ...Option) *Type
- func (n *FloatCommon) UnmarshalJSON(b []byte) error
- func (n FloatCommon) V() float64
- func (n FloatCommon) Valid() bool
- func (n FloatCommon) Value() (driver.Value, error)
- type FloatStringOption
- type Int16Accessor
- func Complex64Int16(from complex64, defaultValue ...int16) Int16Accessor
- func ComplexInt16(from complex128, defaultValue ...int16) Int16Accessor
- func Float32Int16(from float32, defaultValue ...int16) Int16Accessor
- func FloatInt16(from float64, defaultValue ...int16) Int16Accessor
- func Int16(from int64, defaultValue ...int16) Int16Accessor
- func NInt16(value int16) Int16Accessor
- func NNInt16(value int16) Int16Accessor
- func StringInt16(from string, defaultValue ...int16) Int16Accessor
- func UintInt16(from uint64, defaultValue ...int16) Int16Accessor
- type Int16Common
- func (n Int16Common) Err() error
- func (n Int16Common) MarshalJSON() ([]byte, error)
- func (n Int16Common) Present() bool
- func (n *Int16Common) Scan(value interface{}) error
- func (n *Int16Common) Set(value int16)
- func (n Int16Common) Typ(options ...Option) *Type
- func (n *Int16Common) UnmarshalJSON(b []byte) error
- func (n Int16Common) V() int16
- func (n Int16Common) Valid() bool
- func (n Int16Common) Value() (driver.Value, error)
- type Int32Accessor
- func Complex64Int32(from complex64, defaultValue ...int32) Int32Accessor
- func ComplexInt32(from complex128, defaultValue ...int32) Int32Accessor
- func Float32Int32(from float32, defaultValue ...int32) Int32Accessor
- func FloatInt32(from float64, defaultValue ...int32) Int32Accessor
- func Int32(from int64, defaultValue ...int32) Int32Accessor
- func NInt32(value int32) Int32Accessor
- func NNInt32(value int32) Int32Accessor
- func StringInt32(from string, defaultValue ...int32) Int32Accessor
- func UintInt32(from uint64, defaultValue ...int32) Int32Accessor
- type Int32Common
- func (n Int32Common) Err() error
- func (n Int32Common) MarshalJSON() ([]byte, error)
- func (n Int32Common) Present() bool
- func (n *Int32Common) Scan(value interface{}) error
- func (n *Int32Common) Set(value int32)
- func (n Int32Common) Typ(options ...Option) *Type
- func (n *Int32Common) UnmarshalJSON(b []byte) error
- func (n Int32Common) V() int32
- func (n Int32Common) Valid() bool
- func (n Int32Common) Value() (driver.Value, error)
- type Int64Accessor
- func Complex64Int64(from complex64, defaultValue ...int64) Int64Accessor
- func ComplexInt64(from complex128, defaultValue ...int64) Int64Accessor
- func Float32Int64(from float32, defaultValue ...int64) Int64Accessor
- func FloatInt64(from float64, defaultValue ...int64) Int64Accessor
- func NInt64(value int64) Int64Accessor
- func NNInt64(value int64) Int64Accessor
- func StringInt64(from string, defaultValue ...int64) Int64Accessor
- func UintInt64(from uint64, defaultValue ...int64) Int64Accessor
- type Int64Common
- func (n Int64Common) Err() error
- func (n Int64Common) MarshalJSON() ([]byte, error)
- func (n Int64Common) Present() bool
- func (n *Int64Common) Scan(value interface{}) error
- func (n *Int64Common) Set(value int64)
- func (n Int64Common) Typ(options ...Option) *Type
- func (n *Int64Common) UnmarshalJSON(b []byte) error
- func (n Int64Common) V() int64
- func (n Int64Common) Valid() bool
- func (n Int64Common) Value() (driver.Value, error)
- type Int8Accessor
- func Complex64Int8(from complex64, defaultValue ...int8) Int8Accessor
- func ComplexInt8(from complex128, defaultValue ...int8) Int8Accessor
- func Float32Int8(from float32, defaultValue ...int8) Int8Accessor
- func FloatInt8(from float64, defaultValue ...int8) Int8Accessor
- func Int8(from int64, defaultValue ...int8) Int8Accessor
- func NInt8(value int8) Int8Accessor
- func NNInt8(value int8) Int8Accessor
- func StringInt8(from string, defaultValue ...int8) Int8Accessor
- func UintInt8(from uint64, defaultValue ...int8) Int8Accessor
- type Int8Common
- func (n Int8Common) Err() error
- func (n Int8Common) MarshalJSON() ([]byte, error)
- func (n Int8Common) Present() bool
- func (n *Int8Common) Scan(value interface{}) error
- func (n *Int8Common) Set(value int8)
- func (n Int8Common) Typ(options ...Option) *Type
- func (n *Int8Common) UnmarshalJSON(b []byte) error
- func (n Int8Common) V() int8
- func (n Int8Common) Valid() bool
- func (n Int8Common) Value() (driver.Value, error)
- type IntAccessor
- func Complex64Int(from complex64, defaultValue ...int) IntAccessor
- func ComplexInt(from complex128, defaultValue ...int) IntAccessor
- func Float32Int(from float32, defaultValue ...int) IntAccessor
- func FloatInt(from float64, defaultValue ...int) IntAccessor
- func NInt(value int) IntAccessor
- func NNInt(value int) IntAccessor
- func StringInt(from string, defaultValue ...int) IntAccessor
- type IntCommon
- func (n IntCommon) Err() error
- func (n IntCommon) MarshalJSON() ([]byte, error)
- func (n IntCommon) Present() bool
- func (n *IntCommon) Scan(value interface{}) error
- func (n *IntCommon) Set(value int)
- func (n IntCommon) Typ(options ...Option) *Type
- func (n *IntCommon) UnmarshalJSON(b []byte) error
- func (n IntCommon) V() int
- func (n IntCommon) Valid() bool
- func (n IntCommon) Value() (driver.Value, error)
- type IntStringOption
- type InterfaceAccessor
- type InterfaceCommon
- func (n InterfaceCommon) Err() error
- func (n InterfaceCommon) MarshalJSON() ([]byte, error)
- func (n InterfaceCommon) Present() bool
- func (n *InterfaceCommon) Scan(value interface{}) error
- func (n *InterfaceCommon) Set(value interface{})
- func (n InterfaceCommon) Typ(options ...Option) *Type
- func (n *InterfaceCommon) UnmarshalJSON(b []byte) error
- func (n InterfaceCommon) V() interface{}
- func (n InterfaceCommon) Valid() bool
- func (n InterfaceCommon) Value() (driver.Value, error)
- type NotNullBool
- type NotNullComplex
- type NotNullComplex64
- type NotNullFloat
- type NotNullFloat32
- type NotNullInt
- type NotNullInt16
- type NotNullInt32
- type NotNullInt64
- type NotNullInt8
- type NotNullInterface
- type NotNullString
- type NotNullTime
- type NotNullUint
- type NotNullUint16
- type NotNullUint32
- type NotNullUint64
- type NotNullUint8
- type NullBool
- type NullComplex
- type NullComplex64
- type NullFloat
- type NullFloat32
- type NullInt
- type NullInt16
- type NullInt32
- type NullInt64
- type NullInt8
- type NullInterface
- type NullString
- type NullTime
- type NullUint
- type NullUint16
- type NullUint32
- type NullUint64
- type NullUint8
- type Option
- type StringAccessor
- func BoolString(from bool) StringAccessor
- func ComplexString(from complex128, options ...ComplexStringOption) StringAccessor
- func Concat(values []interface{}, options ...Option) StringAccessor
- func FloatString(from float64, options ...FloatStringOption) StringAccessor
- func IntString(from int64, options ...IntStringOption) StringAccessor
- func NNString(value string) StringAccessor
- func NString(value string) StringAccessor
- func UintString(from uint64, options ...UintStringOption) StringAccessor
- type StringCommon
- func (n StringCommon) Err() error
- func (n StringCommon) MarshalJSON() ([]byte, error)
- func (n StringCommon) Present() bool
- func (n *StringCommon) Scan(value interface{}) error
- func (n *StringCommon) Set(value string)
- func (n StringCommon) Typ(options ...Option) *Type
- func (n *StringCommon) UnmarshalJSON(b []byte) error
- func (n StringCommon) V() string
- func (n StringCommon) Valid() bool
- func (n StringCommon) Value() (driver.Value, error)
- type TimeAccessor
- type TimeCommon
- func (n TimeCommon) Err() error
- func (n TimeCommon) MarshalJSON() ([]byte, error)
- func (n TimeCommon) Present() bool
- func (n *TimeCommon) Scan(value interface{}) error
- func (n *TimeCommon) Set(value time.Time)
- func (n TimeCommon) Typ(options ...Option) *Type
- func (n *TimeCommon) UnmarshalJSON(b []byte) error
- func (n TimeCommon) V() time.Time
- func (n TimeCommon) Valid() bool
- func (n TimeCommon) Value() (driver.Value, error)
- type Type
- func (t *Type) Bool() BoolAccessor
- func (t *Type) BoolHumanize() BoolAccessor
- func (t *Type) BoolPositive() BoolAccessor
- func (t *Type) Complex(defaultValue ...complex128) ComplexAccessor
- func (t *Type) Complex64(defaultValue ...complex64) Complex64Accessor
- func (t *Type) Empty() BoolAccessor
- func (t *Type) Equals(value interface{}) BoolAccessor
- func (t *Type) Error() error
- func (t *Type) Float(defaultValue ...float64) FloatAccessor
- func (t *Type) Float32(defaultValue ...float32) Float32Accessor
- func (t *Type) Get(argIndexes ...interface{}) (typ *Type)
- func (t *Type) Identical(src interface{}) BoolAccessor
- func (t *Type) Int(defaultValue ...int) IntAccessor
- func (t *Type) Int16(defaultValue ...int16) Int16Accessor
- func (t *Type) Int32(defaultValue ...int32) Int32Accessor
- func (t *Type) Int64(defaultValue ...int64) Int64Accessor
- func (t *Type) Int8(defaultValue ...int8) Int8Accessor
- func (t *Type) Interface() InterfaceAccessor
- func (t *Type) IsBool(indirect ...bool) bool
- func (t *Type) IsComplex(indirect ...bool) bool
- func (t *Type) IsComplex128(indirect ...bool) bool
- func (t *Type) IsComplex64(indirect ...bool) bool
- func (t *Type) IsComposite(indirect ...bool) bool
- func (t *Type) IsFloat(indirect ...bool) bool
- func (t *Type) IsFloat32(indirect ...bool) bool
- func (t *Type) IsFloat64(indirect ...bool) bool
- func (t *Type) IsInt(indirect ...bool) bool
- func (t *Type) IsNumeric(indirect ...bool) bool
- func (t *Type) IsPointer(indirect ...bool) bool
- func (t *Type) IsPrimitives(indirect ...bool) bool
- func (t *Type) IsString(indirect ...bool) bool
- func (t *Type) IsUint(indirect ...bool) bool
- func (t *Type) Kind(indirect ...bool) reflect.Kind
- func (t *Type) OptionBase() int
- func (t *Type) OptionFmtByte() byte
- func (t *Type) OptionPrecision() int
- func (t *Type) String() StringAccessor
- func (t *Type) StringBool() StringAccessor
- func (t *Type) StringComplex(defaultValue ...complex64) StringAccessor
- func (t *Type) StringDefault(defaultValue string) StringAccessor
- func (t *Type) StringEmpty() StringAccessor
- func (t *Type) StringFloat(defaultValue ...float32) StringAccessor
- func (t *Type) StringInt() StringAccessor
- func (t *Type) Uint(defaultValue ...uint) UintAccessor
- func (t *Type) Uint16(defaultValue ...uint16) Uint16Accessor
- func (t *Type) Uint32(defaultValue ...uint32) Uint32Accessor
- func (t *Type) Uint64(defaultValue ...uint64) Uint64Accessor
- func (t *Type) Uint8(defaultValue ...uint8) Uint8Accessor
- type Uint16Accessor
- func Complex64Uint16(from complex64, defaultValue ...uint16) Uint16Accessor
- func ComplexUint16(from complex128, defaultValue ...uint16) Uint16Accessor
- func Float32Uint16(from float32, defaultValue ...uint16) Uint16Accessor
- func FloatUint16(from float64, defaultValue ...uint16) Uint16Accessor
- func IntUint16(from int64, defaultValue ...uint16) Uint16Accessor
- func NNUint16(value uint16) Uint16Accessor
- func NUint16(value uint16) Uint16Accessor
- func StringUint16(from string, defaultValue ...uint16) Uint16Accessor
- func Uint16(from uint64, defaultValue ...uint16) Uint16Accessor
- type Uint16Common
- func (n Uint16Common) Err() error
- func (n Uint16Common) MarshalJSON() ([]byte, error)
- func (n Uint16Common) Present() bool
- func (n *Uint16Common) Scan(value interface{}) error
- func (n *Uint16Common) Set(value uint16)
- func (n Uint16Common) Typ(options ...Option) *Type
- func (n *Uint16Common) UnmarshalJSON(b []byte) error
- func (n Uint16Common) V() uint16
- func (n Uint16Common) Valid() bool
- func (n Uint16Common) Value() (driver.Value, error)
- type Uint32Accessor
- func Complex64Uint32(from complex64, defaultValue ...uint32) Uint32Accessor
- func ComplexUint32(from complex128, defaultValue ...uint32) Uint32Accessor
- func Float32Uint32(from float32, defaultValue ...uint32) Uint32Accessor
- func FloatUint32(from float64, defaultValue ...uint32) Uint32Accessor
- func IntUint32(from int64, defaultValue ...uint32) Uint32Accessor
- func NNUint32(value uint32) Uint32Accessor
- func NUint32(value uint32) Uint32Accessor
- func StringUint32(from string, defaultValue ...uint32) Uint32Accessor
- func Uint32(from uint64, defaultValue ...uint32) Uint32Accessor
- type Uint32Common
- func (n Uint32Common) Err() error
- func (n Uint32Common) MarshalJSON() ([]byte, error)
- func (n Uint32Common) Present() bool
- func (n *Uint32Common) Scan(value interface{}) error
- func (n *Uint32Common) Set(value uint32)
- func (n Uint32Common) Typ(options ...Option) *Type
- func (n *Uint32Common) UnmarshalJSON(b []byte) error
- func (n Uint32Common) V() uint32
- func (n Uint32Common) Valid() bool
- func (n Uint32Common) Value() (driver.Value, error)
- type Uint64Accessor
- func Complex64Uint64(from complex64, defaultValue ...uint64) Uint64Accessor
- func ComplexUint64(from complex128, defaultValue ...uint64) Uint64Accessor
- func Float32Uint64(from float32, defaultValue ...uint64) Uint64Accessor
- func FloatUint64(from float64, defaultValue ...uint64) Uint64Accessor
- func IntUint64(from int64, defaultValue ...uint64) Uint64Accessor
- func NNUint64(value uint64) Uint64Accessor
- func NUint64(value uint64) Uint64Accessor
- func StringUint64(from string, defaultValue ...uint64) Uint64Accessor
- type Uint64Common
- func (n Uint64Common) Err() error
- func (n Uint64Common) MarshalJSON() ([]byte, error)
- func (n Uint64Common) Present() bool
- func (n *Uint64Common) Scan(value interface{}) error
- func (n *Uint64Common) Set(value uint64)
- func (n Uint64Common) Typ(options ...Option) *Type
- func (n *Uint64Common) UnmarshalJSON(b []byte) error
- func (n Uint64Common) V() uint64
- func (n Uint64Common) Valid() bool
- func (n Uint64Common) Value() (driver.Value, error)
- type Uint8Accessor
- func Complex64Uint8(from complex64, defaultValue ...uint8) Uint8Accessor
- func ComplexUint8(from complex128, defaultValue ...uint8) Uint8Accessor
- func Float32Uint8(from float32, defaultValue ...uint8) Uint8Accessor
- func FloatUint8(from float64, defaultValue ...uint8) Uint8Accessor
- func IntUint8(from int64, defaultValue ...uint8) Uint8Accessor
- func NNUint8(value uint8) Uint8Accessor
- func NUint8(value uint8) Uint8Accessor
- func StringUint8(from string, defaultValue ...uint8) Uint8Accessor
- func Uint8(from uint64, defaultValue ...uint8) Uint8Accessor
- type Uint8Common
- func (n Uint8Common) Err() error
- func (n Uint8Common) MarshalJSON() ([]byte, error)
- func (n Uint8Common) Present() bool
- func (n *Uint8Common) Scan(value interface{}) error
- func (n *Uint8Common) Set(value uint8)
- func (n Uint8Common) Typ(options ...Option) *Type
- func (n *Uint8Common) UnmarshalJSON(b []byte) error
- func (n Uint8Common) V() uint8
- func (n Uint8Common) Valid() bool
- func (n Uint8Common) Value() (driver.Value, error)
- type UintAccessor
- func Complex64Uint(from complex64, defaultValue ...uint) UintAccessor
- func ComplexUint(from complex128, defaultValue ...uint) UintAccessor
- func Float32Uint(from float32, defaultValue ...uint) UintAccessor
- func FloatUint(from float64, defaultValue ...uint) UintAccessor
- func NNUint(value uint) UintAccessor
- func NUint(value uint) UintAccessor
- func StringUint(from string, defaultValue ...uint) UintAccessor
- type UintCommon
- func (n UintCommon) Err() error
- func (n UintCommon) MarshalJSON() ([]byte, error)
- func (n UintCommon) Present() bool
- func (n *UintCommon) Scan(value interface{}) error
- func (n *UintCommon) Set(value uint)
- func (n UintCommon) Typ(options ...Option) *Type
- func (n *UintCommon) UnmarshalJSON(b []byte) error
- func (n UintCommon) V() uint
- func (n UintCommon) Valid() bool
- func (n UintCommon) Value() (driver.Value, error)
- type UintStringOption
Constants ¶
const ( MinFloat32 = float32(-3.40282346638528859811704183484516925440e+38) MaxFloat32 = float32(3.40282346638528859811704183484516925440e+38) MinSafeIntFloat32 = float32(-1.6777215e+07) MaxSafeIntFloat32 = float32(1.6777215e+07) MinFloat64 = float64(-1.797693134862315708145274237317043567981e+308) MaxFloat64 = float64(1.797693134862315708145274237317043567981e+308) MinSafeIntFloat64 = float64(-9.007199254740991e+15) MaxSafeIntFloat64 = float64(9.007199254740991e+15) MaxInt8 = int8(127) MinInt8 = int8(-128) MaxInt16 = int16(32767) MinInt16 = int16(-32768) MaxInt32 = int32(2147483647) MinInt32 = int32(-2147483648) MaxInt64 = int64(9223372036854775807) MinInt64 = int64(-9223372036854775808) MaxInt = int(9223372036854775807) MinInt = int(-9223372036854775808) MaxUint8 = uint8(255) MaxUint16 = uint16(65535) MaxUint32 = uint32(4294967295) MaxUint64 = uint64(18446744073709551615) MaxUint = uint64(18446744073709551615) )
Min and Max values in primitive types
Variables ¶
var ( // ErrConvert is returned when value can't safely convert ErrConvert = ErrorConvert(errors.New("value can't safely convert")) // ErrOutOfRange is returned when value out of range on given data ErrOutOfRange = ErrorOutOfRange(errors.New("out of range on given data")) // ErrOutOfBounds is returned when value out of bounds on given data ErrOutOfBounds = ErrorOutOfBounds(errors.New("out of bounds on given data")) // ErrUnexpectedValue is returned when unexpected value given on data ErrUnexpectedValue = ErrorUnexpectedValue(errors.New("unexpected value given on data")) // ErrInvalidArgument is returned when invalid argument is present ErrInvalidArgument = ErrorInvalidArgument(errors.New("invalid argument")) // ErrDefaultValue is returned when default value is ambiguous ErrDefaultValue = ErrorInvalidArgument(errors.New("default value is ambiguous")) )
var ( // ErrBaseInvalid is returned when a base option has invalid range ErrBaseInvalid = ErrorInvalidArgument(errors.New("base option must be in range 2 <= base <= 36")) // ErrFmtByteInvalid is returned when a fmt byte has invalid value ErrFmtByteInvalid = ErrorInvalidArgument(errors.New("fmtByte option must be one of 'b', 'e', 'E', 'f', 'g', 'G'")) )
Functions ¶
func BoolSlice ¶
func BoolSlice(null []BoolAccessor, valid bool) []bool
BoolSlice returns slice of bool with filled values from slice of BoolAccessor
func Complex64Slice ¶
func Complex64Slice(null []Complex64Accessor, valid bool) []complex64
Complex64Slice returns slice of complex64 with filled values from slice of Complex64Accessor
func ComplexSlice ¶
func ComplexSlice(null []ComplexAccessor, valid bool) []complex128
ComplexSlice returns slice of complex128 with filled values from slice of ComplexAccessor
func Float32Slice ¶
func Float32Slice(null []Float32Accessor, valid bool) []float32
Float32Slice returns slice of float32 with filled values from slice of Float32Accessor
func FloatSlice ¶
func FloatSlice(null []FloatAccessor, valid bool) []float64
FloatSlice returns slice of float64 with filled values from slice of FloatAccessor
func Int16Slice ¶
func Int16Slice(null []Int16Accessor, valid bool) []int16
Int16Slice returns slice of int16 with filled values from slice of Int16Accessor
func Int32Slice ¶
func Int32Slice(null []Int32Accessor, valid bool) []int32
Int32Slice returns slice of int32 with filled values from slice of Int32Accessor
func Int64Slice ¶
func Int64Slice(null []Int64Accessor, valid bool) []int64
Int64Slice returns slice of int64 with filled values from slice of Int64Accessor
func Int8Slice ¶
func Int8Slice(null []Int8Accessor, valid bool) []int8
Int8Slice returns slice of int8 with filled values from slice of Int8Accessor
func IntSlice ¶
func IntSlice(null []IntAccessor, valid bool) []int
IntSlice returns slice of int with filled values from slice of IntAccessor
func InterfaceSlice ¶
func InterfaceSlice(null []InterfaceAccessor, valid bool) []interface{}
InterfaceSlice returns slice of interface{} with filled values from slice of InterfaceAccessor
func NumericToString ¶
NumericToString convert from any numeric type to string in the given base for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z' for digit values >= 10. The format fmt is one of 'b' (-ddddp±ddd, a binary exponent), 'e' (-d.dddde±dd, a decimal exponent), 'E' (-d.ddddE±dd, a decimal exponent), 'f' (-ddd.dddd, no exponent), 'g' ('e' for large exponents, 'f' otherwise), or 'G' ('E' for large exponents, 'f' otherwise). The special precision -1 uses the smallest number of digits necessary such that ParseFloat will return f exactly.
func StringSlice ¶
func StringSlice(null []StringAccessor, valid bool) []string
StringSlice returns slice of string with filled values from slice of StringAccessor
func TimeSlice ¶
func TimeSlice(null []TimeAccessor, valid bool) []time.Time
TimeSlice returns slice of time.Time with filled values from slice of TimeAccessor
func Uint16Slice ¶
func Uint16Slice(null []Uint16Accessor, valid bool) []uint16
Uint16Slice returns slice of uint16 with filled values from slice of Uint16Accessor
func Uint32Slice ¶
func Uint32Slice(null []Uint32Accessor, valid bool) []uint32
Uint32Slice returns slice of uint32 with filled values from slice of Uint32Accessor
func Uint64Slice ¶
func Uint64Slice(null []Uint64Accessor, valid bool) []uint64
Uint64Slice returns slice of uint64 with filled values from slice of Uint64Accessor
func Uint8Slice ¶
func Uint8Slice(null []Uint8Accessor, valid bool) []uint8
Uint8Slice returns slice of uint8 with filled values from slice of Uint8Accessor
func UintSlice ¶
func UintSlice(null []UintAccessor, valid bool) []uint
UintSlice returns slice of uint with filled values from slice of UintAccessor
Types ¶
type BoolAccessor ¶
type BoolAccessor interface { Common V() bool Set(value bool) Clone() BoolAccessor }
BoolAccessor accessor of bool type.
func NBool ¶
func NBool(value bool) BoolAccessor
NBool returns NullBool under BoolAccessor from bool
func NNBool ¶
func NNBool(value bool) BoolAccessor
NNBool returns NotNullBool under BoolAccessor from bool
func StringBoolHumanize ¶
func StringBoolHumanize(from string) BoolAccessor
StringBoolHumanize convert value from string to bool. Returns false for string 'false' in case-insensitive mode or string equals '0'
type BoolCommon ¶
BoolCommon represents a bool with pointer and error.
func (BoolCommon) MarshalJSON ¶
func (n BoolCommon) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (BoolCommon) Present ¶
func (n BoolCommon) Present() bool
Present determines whether a value has been set
func (*BoolCommon) Scan ¶
func (n *BoolCommon) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (BoolCommon) Typ ¶
func (n BoolCommon) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*BoolCommon) UnmarshalJSON ¶
func (n *BoolCommon) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (BoolCommon) V ¶
func (n BoolCommon) V() bool
V returns value of underlying type if it was set, otherwise default value
func (BoolCommon) Valid ¶
func (n BoolCommon) Valid() bool
Valid determines whether a value has been valid
type Complex64Accessor ¶
type Complex64Accessor interface { Common V() complex64 Set(value complex64) Clone() Complex64Accessor }
Complex64Accessor accessor of complex64 type.
func Complex64 ¶
func Complex64(from complex128, defaultValue ...complex64) Complex64Accessor
Complex64 convert value from complex128 to complex64. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Complex64 ¶
func Float32Complex64(from float32, defaultValue ...complex64) Complex64Accessor
Float32Complex64 convert value from float32 to complex64. Returns value if type can safely converted, otherwise error & default value in result values
func FloatComplex64 ¶
func FloatComplex64(from float64, defaultValue ...complex64) Complex64Accessor
FloatComplex64 convert value from float64 to complex64. Returns value if type can safely converted, otherwise error & default value in result values
func IntComplex64 ¶
func IntComplex64(from int64, defaultValue ...complex64) Complex64Accessor
IntComplex64 convert value from int64 to complex64. Returns value if type can safely converted, otherwise error & default value in result values
func NComplex64 ¶
func NComplex64(value complex64) Complex64Accessor
NComplex64 returns NullComplex64 under Complex64Accessor from complex64
func NNComplex64 ¶
func NNComplex64(value complex64) Complex64Accessor
NNComplex64 returns NotNullComplex64 under Complex64Accessor from complex64
func StringComplex64 ¶
func StringComplex64(from string, defaultValue ...complex64) Complex64Accessor
StringComplex64 convert value from string to complex64. Returns value if type can safely converted, otherwise error & default value in result values
func UintComplex64 ¶
func UintComplex64(from uint64, defaultValue ...complex64) Complex64Accessor
UintComplex64 convert value from uint64 to complex64. Returns value if type can safely converted, otherwise error & default value in result values
type Complex64Common ¶
Complex64Common represents a complex64 with pointer and error.
func (Complex64Common) MarshalJSON ¶
func (n Complex64Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Complex64Common) Present ¶
func (n Complex64Common) Present() bool
Present determines whether a value has been set
func (*Complex64Common) Scan ¶
func (n *Complex64Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Complex64Common) Set ¶
func (n *Complex64Common) Set(value complex64)
Set saves value into current struct
func (Complex64Common) Typ ¶
func (n Complex64Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Complex64Common) UnmarshalJSON ¶
func (n *Complex64Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Complex64Common) V ¶
func (n Complex64Common) V() complex64
V returns value of underlying type if it was set, otherwise default value
func (Complex64Common) Valid ¶
func (n Complex64Common) Valid() bool
Valid determines whether a value has been valid
type ComplexAccessor ¶
type ComplexAccessor interface { Common V() complex128 Set(value complex128) Clone() ComplexAccessor }
ComplexAccessor accessor of complex128 type.
func IntComplex ¶
func IntComplex(from int64, defaultValue ...complex128) ComplexAccessor
IntComplex convert value from int64 to complex128. Returns value if type can safely converted, otherwise error & default value in result values
func NComplex ¶
func NComplex(value complex128) ComplexAccessor
NComplex returns NullComplex under ComplexAccessor from complex128
func NNComplex ¶
func NNComplex(value complex128) ComplexAccessor
NNComplex returns NotNullComplex under ComplexAccessor from complex128
func StringComplex ¶
func StringComplex(from string, defaultValue ...complex128) ComplexAccessor
StringComplex convert value from string to complex128. Returns value if type can safely converted, otherwise error & default value in result values
func UintComplex ¶
func UintComplex(from uint64, defaultValue ...complex128) ComplexAccessor
UintComplex convert value from uint64 to complex128. Returns value if type can safely converted, otherwise error & default value in result values
type ComplexCommon ¶
type ComplexCommon struct { P *complex128 Error error }
ComplexCommon represents a complex128 with pointer and error.
func (ComplexCommon) MarshalJSON ¶
func (n ComplexCommon) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (ComplexCommon) Present ¶
func (n ComplexCommon) Present() bool
Present determines whether a value has been set
func (*ComplexCommon) Scan ¶
func (n *ComplexCommon) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*ComplexCommon) Set ¶
func (n *ComplexCommon) Set(value complex128)
Set saves value into current struct
func (ComplexCommon) Typ ¶
func (n ComplexCommon) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*ComplexCommon) UnmarshalJSON ¶
func (n *ComplexCommon) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (ComplexCommon) V ¶
func (n ComplexCommon) V() complex128
V returns value of underlying type if it was set, otherwise default value
func (ComplexCommon) Valid ¶
func (n ComplexCommon) Valid() bool
Valid determines whether a value has been valid
type ComplexStringOption ¶
type ComplexStringOption func(*complexStrOpts) error
ComplexStringOption is interface function used as argument value for type conversion configuration from complex to string
func ComplexStringDefault ¶
func ComplexStringDefault(value string) ComplexStringOption
ComplexStringDefault set default string value for complex conversion to string.
type ErrorConvert ¶
type ErrorConvert error
ErrorConvert is returned when value can't safely convert
type ErrorInvalidArgument ¶
type ErrorInvalidArgument error
ErrorInvalidArgument is returned when invalid argument is present
type ErrorOutOfBounds ¶
type ErrorOutOfBounds error
ErrorOutOfBounds is returned when value out of bounds on given data
type ErrorOutOfRange ¶
type ErrorOutOfRange error
ErrorOutOfRange is returned when value out of range on given data
type ErrorUnexpectedValue ¶
type ErrorUnexpectedValue error
ErrorUnexpectedValue is returned when unexpected value given on data
type Float32Accessor ¶
type Float32Accessor interface { Common V() float32 Set(value float32) Clone() Float32Accessor }
Float32Accessor accessor of float32 type.
func Complex64Float32 ¶
func Complex64Float32(from complex64, defaultValue ...float32) Float32Accessor
Complex64Float32 convert value from complex64 to float32. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexFloat32 ¶
func ComplexFloat32(from complex128, defaultValue ...float32) Float32Accessor
ComplexFloat32 convert value from complex128 to float32. Returns value if type can safely converted, otherwise error & default value in result values
func Float32 ¶
func Float32(from float64, defaultValue ...float32) Float32Accessor
Float32 convert value from float64 to float32. Returns value if type can safely converted, otherwise error & default value in result values
func IntFloat32 ¶
func IntFloat32(from int64, defaultValue ...float32) Float32Accessor
IntFloat32 convert value from int to float32. Returns value if type can safely converted, otherwise error & default value in result values
func NFloat32 ¶
func NFloat32(value float32) Float32Accessor
NFloat32 returns NullFloat32 under from float32
func NNFloat32 ¶
func NNFloat32(value float32) Float32Accessor
NNFloat32 returns NullFloat32 under Float32Accessor from float32
func StringFloat32 ¶
func StringFloat32(from string, defaultValue ...float32) Float32Accessor
StringFloat32 convert value from string to float32. Returns value if type can safely converted, otherwise error & default value in result values
func UintFloat32 ¶
func UintFloat32(from uint64, defaultValue ...float32) Float32Accessor
UintFloat32 convert value from uint to float32. Returns value if type can safely converted, otherwise error & default value in result values
type Float32Common ¶
Float32Common represents a float32 that may be null.
func (Float32Common) MarshalJSON ¶
func (n Float32Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Float32Common) Present ¶
func (n Float32Common) Present() bool
Present determines whether a value has been set
func (*Float32Common) Scan ¶
func (n *Float32Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Float32Common) Set ¶
func (n *Float32Common) Set(value float32)
Set saves value into current struct
func (Float32Common) Typ ¶
func (n Float32Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Float32Common) UnmarshalJSON ¶
func (n *Float32Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Float32Common) V ¶
func (n Float32Common) V() float32
V returns value of underlying type if it was set, otherwise default value
func (Float32Common) Valid ¶
func (n Float32Common) Valid() bool
Valid determines whether a value has been valid
type FloatAccessor ¶
type FloatAccessor interface { Common V() float64 Set(value float64) Clone() FloatAccessor }
FloatAccessor accessor of float64 type.
func Complex64Float64 ¶
func Complex64Float64(from complex64, defaultValue ...float64) FloatAccessor
Complex64Float64 convert value from complex64 to float64. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexFloat64 ¶
func ComplexFloat64(from complex128, defaultValue ...float64) FloatAccessor
ComplexFloat64 convert value from complex128 to float64. Returns value if type can safely converted, otherwise error & default value in result values
func IntFloat ¶
func IntFloat(from int64, defaultValue ...float64) FloatAccessor
IntFloat convert value from int to float64. Returns value if type can safely converted, otherwise error & default value in result values
func NFloat ¶
func NFloat(value float64) FloatAccessor
NFloat returns NullFloat under FloatAccessor from float64
func NNFloat ¶
func NNFloat(value float64) FloatAccessor
NNFloat returns NullFloat under FloatAccessor from float64
func StringFloat ¶
func StringFloat(from string, defaultValue ...float64) FloatAccessor
StringFloat convert value from string to float64. Returns value if type can safely converted, otherwise error & default value in result values
func UintFloat ¶
func UintFloat(from uint64, defaultValue ...float64) FloatAccessor
UintFloat convert value from uint to float64. Returns value if type can safely converted, otherwise error & default value in result values
type FloatCommon ¶
FloatCommon represents a float64 that may be null.
func (FloatCommon) MarshalJSON ¶
func (n FloatCommon) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (FloatCommon) Present ¶
func (n FloatCommon) Present() bool
Present determines whether a value has been set
func (*FloatCommon) Scan ¶
func (n *FloatCommon) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*FloatCommon) Set ¶
func (n *FloatCommon) Set(value float64)
Set saves value into current struct
func (FloatCommon) Typ ¶
func (n FloatCommon) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*FloatCommon) UnmarshalJSON ¶
func (n *FloatCommon) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (FloatCommon) V ¶
func (n FloatCommon) V() float64
V returns value of underlying type if it was set, otherwise default value
func (FloatCommon) Valid ¶
func (n FloatCommon) Valid() bool
Valid determines whether a value has been valid
type FloatStringOption ¶
type FloatStringOption func(*floatStrOpts) error
FloatStringOption is interface function used as argument value for type conversion configuration from float to string
func FloatStringBitSize ¶
func FloatStringBitSize(value int) FloatStringOption
FloatStringBitSize set bit size for float conversion to string. The bitSize must be 32 or 64
func FloatStringDefault ¶
func FloatStringDefault(value string) FloatStringOption
FloatStringDefault set default string value for float conversion to string.
func FloatStringFmtByte ¶
func FloatStringFmtByte(value byte) FloatStringOption
FloatStringFmtByte set format for float conversion to string. The precision prec controls the number of digits (excluding the exponent) printed by the 'e', 'E', 'f', 'g', and 'G' formats. For 'e', 'E', and 'f' it is the number of digits after the decimal point. For 'g' and 'G' it is the maximum number of significant digits (trailing zeros are removed). The special precision -1 uses the smallest number of digits necessary such that ParseFloat will return f exactly.
func FloatStringPrecision ¶
func FloatStringPrecision(value int) FloatStringOption
FloatStringPrecision set precision for float conversion to string. The precision prec controls the number of digits (excluding the exponent) printed by the 'e', 'E', 'f', 'g', and 'G' formats. For 'e', 'E', and 'f' it is the number of digits after the decimal point. For 'g' and 'G' it is the maximum number of significant digits (trailing zeros are removed). The special precision -1 uses the smallest number of digits necessary such that ParseFloat will return f exactly.
type Int16Accessor ¶
type Int16Accessor interface { Common V() int16 Set(value int16) Clone() Int16Accessor }
Int16Accessor accessor of int16 type.
func Complex64Int16 ¶
func Complex64Int16(from complex64, defaultValue ...int16) Int16Accessor
Complex64Int16 convert value from complex64 to int16. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexInt16 ¶
func ComplexInt16(from complex128, defaultValue ...int16) Int16Accessor
ComplexInt16 convert value from complex128 to int16. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Int16 ¶
func Float32Int16(from float32, defaultValue ...int16) Int16Accessor
Float32Int16 convert value from float32 to int16. Returns value if type can safely converted, otherwise error & default value in result values
func FloatInt16 ¶
func FloatInt16(from float64, defaultValue ...int16) Int16Accessor
FloatInt16 convert value from float64 to int16. Returns value if type can safely converted, otherwise error & default value in result values
func Int16 ¶
func Int16(from int64, defaultValue ...int16) Int16Accessor
Int16 convert value from int64 to int16. Returns value if type can safely converted, otherwise error & default value in result values
func NInt16 ¶
func NInt16(value int16) Int16Accessor
NInt16 returns NullInt16 under Int16Accessor from int16
func NNInt16 ¶
func NNInt16(value int16) Int16Accessor
NNInt16 returns NotNullInt16 under Int16Accessor from int16
func StringInt16 ¶
func StringInt16(from string, defaultValue ...int16) Int16Accessor
StringInt16 convert value from string to int16. Returns value if type can safely converted, otherwise error & default value in result values
func UintInt16 ¶
func UintInt16(from uint64, defaultValue ...int16) Int16Accessor
UintInt16 convert value from uint64 to int16. Returns value if type can safely converted, otherwise error & default value in result values
type Int16Common ¶
Int16Common represents an int16 with pointer and error.
func (Int16Common) MarshalJSON ¶
func (n Int16Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Int16Common) Present ¶
func (n Int16Common) Present() bool
Present determines whether a value has been set
func (*Int16Common) Scan ¶
func (n *Int16Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Int16Common) Set ¶
func (n *Int16Common) Set(value int16)
Set saves value into current struct
func (Int16Common) Typ ¶
func (n Int16Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Int16Common) UnmarshalJSON ¶
func (n *Int16Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Int16Common) V ¶
func (n Int16Common) V() int16
V returns value of underlying type if it was set, otherwise default value
func (Int16Common) Valid ¶
func (n Int16Common) Valid() bool
Valid determines whether a value has been valid
type Int32Accessor ¶
type Int32Accessor interface { Common V() int32 Set(value int32) Clone() Int32Accessor }
Int32Accessor accessor of int32 type.
func Complex64Int32 ¶
func Complex64Int32(from complex64, defaultValue ...int32) Int32Accessor
Complex64Int32 convert value from complex64 to int32. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexInt32 ¶
func ComplexInt32(from complex128, defaultValue ...int32) Int32Accessor
ComplexInt32 convert value from complex128 to int32. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Int32 ¶
func Float32Int32(from float32, defaultValue ...int32) Int32Accessor
Float32Int32 convert value from float32 to int32. Returns value if type can safely converted, otherwise error & default value in result values
func FloatInt32 ¶
func FloatInt32(from float64, defaultValue ...int32) Int32Accessor
FloatInt32 convert value from float64 to int32. Returns value if type can safely converted, otherwise error & default value in result values
func Int32 ¶
func Int32(from int64, defaultValue ...int32) Int32Accessor
Int32 convert value from int64 to int32. Returns value if type can safely converted, otherwise error & default value in result values
func NInt32 ¶
func NInt32(value int32) Int32Accessor
NInt32 returns NullInt32 under Int32Accessor from int32
func NNInt32 ¶
func NNInt32(value int32) Int32Accessor
NNInt32 returns NotNullInt32 under Int32Accessor from int32
func StringInt32 ¶
func StringInt32(from string, defaultValue ...int32) Int32Accessor
StringInt32 convert value from string to int32. Returns value if type can safely converted, otherwise error & default value in result values
func UintInt32 ¶
func UintInt32(from uint64, defaultValue ...int32) Int32Accessor
UintInt32 convert value from uint64 to int32. Returns value if type can safely converted, otherwise error & default value in result values
type Int32Common ¶
Int32Common represents an int32 with pointer and error.
func (Int32Common) MarshalJSON ¶
func (n Int32Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Int32Common) Present ¶
func (n Int32Common) Present() bool
Present determines whether a value has been set
func (*Int32Common) Scan ¶
func (n *Int32Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Int32Common) Set ¶
func (n *Int32Common) Set(value int32)
Set saves value into current struct
func (Int32Common) Typ ¶
func (n Int32Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Int32Common) UnmarshalJSON ¶
func (n *Int32Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Int32Common) V ¶
func (n Int32Common) V() int32
V returns value of underlying type if it was set, otherwise default value
func (Int32Common) Valid ¶
func (n Int32Common) Valid() bool
Valid determines whether a value has been valid
type Int64Accessor ¶
type Int64Accessor interface { Common V() int64 Set(value int64) Clone() Int64Accessor }
Int64Accessor accessor of int64 type.
func Complex64Int64 ¶
func Complex64Int64(from complex64, defaultValue ...int64) Int64Accessor
Complex64Int64 convert value from complex64 to int64. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexInt64 ¶
func ComplexInt64(from complex128, defaultValue ...int64) Int64Accessor
ComplexInt64 convert value from complex128 to int64. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Int64 ¶
func Float32Int64(from float32, defaultValue ...int64) Int64Accessor
Float32Int64 convert value from float32 to int64. Returns value if type can safely converted, otherwise error & default value in result values
func FloatInt64 ¶
func FloatInt64(from float64, defaultValue ...int64) Int64Accessor
FloatInt64 convert value from float64 to int64. Returns value if type can safely converted, otherwise error & default value in result values
func NInt64 ¶
func NInt64(value int64) Int64Accessor
NInt64 returns NullInt64 under Int64Accessor from int64
func NNInt64 ¶
func NNInt64(value int64) Int64Accessor
NNInt64 returns NotNullInt64 under from int64
func StringInt64 ¶
func StringInt64(from string, defaultValue ...int64) Int64Accessor
StringInt64 convert value from string to int64. Returns value if type can safely converted, otherwise error & default value in result values
func UintInt64 ¶
func UintInt64(from uint64, defaultValue ...int64) Int64Accessor
UintInt64 convert value from uint64 to int64. Returns value if type can safely converted, otherwise error & default value in result values
type Int64Common ¶
Int64Common represents an int64 with pointer and error.
func (Int64Common) MarshalJSON ¶
func (n Int64Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Int64Common) Present ¶
func (n Int64Common) Present() bool
Present determines whether a value has been set
func (*Int64Common) Scan ¶
func (n *Int64Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Int64Common) Set ¶
func (n *Int64Common) Set(value int64)
Set saves value into current struct
func (Int64Common) Typ ¶
func (n Int64Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Int64Common) UnmarshalJSON ¶
func (n *Int64Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Int64Common) V ¶
func (n Int64Common) V() int64
V returns value of underlying type if it was set, otherwise default value
func (Int64Common) Valid ¶
func (n Int64Common) Valid() bool
Valid determines whether a value has been valid
type Int8Accessor ¶
type Int8Accessor interface { Common V() int8 Set(value int8) Clone() Int8Accessor }
Int8Accessor accessor of int8 type.
func Complex64Int8 ¶
func Complex64Int8(from complex64, defaultValue ...int8) Int8Accessor
Complex64Int8 convert value from complex64 to int8. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexInt8 ¶
func ComplexInt8(from complex128, defaultValue ...int8) Int8Accessor
ComplexInt8 convert value from complex128 to int8. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Int8 ¶
func Float32Int8(from float32, defaultValue ...int8) Int8Accessor
Float32Int8 convert value from float32 to int8. Returns value if type can safely converted, otherwise error & default value in result values
func FloatInt8 ¶
func FloatInt8(from float64, defaultValue ...int8) Int8Accessor
FloatInt8 convert value from float64 to int8. Returns value if type can safely converted, otherwise error & default value in result values
func Int8 ¶
func Int8(from int64, defaultValue ...int8) Int8Accessor
Int8 convert value from int64 to int8. Returns value if type can safely converted, otherwise error & default value in result values
func NInt8 ¶
func NInt8(value int8) Int8Accessor
NInt8 returns NullInt8 under Int8Accessor from int8
func NNInt8 ¶
func NNInt8(value int8) Int8Accessor
NNInt8 returns NotNullInt8 under Int8Accessor from int8
func StringInt8 ¶
func StringInt8(from string, defaultValue ...int8) Int8Accessor
StringInt8 convert value from string to int8. Returns value if type can safely converted, otherwise error & default value in result values
func UintInt8 ¶
func UintInt8(from uint64, defaultValue ...int8) Int8Accessor
UintInt8 convert value from uint64 to int8. Returns value if type can safely converted, otherwise error & default value in result values
type Int8Common ¶
Int8Common represents an int8 with pointer and error.
func (Int8Common) MarshalJSON ¶
func (n Int8Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Int8Common) Present ¶
func (n Int8Common) Present() bool
Present determines whether a value has been set
func (*Int8Common) Scan ¶
func (n *Int8Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (Int8Common) Typ ¶
func (n Int8Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Int8Common) UnmarshalJSON ¶
func (n *Int8Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Int8Common) V ¶
func (n Int8Common) V() int8
V returns value of underlying type if it was set, otherwise default value
func (Int8Common) Valid ¶
func (n Int8Common) Valid() bool
Valid determines whether a value has been valid
type IntAccessor ¶
type IntAccessor interface { Common V() int Set(value int) Clone() IntAccessor }
IntAccessor accessor of int type.
func Complex64Int ¶
func Complex64Int(from complex64, defaultValue ...int) IntAccessor
Complex64Int convert value from complex64 to int. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexInt ¶
func ComplexInt(from complex128, defaultValue ...int) IntAccessor
ComplexInt convert value from complex128 to int. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Int ¶
func Float32Int(from float32, defaultValue ...int) IntAccessor
Float32Int convert value from float32 to int. Returns value if type can safely converted, otherwise error & default value in result values
func FloatInt ¶
func FloatInt(from float64, defaultValue ...int) IntAccessor
FloatInt convert value from float64 to int. Returns value if type can safely converted, otherwise error & default value in result values
func StringInt ¶
func StringInt(from string, defaultValue ...int) IntAccessor
StringInt convert value from string to int. Returns value if type can safely converted, otherwise error & default value in result values
type IntCommon ¶
IntCommon represents an int with pointer and error.
func (IntCommon) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
func (IntCommon) Typ ¶
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*IntCommon) UnmarshalJSON ¶
UnmarshalJSON implements the json Unmarshaler interface.
type IntStringOption ¶
type IntStringOption func(*intStrOpts) error
IntStringOption is interface function used as argument value for type conversion configuration from int to string
func IntStringBase ¶
func IntStringBase(value int) IntStringOption
IntStringBase set base for int conversion to string. The base must be 2 <= base <= 36 for digit values >= 10.
func IntStringDefault ¶
func IntStringDefault(value string) IntStringOption
IntStringDefault set default string value for int conversion to string.
type InterfaceAccessor ¶
type InterfaceAccessor interface { Common V() interface{} Set(value interface{}) Clone() InterfaceAccessor }
InterfaceAccessor accessor of interface{} type.
func NInterface ¶
func NInterface(value interface{}) InterfaceAccessor
NInterface returns NullInterface under InterfaceAccessor from interface{}
func NNInterface ¶
func NNInterface(value interface{}) InterfaceAccessor
NNInterface returns NotNullInterface under InterfaceAccessor from interface{}
type InterfaceCommon ¶
type InterfaceCommon struct { P interface{} Error error }
InterfaceCommon represents an interface{} that may be null.
func (InterfaceCommon) MarshalJSON ¶
func (n InterfaceCommon) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (InterfaceCommon) Present ¶
func (n InterfaceCommon) Present() bool
Present determines whether a value has been set
func (*InterfaceCommon) Scan ¶
func (n *InterfaceCommon) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*InterfaceCommon) Set ¶
func (n *InterfaceCommon) Set(value interface{})
Set saves value into current struct
func (InterfaceCommon) Typ ¶
func (n InterfaceCommon) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*InterfaceCommon) UnmarshalJSON ¶
func (n *InterfaceCommon) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (InterfaceCommon) V ¶
func (n InterfaceCommon) V() interface{}
V returns value of underlying type if it was set, otherwise default value
func (InterfaceCommon) Valid ¶
func (n InterfaceCommon) Valid() bool
Valid determines whether a value has been valid
type NotNullBool ¶
type NotNullBool struct {
BoolCommon
}
NotNullBool represents a bool with accessor.
func (NotNullBool) Clone ¶
func (n NotNullBool) Clone() BoolAccessor
Clone returns new instance of NullBool with preserved value & error
type NotNullComplex ¶
type NotNullComplex struct {
ComplexCommon
}
NotNullComplex represents a complex128 that may be null.
func (NotNullComplex) Clone ¶
func (n NotNullComplex) Clone() ComplexAccessor
Clone returns new instance of NotNullComplex with preserved value & error
type NotNullComplex64 ¶
type NotNullComplex64 struct {
Complex64Common
}
NotNullComplex64 represents a complex64 that may be null.
func (NotNullComplex64) Clone ¶
func (n NotNullComplex64) Clone() Complex64Accessor
Clone returns new instance of NotNullComplex64 with preserved value & error
type NotNullFloat ¶
type NotNullFloat struct {
FloatCommon
}
NotNullFloat represents a float64 that may be null.
func (NotNullFloat) Clone ¶
func (n NotNullFloat) Clone() FloatAccessor
Clone returns new instance of NotNullFloat with preserved value & error
type NotNullFloat32 ¶
type NotNullFloat32 struct {
Float32Common
}
NotNullFloat32 represents a float32 that may be null.
func (NotNullFloat32) Clone ¶
func (n NotNullFloat32) Clone() Float32Accessor
Clone returns new instance of NotNullFloat32 with preserved value & error
type NotNullInt ¶
type NotNullInt struct {
IntCommon
}
NotNullInt represents an int with accessor.
func (NotNullInt) Clone ¶
func (n NotNullInt) Clone() IntAccessor
Clone returns new instance of NotNullInt with preserved value & error
type NotNullInt16 ¶
type NotNullInt16 struct {
Int16Common
}
NotNullInt16 represents an int16 with accessor.
func (NotNullInt16) Clone ¶
func (n NotNullInt16) Clone() Int16Accessor
Clone returns new instance of NotNullInt16 with preserved value & error
type NotNullInt32 ¶
type NotNullInt32 struct {
Int32Common
}
NotNullInt32 represents an int32 with accessor.
func (NotNullInt32) Clone ¶
func (n NotNullInt32) Clone() Int32Accessor
Clone returns new instance of NotNullInt32 with preserved value & error
type NotNullInt64 ¶
type NotNullInt64 struct {
Int64Common
}
NotNullInt64 represents an int64 with accessor.
func (NotNullInt64) Clone ¶
func (n NotNullInt64) Clone() Int64Accessor
Clone returns new instance of NotNullInt64 with preserved value & error
type NotNullInt8 ¶
type NotNullInt8 struct {
Int8Common
}
NotNullInt8 represents an int8 with accessor.
func (NotNullInt8) Clone ¶
func (n NotNullInt8) Clone() Int8Accessor
Clone returns new instance of NotNullInt8 with preserved value & error
type NotNullInterface ¶
type NotNullInterface struct {
InterfaceCommon
}
NotNullInterface represents an interface{} that may be null.
func (NotNullInterface) Clone ¶
func (n NotNullInterface) Clone() InterfaceAccessor
Clone returns new instance of NotNullInterface with preserved value & error
type NotNullString ¶
type NotNullString struct {
StringCommon
}
NotNullString represents a string that may be null.
func (NotNullString) Clone ¶
func (n NotNullString) Clone() StringAccessor
Clone returns new instance of NotNullString with preserved value & error
type NotNullTime ¶
type NotNullTime struct {
TimeCommon
}
NotNullTime represents a time.Time that may be null.
func (NotNullTime) Clone ¶
func (n NotNullTime) Clone() TimeAccessor
Clone returns new instance of NotNullTime with preserved value & error
type NotNullUint ¶
type NotNullUint struct {
UintCommon
}
NotNullUint represents an uint with accessor.
func (NotNullUint) Clone ¶
func (n NotNullUint) Clone() UintAccessor
Clone returns new instance of NotNullUint with preserved value & error
type NotNullUint16 ¶
type NotNullUint16 struct {
Uint16Common
}
NotNullUint16 represents an uint16 with accessor.
func (NotNullUint16) Clone ¶
func (n NotNullUint16) Clone() Uint16Accessor
Clone returns new instance of NotNullUint16 with preserved value & error
type NotNullUint32 ¶
type NotNullUint32 struct {
Uint32Common
}
NotNullUint32 represents an uint32 with accessor.
func (NotNullUint32) Clone ¶
func (n NotNullUint32) Clone() Uint32Accessor
Clone returns new instance of NotNullUint32 with preserved value & error
type NotNullUint64 ¶
type NotNullUint64 struct {
Uint64Common
}
NotNullUint64 represents an uint64 with accessor.
func (NotNullUint64) Clone ¶
func (n NotNullUint64) Clone() Uint64Accessor
Clone returns new instance of NotNullUint64 with preserved value & error
type NotNullUint8 ¶
type NotNullUint8 struct {
Uint8Common
}
NotNullUint8 represents an uint8 with accessor.
func (NotNullUint8) Clone ¶
func (n NotNullUint8) Clone() Uint8Accessor
Clone returns new instance of NotNullUint8 with preserved value & error
type NullBool ¶
type NullBool struct {
BoolCommon
}
NullBool represents a bool that may be null.
func (NullBool) Clone ¶
func (n NullBool) Clone() BoolAccessor
Clone returns new instance of NullBool with preserved value & error
func (NullBool) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullComplex ¶
type NullComplex struct {
ComplexCommon
}
NullComplex represents a complex128 that may be null.
func (NullComplex) Clone ¶
func (n NullComplex) Clone() ComplexAccessor
Clone returns new instance of NullComplex with preserved value & error
func (NullComplex) MarshalJSON ¶
func (n NullComplex) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullComplex64 ¶
type NullComplex64 struct {
Complex64Common
}
NullComplex64 represents a complex64 that may be null.
func (NullComplex64) Clone ¶
func (n NullComplex64) Clone() Complex64Accessor
Clone returns new instance of NullComplex64 with preserved value & error
func (NullComplex64) MarshalJSON ¶
func (n NullComplex64) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullFloat ¶
type NullFloat struct {
FloatCommon
}
NullFloat represents a float64 that may be null.
func (NullFloat) Clone ¶
func (n NullFloat) Clone() FloatAccessor
Clone returns new instance of NullFloat with preserved value & error
func (NullFloat) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullFloat32 ¶
type NullFloat32 struct {
Float32Common
}
NullFloat32 represents a float32 that may be null.
func (NullFloat32) Clone ¶
func (n NullFloat32) Clone() Float32Accessor
Clone returns new instance of NullFloat32 with preserved value & error
func (NullFloat32) MarshalJSON ¶
func (n NullFloat32) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullInt ¶
type NullInt struct {
IntCommon
}
NullInt represents an int that may be null.
func (NullInt) Clone ¶
func (n NullInt) Clone() IntAccessor
Clone returns new instance of NullInt with preserved value & error
func (NullInt) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullInt16 ¶
type NullInt16 struct {
Int16Common
}
NullInt16 represents an int16 that may be null.
func (NullInt16) Clone ¶
func (n NullInt16) Clone() Int16Accessor
Clone returns new instance of NullInt16 with preserved value & error
func (NullInt16) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullInt32 ¶
type NullInt32 struct {
Int32Common
}
NullInt32 represents an int32 that may be null.
func (NullInt32) Clone ¶
func (n NullInt32) Clone() Int32Accessor
Clone returns new instance of NullInt32 with preserved value & error
func (NullInt32) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullInt64 ¶
type NullInt64 struct {
Int64Common
}
NullInt64 represents an int64 that may be null.
func (NullInt64) Clone ¶
func (n NullInt64) Clone() Int64Accessor
Clone returns new instance of NullInt64 with preserved value & error
func (NullInt64) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullInt8 ¶
type NullInt8 struct {
Int8Common
}
NullInt8 represents an int8 that may be null.
func (NullInt8) Clone ¶
func (n NullInt8) Clone() Int8Accessor
Clone returns new instance of NullInt8 with preserved value & error
func (NullInt8) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullInterface ¶
type NullInterface struct {
InterfaceCommon
}
NullInterface represents an interface{} that may be null.
func (NullInterface) Clone ¶
func (n NullInterface) Clone() InterfaceAccessor
Clone returns new instance of NullInterface with preserved value & error
func (NullInterface) MarshalJSON ¶
func (n NullInterface) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullString ¶
type NullString struct {
StringCommon
}
NullString represents a string that may be null.
func (NullString) Clone ¶
func (n NullString) Clone() StringAccessor
Clone returns new instance of NullString with preserved value & error
func (NullString) MarshalJSON ¶
func (n NullString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullTime ¶
type NullTime struct {
TimeCommon
}
NullTime represents a time.Time that may be null.
func (NullTime) Clone ¶
func (n NullTime) Clone() TimeAccessor
Clone returns new instance of NullTime with preserved value & error
func (NullTime) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullUint ¶
type NullUint struct {
UintCommon
}
NullUint represents an uint that may be null.
func (NullUint) Clone ¶
func (n NullUint) Clone() UintAccessor
Clone returns new instance of NullUint with preserved value & error
func (NullUint) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type NullUint16 ¶
type NullUint16 struct {
Uint16Common
}
NullUint16 represents an uint16 that may be null.
func (NullUint16) Clone ¶
func (n NullUint16) Clone() Uint16Accessor
Clone returns new instance of NullUint16 with preserved value & error
func (NullUint16) MarshalJSON ¶
func (n NullUint16) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullUint32 ¶
type NullUint32 struct {
Uint32Common
}
NullUint32 represents an uint32 that may be null.
func (NullUint32) Clone ¶
func (n NullUint32) Clone() Uint32Accessor
Clone returns new instance of NullUint32 with preserved value & error
func (NullUint32) MarshalJSON ¶
func (n NullUint32) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullUint64 ¶
type NullUint64 struct {
Uint64Common
}
NullUint64 represents an uint64 that may be null.
func (NullUint64) Clone ¶
func (n NullUint64) Clone() Uint64Accessor
Clone returns new instance of NullUint64 with preserved value & error
func (NullUint64) MarshalJSON ¶
func (n NullUint64) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
type NullUint8 ¶
type NullUint8 struct {
Uint8Common
}
NullUint8 represents an uint8 that may be null.
func (NullUint8) Clone ¶
func (n NullUint8) Clone() Uint8Accessor
Clone returns new instance of NullUint8 with preserved value & error
func (NullUint8) MarshalJSON ¶
MarshalJSON implements the json Marshaler interface.
type Option ¶
type Option func(*opts) error
Option is interface function used as argument value for type conversion configuration
func Base ¶
Base set base for int conversion. The base must be 2 <= base <= 36 for digit values >= 10.
func FmtByte ¶
FmtByte set format for float conversion. The format fmt is one of 'b' (-ddddp±ddd, a binary exponent), 'e' (-d.dddde±dd, a decimal exponent), 'E' (-d.ddddE±dd, a decimal exponent), 'f' (-ddd.dddd, no exponent), 'g' ('e' for large exponents, 'f' otherwise), or 'G' ('E' for large exponents, 'f' otherwise).
func Precision ¶
Precision set precision for float conversion. The precision prec controls the number of digits (excluding the exponent) printed by the 'e', 'E', 'f', 'g', and 'G' formats. For 'e', 'E', and 'f' it is the number of digits after the decimal point. For 'g' and 'G' it is the maximum number of significant digits (trailing zeros are removed). The special precision -1 uses the smallest number of digits necessary such that ParseFloat will return f exactly.
type StringAccessor ¶
type StringAccessor interface { Common V() string Set(value string) Clone() StringAccessor }
StringAccessor accessor of string type.
func BoolString ¶
func BoolString(from bool) StringAccessor
BoolString convert value from bool to string
func ComplexString ¶
func ComplexString(from complex128, options ...ComplexStringOption) StringAccessor
ComplexString convert value from complex128 to string
func Concat ¶
func Concat(values []interface{}, options ...Option) StringAccessor
Concat returns concatenated interface values to string
func FloatString ¶
func FloatString(from float64, options ...FloatStringOption) StringAccessor
FloatString convert value from float to string
func IntString ¶
func IntString(from int64, options ...IntStringOption) StringAccessor
IntString convert value from int64 to string
func NNString ¶
func NNString(value string) StringAccessor
NNString returns NullString under StringAccessor from string
func NString ¶
func NString(value string) StringAccessor
NString returns NullString under StringAccessor from string
func UintString ¶
func UintString(from uint64, options ...UintStringOption) StringAccessor
UintString convert value from uint64 to string
type StringCommon ¶
StringCommon represents a string that may be null.
func (StringCommon) MarshalJSON ¶
func (n StringCommon) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (StringCommon) Present ¶
func (n StringCommon) Present() bool
Present determines whether a value has been set
func (*StringCommon) Scan ¶
func (n *StringCommon) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*StringCommon) Set ¶
func (n *StringCommon) Set(value string)
Set saves value into current struct
func (StringCommon) Typ ¶
func (n StringCommon) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*StringCommon) UnmarshalJSON ¶
func (n *StringCommon) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (StringCommon) V ¶
func (n StringCommon) V() string
V returns value of underlying type if it was set, otherwise default value
func (StringCommon) Valid ¶
func (n StringCommon) Valid() bool
Valid determines whether a value has been valid
type TimeAccessor ¶
TimeAccessor accessor of time.Time type.
func NNTime ¶
func NNTime(value time.Time) TimeAccessor
NNTime returns NullTime under TimeAccessor from time.Time
func NTime ¶
func NTime(value time.Time) TimeAccessor
NTime returns NullTime under TimeAccessor from time.Time
type TimeCommon ¶
TimeCommon represents a time.Time that may be null.
func (TimeCommon) MarshalJSON ¶
func (n TimeCommon) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (TimeCommon) Present ¶
func (n TimeCommon) Present() bool
Present determines whether a value has been set
func (*TimeCommon) Scan ¶
func (n *TimeCommon) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*TimeCommon) Set ¶
func (n *TimeCommon) Set(value time.Time)
Set saves value into current struct
func (TimeCommon) Typ ¶
func (n TimeCommon) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*TimeCommon) UnmarshalJSON ¶
func (n *TimeCommon) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (TimeCommon) V ¶
func (n TimeCommon) V() time.Time
V returns value of underlying type if it was set, otherwise default value
func (TimeCommon) Valid ¶
func (n TimeCommon) Valid() bool
Valid determines whether a value has been valid
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type stores all information about underlying value.
func NewType ¶
NewType create a Type instance with value. This function recursive dereference value by a reference if value is a pointer
func Of ¶
Of create type converter from interface value. This function recursive dereference value by a reference if value is a pointer
func (*Type) Bool ¶
func (t *Type) Bool() BoolAccessor
Bool convert interface value to bool. Returns true for any non-zero values
func (*Type) BoolHumanize ¶
func (t *Type) BoolHumanize() BoolAccessor
BoolHumanize convert interface value to bool. Returns false for string 'false' in case-insensitive mode or string equals '0', for other types returns true only for positive values
func (*Type) BoolPositive ¶
func (t *Type) BoolPositive() BoolAccessor
BoolPositive convert interface value to bool. Returns true only for positive values
func (*Type) Complex ¶
func (t *Type) Complex(defaultValue ...complex128) ComplexAccessor
Complex convert interface value to complex128 Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Complex64 ¶
func (t *Type) Complex64(defaultValue ...complex64) Complex64Accessor
Complex64 convert interface value to complex64. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Equals ¶
func (t *Type) Equals(value interface{}) BoolAccessor
Equals determine whether a variable is equals with current "value" (same value, but can have different primitives types) Primitives type is: int, uint, float, complex, bool
func (*Type) Float ¶
func (t *Type) Float(defaultValue ...float64) FloatAccessor
Float convert interface value to float64. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Float32 ¶
func (t *Type) Float32(defaultValue ...float32) Float32Accessor
Float32 convert interface value to float32. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Identical ¶
func (t *Type) Identical(src interface{}) BoolAccessor
Identical determine whether a variable is identical with current "value" (same type and same value)
func (*Type) Int ¶
func (t *Type) Int(defaultValue ...int) IntAccessor
Int convert interface value to int. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Int16 ¶
func (t *Type) Int16(defaultValue ...int16) Int16Accessor
Int16 convert interface value to int16. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Int32 ¶
func (t *Type) Int32(defaultValue ...int32) Int32Accessor
Int32 convert interface value to int32. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Int64 ¶
func (t *Type) Int64(defaultValue ...int64) Int64Accessor
Int64 convert interface value to int64. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Int8 ¶
func (t *Type) Int8(defaultValue ...int8) Int8Accessor
Int8 convert interface value to int8. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Interface ¶
func (t *Type) Interface() InterfaceAccessor
Interface returns value as interface. Returns nil if value can't safely represents as interface
func (*Type) IsBool ¶
IsBool determine whether a value is boolean type If indirect argument specified, real reflect type returned
func (*Type) IsComplex ¶
IsComplex determine whether a value is complex type If indirect argument specified, real reflect type returned
func (*Type) IsComplex128 ¶
IsComplex128 determine whether a value is complex128 type If indirect argument specified, real reflect type returned
func (*Type) IsComplex64 ¶
IsComplex64 determine whether a value is complex64 type If indirect argument specified, real reflect type returned
func (*Type) IsComposite ¶
IsComposite determine whether a value is composite type (array, slice, map) If indirect argument specified, real reflect type returned
func (*Type) IsFloat ¶
IsFloat determine whether a value is float type If indirect argument specified, real reflect type returned
func (*Type) IsFloat32 ¶
IsFloat32 determine whether a value is float32 type If indirect argument specified, real reflect type returned
func (*Type) IsFloat64 ¶
IsFloat64 determine whether a value is float64 type If indirect argument specified, real reflect type returned
func (*Type) IsInt ¶
IsInt determine whether a value is signed integer type If indirect argument specified, real reflect type returned
func (*Type) IsNumeric ¶
IsNumeric determine whether a value is numeric type (int, uint, float, complex) If indirect argument specified, real reflect type returned
func (*Type) IsPointer ¶
IsPointer determine whether a value is pointer type (Ptr, UnsafePointer, Uintptr) If indirect argument specified, real reflect type returned
func (*Type) IsPrimitives ¶
IsPrimitives determine whether a value is primitives type (int, uint, float, complex, bool) If indirect argument specified, real reflect type returned
func (*Type) IsString ¶
IsString determine whether a value is string type If indirect argument specified, real reflect type returned
func (*Type) IsUint ¶
IsUint determine whether a value is unsigned integer type If indirect argument specified, real reflect type returned
func (*Type) Kind ¶
Kind returns reflect type If indirect argument specified, real reflect type returned
func (*Type) OptionBase ¶
OptionBase returns the base for numeric conversion to string
func (*Type) OptionFmtByte ¶
OptionFmtByte returns float format option for float conversion to string
func (*Type) OptionPrecision ¶
OptionPrecision returns float precision for float conversion to string
func (*Type) String ¶
func (t *Type) String() StringAccessor
String convert interface value to string
func (*Type) StringBool ¶
func (t *Type) StringBool() StringAccessor
StringBool convert interface value to string represent as bool
func (*Type) StringComplex ¶
func (t *Type) StringComplex(defaultValue ...complex64) StringAccessor
StringComplex convert interface value to string represent as complex
func (*Type) StringDefault ¶
func (t *Type) StringDefault(defaultValue string) StringAccessor
StringDefault convert interface value to string with default value if it wasn't converted or it has zero value
func (*Type) StringEmpty ¶
func (t *Type) StringEmpty() StringAccessor
StringEmpty convert interface value to string and replace zero values to empty string if needed
func (*Type) StringFloat ¶
func (t *Type) StringFloat(defaultValue ...float32) StringAccessor
StringFloat convert interface value to string represent as float
func (*Type) StringInt ¶
func (t *Type) StringInt() StringAccessor
StringInt convert interface value to string represents as int
func (*Type) Uint ¶
func (t *Type) Uint(defaultValue ...uint) UintAccessor
Uint convert interface value to uint. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Uint16 ¶
func (t *Type) Uint16(defaultValue ...uint16) Uint16Accessor
Uint16 convert interface value to uint16. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Uint32 ¶
func (t *Type) Uint32(defaultValue ...uint32) Uint32Accessor
Uint32 convert interface value to uint32. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Uint64 ¶
func (t *Type) Uint64(defaultValue ...uint64) Uint64Accessor
Uint64 convert interface value to uint64. Returns value if type can safely converted, otherwise error & default value in result values
func (*Type) Uint8 ¶
func (t *Type) Uint8(defaultValue ...uint8) Uint8Accessor
Uint8 convert interface value to uint8. Returns value if type can safely converted, otherwise error & default value in result values
type Uint16Accessor ¶
type Uint16Accessor interface { Common V() uint16 Set(value uint16) Clone() Uint16Accessor }
Uint16Accessor accessor of uint16 type.
func Complex64Uint16 ¶
func Complex64Uint16(from complex64, defaultValue ...uint16) Uint16Accessor
Complex64Uint16 convert value from complex64 to uint16. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexUint16 ¶
func ComplexUint16(from complex128, defaultValue ...uint16) Uint16Accessor
ComplexUint16 convert value from complex128 to uint16. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Uint16 ¶
func Float32Uint16(from float32, defaultValue ...uint16) Uint16Accessor
Float32Uint16 convert value from float32 to uint16. Returns value if type can safely converted, otherwise error & default value in result values
func FloatUint16 ¶
func FloatUint16(from float64, defaultValue ...uint16) Uint16Accessor
FloatUint16 convert value from float64 to uint16. Returns value if type can safely converted, otherwise error & default value in result values
func IntUint16 ¶
func IntUint16(from int64, defaultValue ...uint16) Uint16Accessor
IntUint16 convert value from int64 to uint16. Returns value if type can safely converted, otherwise error & default value in result values
func NNUint16 ¶
func NNUint16(value uint16) Uint16Accessor
NNUint16 returns NotNullUint16 under Uint16Accessor from uint16
func NUint16 ¶
func NUint16(value uint16) Uint16Accessor
NUint16 returns NullUint16 under Uint16Accessor from uint16
func StringUint16 ¶
func StringUint16(from string, defaultValue ...uint16) Uint16Accessor
StringUint16 convert value from string to uint16. Returns value if type can safely converted, otherwise error & default value in result values
func Uint16 ¶
func Uint16(from uint64, defaultValue ...uint16) Uint16Accessor
Uint16 convert value from uint64 to uint16. Returns value if type can safely converted, otherwise error & default value in result values
type Uint16Common ¶
Uint16Common represents an uint16 with pointer and error.
func (Uint16Common) MarshalJSON ¶
func (n Uint16Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Uint16Common) Present ¶
func (n Uint16Common) Present() bool
Present determines whether a value has been set
func (*Uint16Common) Scan ¶
func (n *Uint16Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Uint16Common) Set ¶
func (n *Uint16Common) Set(value uint16)
Set saves value into current struct
func (Uint16Common) Typ ¶
func (n Uint16Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Uint16Common) UnmarshalJSON ¶
func (n *Uint16Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Uint16Common) V ¶
func (n Uint16Common) V() uint16
V returns value of underlying type if it was set, otherwise default value
func (Uint16Common) Valid ¶
func (n Uint16Common) Valid() bool
Valid determines whether a value has been valid
type Uint32Accessor ¶
type Uint32Accessor interface { Common V() uint32 Set(value uint32) Clone() Uint32Accessor }
Uint32Accessor accessor of uint32 type.
func Complex64Uint32 ¶
func Complex64Uint32(from complex64, defaultValue ...uint32) Uint32Accessor
Complex64Uint32 convert value from complex64 to uint32. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexUint32 ¶
func ComplexUint32(from complex128, defaultValue ...uint32) Uint32Accessor
ComplexUint32 convert value from complex128 to uint32. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Uint32 ¶
func Float32Uint32(from float32, defaultValue ...uint32) Uint32Accessor
Float32Uint32 convert value from float32 to uint32. Returns value if type can safely converted, otherwise error & default value in result values
func FloatUint32 ¶
func FloatUint32(from float64, defaultValue ...uint32) Uint32Accessor
FloatUint32 convert value from float64 to uint32. Returns value if type can safely converted, otherwise error & default value in result values
func IntUint32 ¶
func IntUint32(from int64, defaultValue ...uint32) Uint32Accessor
IntUint32 convert value from int64 to uint32. Returns value if type can safely converted, otherwise error & default value in result values
func NNUint32 ¶
func NNUint32(value uint32) Uint32Accessor
NNUint32 returns NotNullUint32 under Uint32Accessor from uint32
func NUint32 ¶
func NUint32(value uint32) Uint32Accessor
NUint32 returns NullUint32 under Uint32Accessor from uint32
func StringUint32 ¶
func StringUint32(from string, defaultValue ...uint32) Uint32Accessor
StringUint32 convert value from string to uint32. Returns value if type can safely converted, otherwise error & default value in result values
func Uint32 ¶
func Uint32(from uint64, defaultValue ...uint32) Uint32Accessor
Uint32 convert value from uint64 to uint32. Returns value if type can safely converted, otherwise error & default value in result values
type Uint32Common ¶
Uint32Common represents an uint32 with pointer and error.
func (Uint32Common) MarshalJSON ¶
func (n Uint32Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Uint32Common) Present ¶
func (n Uint32Common) Present() bool
Present determines whether a value has been set
func (*Uint32Common) Scan ¶
func (n *Uint32Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Uint32Common) Set ¶
func (n *Uint32Common) Set(value uint32)
Set saves value into current struct
func (Uint32Common) Typ ¶
func (n Uint32Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Uint32Common) UnmarshalJSON ¶
func (n *Uint32Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Uint32Common) V ¶
func (n Uint32Common) V() uint32
V returns value of underlying type if it was set, otherwise default value
func (Uint32Common) Valid ¶
func (n Uint32Common) Valid() bool
Valid determines whether a value has been valid
type Uint64Accessor ¶
type Uint64Accessor interface { Common V() uint64 Set(value uint64) Clone() Uint64Accessor }
Uint64Accessor accessor of uint64 type.
func Complex64Uint64 ¶
func Complex64Uint64(from complex64, defaultValue ...uint64) Uint64Accessor
Complex64Uint64 convert value from complex64 to uint64. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexUint64 ¶
func ComplexUint64(from complex128, defaultValue ...uint64) Uint64Accessor
ComplexUint64 convert value from complex128 to uint64. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Uint64 ¶
func Float32Uint64(from float32, defaultValue ...uint64) Uint64Accessor
Float32Uint64 convert value from float32 to uint64. Returns value if type can safely converted, otherwise error & default value in result values
func FloatUint64 ¶
func FloatUint64(from float64, defaultValue ...uint64) Uint64Accessor
FloatUint64 convert value from float64 to uint64. Returns value if type can safely converted, otherwise error & default value in result values
func IntUint64 ¶
func IntUint64(from int64, defaultValue ...uint64) Uint64Accessor
IntUint64 convert value from int64 to uint64. Returns value if type can safely converted, otherwise error & default value in result values
func NNUint64 ¶
func NNUint64(value uint64) Uint64Accessor
NNUint64 returns NotNullUint64 under Uint64Accessor from uint64
func NUint64 ¶
func NUint64(value uint64) Uint64Accessor
NUint64 returns NullUint64 under Uint64Accessor from uint64
func StringUint64 ¶
func StringUint64(from string, defaultValue ...uint64) Uint64Accessor
StringUint64 convert value from string to uint64. Returns value if type can safely converted, otherwise error & default value in result values
type Uint64Common ¶
Uint64Common represents an uint64 with pointer and error.
func (Uint64Common) MarshalJSON ¶
func (n Uint64Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Uint64Common) Present ¶
func (n Uint64Common) Present() bool
Present determines whether a value has been set
func (*Uint64Common) Scan ¶
func (n *Uint64Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Uint64Common) Set ¶
func (n *Uint64Common) Set(value uint64)
Set saves value into current struct
func (Uint64Common) Typ ¶
func (n Uint64Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Uint64Common) UnmarshalJSON ¶
func (n *Uint64Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Uint64Common) V ¶
func (n Uint64Common) V() uint64
V returns value of underlying type if it was set, otherwise default value
func (Uint64Common) Valid ¶
func (n Uint64Common) Valid() bool
Valid determines whether a value has been valid
type Uint8Accessor ¶
type Uint8Accessor interface { Common V() uint8 Set(value uint8) Clone() Uint8Accessor }
Uint8Accessor accessor of uint8 type.
func Complex64Uint8 ¶
func Complex64Uint8(from complex64, defaultValue ...uint8) Uint8Accessor
Complex64Uint8 convert value from complex64 to uint8. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexUint8 ¶
func ComplexUint8(from complex128, defaultValue ...uint8) Uint8Accessor
ComplexUint8 convert value from complex128 to uint8. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Uint8 ¶
func Float32Uint8(from float32, defaultValue ...uint8) Uint8Accessor
Float32Uint8 convert value from float32 to uint8. Returns value if type can safely converted, otherwise error & default value in result values
func FloatUint8 ¶
func FloatUint8(from float64, defaultValue ...uint8) Uint8Accessor
FloatUint8 convert value from float64 to uint8. Returns value if type can safely converted, otherwise error & default value in result values
func IntUint8 ¶
func IntUint8(from int64, defaultValue ...uint8) Uint8Accessor
IntUint8 convert value from int64 to uint8. Returns value if type can safely converted, otherwise error & default value in result values
func NNUint8 ¶
func NNUint8(value uint8) Uint8Accessor
NNUint8 returns NotNullUint8 under Uint8Accessor from uint8
func NUint8 ¶
func NUint8(value uint8) Uint8Accessor
NUint8 returns NullUint8 under Uint8Accessor from uint8
func StringUint8 ¶
func StringUint8(from string, defaultValue ...uint8) Uint8Accessor
StringUint8 convert value from string to uint8. Returns value if type can safely converted, otherwise error & default value in result values
func Uint8 ¶
func Uint8(from uint64, defaultValue ...uint8) Uint8Accessor
Uint8 convert value from uint64 to uint8. Returns value if type can safely converted, otherwise error & default value in result values
type Uint8Common ¶
Uint8Common represents an uint8 with pointer and error.
func (Uint8Common) MarshalJSON ¶
func (n Uint8Common) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (Uint8Common) Present ¶
func (n Uint8Common) Present() bool
Present determines whether a value has been set
func (*Uint8Common) Scan ¶
func (n *Uint8Common) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (*Uint8Common) Set ¶
func (n *Uint8Common) Set(value uint8)
Set saves value into current struct
func (Uint8Common) Typ ¶
func (n Uint8Common) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*Uint8Common) UnmarshalJSON ¶
func (n *Uint8Common) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (Uint8Common) V ¶
func (n Uint8Common) V() uint8
V returns value of underlying type if it was set, otherwise default value
func (Uint8Common) Valid ¶
func (n Uint8Common) Valid() bool
Valid determines whether a value has been valid
type UintAccessor ¶
type UintAccessor interface { Common V() uint Set(value uint) Clone() UintAccessor }
UintAccessor accessor of uint type.
func Complex64Uint ¶
func Complex64Uint(from complex64, defaultValue ...uint) UintAccessor
Complex64Uint convert value from complex64 to uint. Returns value if type can safely converted, otherwise error & default value in result values
func ComplexUint ¶
func ComplexUint(from complex128, defaultValue ...uint) UintAccessor
ComplexUint convert value from complex128 to uint. Returns value if type can safely converted, otherwise error & default value in result values
func Float32Uint ¶
func Float32Uint(from float32, defaultValue ...uint) UintAccessor
Float32Uint convert value from float32 to uint. Returns value if type can safely converted, otherwise error & default value in result values
func FloatUint ¶
func FloatUint(from float64, defaultValue ...uint) UintAccessor
FloatUint convert value from float64 to uint. Returns value if type can safely converted, otherwise error & default value in result values
func NNUint ¶
func NNUint(value uint) UintAccessor
NNUint returns NotNullUint under UintAccessor from uint
func NUint ¶
func NUint(value uint) UintAccessor
NUint returns NullUint under UintAccessor from uint
func StringUint ¶
func StringUint(from string, defaultValue ...uint) UintAccessor
StringUint convert value from string to uint. Returns value if type can safely converted, otherwise error & default value in result values
type UintCommon ¶
UintCommon represents an uint with pointer and error.
func (UintCommon) MarshalJSON ¶
func (n UintCommon) MarshalJSON() ([]byte, error)
MarshalJSON implements the json Marshaler interface.
func (UintCommon) Present ¶
func (n UintCommon) Present() bool
Present determines whether a value has been set
func (*UintCommon) Scan ¶
func (n *UintCommon) Scan(value interface{}) error
Scan implements the sql Scanner interface.
func (UintCommon) Typ ¶
func (n UintCommon) Typ(options ...Option) *Type
Typ returns new instance with himself value. If current value is invalid, nil *Type returned
func (*UintCommon) UnmarshalJSON ¶
func (n *UintCommon) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
func (UintCommon) V ¶
func (n UintCommon) V() uint
V returns value of underlying type if it was set, otherwise default value
func (UintCommon) Valid ¶
func (n UintCommon) Valid() bool
Valid determines whether a value has been valid
type UintStringOption ¶
type UintStringOption func(*uintStrOpts) error
UintStringOption is interface function used as argument value for type conversion configuration from uint to string
func UintStringBase ¶
func UintStringBase(value int) UintStringOption
UintStringBase set base for uint conversion to string. The base must be 2 <= base <= 36 for digit values >= 10.
func UintStringDefault ¶
func UintStringDefault(value string) UintStringOption
UintStringDefault set default string value for uint conversion to string.