Documentation
¶
Overview ¶
Package nan - Zero allocation Nullable structures in one library with handy conversion functions, marshallers and unmarshallers.
Features: - short name "nan" - handy conversion functions - select which marshalers you want and limit dependencies to only those you actually need - ability to convert your custom structs to nan compatible type with Valid field and all requested encoders/decoders
Supported types: - bool - float32 - float64 - int - int8 - int16 - int32 - int64 - string - time.Time - more types will be added as necessary
Supported marshallers: - Standart JSON - encoding.TextMarshaler/TextUnmarshaler. Reuses standard JSON logic and format - jsoniter - easyjson - go-json - Scylla and Cassandra. Compatible with gocql - SQL
Usage ¶
Simply create struct field or variable with one of the exported types and use it without any changes to external API.
JSON input/output will be converted to null or non null values. Scylla and Cassandra will use wire format compatible with gocql.
var data struct { Code nan.NullString `json:"code"` } b, err := jsoniter.Marshal(data) if err != nil { panic(err) } // {"code":null} fmt.Println(string(b)) data.Code = nan.String("1") // Equals to // data.Code = nan.NullString{String: "1", Valid: true} b, err = jsoniter.Marshal(data) if err != nil { panic(err) } // {"code":"1"} fmt.Println(string(b)) code := "2" // From addr. Can has value or be nil data.Code = nan.StringAddr(&code) b, err = jsoniter.Marshal(data) if err != nil { panic(err) } // {"code":"2"} fmt.Println(string(b)) // To usual value from nan codeVal := data.Code.String // 2 fmt.Println(codeVal) // To value addr from nan codeAddr := data.Code.Addr() // 2 fmt.Println(*codeAddr)
Index ¶
- Variables
- type NullBool
- func (n NullBool) Addr() *bool
- func (n NullBool) IsDefined() bool
- func (n NullBool) IsValid() bool
- func (n NullBool) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullBool) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullBool) MarshalJSON() ([]byte, error)
- func (n NullBool) MarshalText() ([]byte, error)
- func (n *NullBool) Scan(value interface{}) error
- func (n *NullBool) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullBool) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullBool) UnmarshalJSON(data []byte) error
- func (n *NullBool) UnmarshalText(text []byte) error
- func (n NullBool) Value() (driver.Value, error)
- type NullFloat32
- func (n NullFloat32) Addr() *float32
- func (n NullFloat32) IsDefined() bool
- func (n NullFloat32) IsValid() bool
- func (n NullFloat32) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullFloat32) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullFloat32) MarshalJSON() ([]byte, error)
- func (n NullFloat32) MarshalText() ([]byte, error)
- func (n *NullFloat32) Scan(value interface{}) error
- func (n *NullFloat32) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullFloat32) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullFloat32) UnmarshalJSON(data []byte) error
- func (n *NullFloat32) UnmarshalText(text []byte) error
- func (n NullFloat32) Value() (driver.Value, error)
- type NullFloat64
- func (n NullFloat64) Addr() *float64
- func (n NullFloat64) IsDefined() bool
- func (n NullFloat64) IsValid() bool
- func (n NullFloat64) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullFloat64) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullFloat64) MarshalJSON() ([]byte, error)
- func (n NullFloat64) MarshalText() ([]byte, error)
- func (n *NullFloat64) Scan(value interface{}) error
- func (n *NullFloat64) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullFloat64) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullFloat64) UnmarshalJSON(data []byte) error
- func (n *NullFloat64) UnmarshalText(text []byte) error
- func (n NullFloat64) Value() (driver.Value, error)
- type NullInt
- func (n NullInt) Addr() *int
- func (n NullInt) IsDefined() bool
- func (n NullInt) IsValid() bool
- func (n NullInt) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullInt) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullInt) MarshalJSON() ([]byte, error)
- func (n NullInt) MarshalText() ([]byte, error)
- func (n *NullInt) Scan(value interface{}) error
- func (n *NullInt) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullInt) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullInt) UnmarshalJSON(data []byte) error
- func (n *NullInt) UnmarshalText(text []byte) error
- func (n NullInt) Value() (driver.Value, error)
- type NullInt16
- func (n NullInt16) Addr() *int16
- func (n NullInt16) IsDefined() bool
- func (n NullInt16) IsValid() bool
- func (n NullInt16) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullInt16) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullInt16) MarshalJSON() ([]byte, error)
- func (n NullInt16) MarshalText() ([]byte, error)
- func (n *NullInt16) Scan(value interface{}) error
- func (n *NullInt16) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullInt16) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullInt16) UnmarshalJSON(data []byte) error
- func (n *NullInt16) UnmarshalText(text []byte) error
- func (n NullInt16) Value() (driver.Value, error)
- type NullInt32
- func (n NullInt32) Addr() *int32
- func (n NullInt32) IsDefined() bool
- func (n NullInt32) IsValid() bool
- func (n NullInt32) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullInt32) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullInt32) MarshalJSON() ([]byte, error)
- func (n NullInt32) MarshalText() ([]byte, error)
- func (n *NullInt32) Scan(value interface{}) error
- func (n *NullInt32) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullInt32) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullInt32) UnmarshalJSON(data []byte) error
- func (n *NullInt32) UnmarshalText(text []byte) error
- func (n NullInt32) Value() (driver.Value, error)
- type NullInt64
- func (n NullInt64) Addr() *int64
- func (n NullInt64) IsDefined() bool
- func (n NullInt64) IsValid() bool
- func (n NullInt64) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullInt64) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullInt64) MarshalJSON() ([]byte, error)
- func (n NullInt64) MarshalText() ([]byte, error)
- func (n *NullInt64) Scan(value interface{}) error
- func (n *NullInt64) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullInt64) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullInt64) UnmarshalJSON(data []byte) error
- func (n *NullInt64) UnmarshalText(text []byte) error
- func (n NullInt64) Value() (driver.Value, error)
- type NullInt8
- func (n NullInt8) Addr() *int8
- func (n NullInt8) IsDefined() bool
- func (n NullInt8) IsValid() bool
- func (n NullInt8) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullInt8) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullInt8) MarshalJSON() ([]byte, error)
- func (n NullInt8) MarshalText() ([]byte, error)
- func (n *NullInt8) Scan(value interface{}) error
- func (n *NullInt8) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullInt8) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullInt8) UnmarshalJSON(data []byte) error
- func (n *NullInt8) UnmarshalText(text []byte) error
- func (n NullInt8) Value() (driver.Value, error)
- type NullString
- func (n NullString) Addr() *string
- func (n NullString) IsDefined() bool
- func (n NullString) IsValid() bool
- func (n NullString) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullString) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullString) MarshalJSON() ([]byte, error)
- func (n NullString) MarshalText() ([]byte, error)
- func (ns *NullString) Scan(value interface{}) error
- func (n *NullString) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullString) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullString) UnmarshalJSON(data []byte) error
- func (n *NullString) UnmarshalText(text []byte) error
- func (ns NullString) Value() (driver.Value, error)
- type NullTime
- func (n NullTime) Addr() *time.Time
- func (n NullTime) IsDefined() bool
- func (n NullTime) IsValid() bool
- func (n NullTime) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
- func (n NullTime) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullTime) MarshalJSON() ([]byte, error)
- func (n NullTime) MarshalText() ([]byte, error)
- func (n *NullTime) Scan(value interface{}) error
- func (n *NullTime) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
- func (n *NullTime) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullTime) UnmarshalJSON(data []byte) error
- func (n *NullTime) UnmarshalText(text []byte) error
- func (n NullTime) Value() (driver.Value, error)
- type NullUint
- func (n NullUint) Addr() *uint
- func (n NullUint) IsDefined() bool
- func (n NullUint) IsValid() bool
- func (n NullUint) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullUint) MarshalJSON() ([]byte, error)
- func (n NullUint) MarshalText() ([]byte, error)
- func (n *NullUint) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullUint) UnmarshalJSON(data []byte) error
- func (n *NullUint) UnmarshalText(text []byte) error
- type NullUint16
- func (n NullUint16) Addr() *uint16
- func (n NullUint16) IsDefined() bool
- func (n NullUint16) IsValid() bool
- func (n NullUint16) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullUint16) MarshalJSON() ([]byte, error)
- func (n NullUint16) MarshalText() ([]byte, error)
- func (n *NullUint16) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullUint16) UnmarshalJSON(data []byte) error
- func (n *NullUint16) UnmarshalText(text []byte) error
- type NullUint32
- func (n NullUint32) Addr() *uint32
- func (n NullUint32) IsDefined() bool
- func (n NullUint32) IsValid() bool
- func (n NullUint32) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullUint32) MarshalJSON() ([]byte, error)
- func (n NullUint32) MarshalText() ([]byte, error)
- func (n *NullUint32) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullUint32) UnmarshalJSON(data []byte) error
- func (n *NullUint32) UnmarshalText(text []byte) error
- type NullUint64
- func (n NullUint64) Addr() *uint64
- func (n NullUint64) IsDefined() bool
- func (n NullUint64) IsValid() bool
- func (n NullUint64) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullUint64) MarshalJSON() ([]byte, error)
- func (n NullUint64) MarshalText() ([]byte, error)
- func (n *NullUint64) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullUint64) UnmarshalJSON(data []byte) error
- func (n *NullUint64) UnmarshalText(text []byte) error
- type NullUint8
- func (n NullUint8) Addr() *uint8
- func (n NullUint8) IsDefined() bool
- func (n NullUint8) IsValid() bool
- func (n NullUint8) MarshalEasyJSON(out *jwriter.Writer)
- func (n NullUint8) MarshalJSON() ([]byte, error)
- func (n NullUint8) MarshalText() ([]byte, error)
- func (n *NullUint8) UnmarshalEasyJSON(in *jlexer.Lexer)
- func (n *NullUint8) UnmarshalJSON(data []byte) error
- func (n *NullUint8) UnmarshalText(text []byte) error
- type Validator
Constants ¶
This section is empty.
Variables ¶
var EmbeddedSources embed.FS
Functions ¶
This section is empty.
Types ¶
type NullBool ¶
NullBool - nullable bool
func BoolToNullBool
deprecated
func (NullBool) MarshalCQL ¶
MarshalCQL - marshaller for cql
func (NullBool) MarshalEasyJSON ¶
MarshalEasyJSON - marshaller for easyjson
func (NullBool) MarshalJSON ¶
MarshalJSON - marshaller for json
func (NullBool) MarshalText ¶ added in v0.4.0
MarshalText - marshaller for text
func (*NullBool) UnmarshalCQL ¶
UnmarshalCQL - unmarshaller for cql
func (*NullBool) UnmarshalEasyJSON ¶
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullBool) UnmarshalJSON ¶
UnmarshalJSON - unmarshaller for json
func (*NullBool) UnmarshalText ¶ added in v0.4.0
UnmarshalText - unmarshaller for text
type NullFloat32 ¶ added in v0.1.2
NullFloat32 - nullable float32
func Float32 ¶ added in v0.1.9
func Float32(v float32) NullFloat32
Float32 - converts float32 to NullFloat32
func Float32Addr ¶ added in v0.8.0
func Float32Addr(v *float32) NullFloat32
Float32Addr - converts float32 address to NullFloat32
func Float32ToNullFloat32
deprecated
added in
v0.1.3
func Float32ToNullFloat32(v float32) NullFloat32
Float32ToNullFloat32 - converts float32 to NullFloat32
Deprecated: use shorter variant
func (NullFloat32) Addr ¶ added in v0.7.0
func (n NullFloat32) Addr() *float32
func (NullFloat32) IsDefined ¶ added in v0.1.10
func (n NullFloat32) IsDefined() bool
func (NullFloat32) IsValid ¶ added in v0.1.7
func (n NullFloat32) IsValid() bool
func (NullFloat32) MarshalCQL ¶ added in v0.1.2
func (n NullFloat32) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
MarshalCQL - marshaller for cql
func (NullFloat32) MarshalEasyJSON ¶ added in v0.1.2
func (n NullFloat32) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON - marshaller for easyjson
func (NullFloat32) MarshalJSON ¶ added in v0.1.2
func (n NullFloat32) MarshalJSON() ([]byte, error)
MarshalJSON - marshaller for json
func (NullFloat32) MarshalText ¶ added in v0.4.0
func (n NullFloat32) MarshalText() ([]byte, error)
MarshalText - marshaller for text
func (*NullFloat32) Scan ¶ added in v0.1.5
func (n *NullFloat32) Scan(value interface{}) error
Scan - scan value from sql driver
func (*NullFloat32) UnmarshalCQL ¶ added in v0.1.2
func (n *NullFloat32) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
UnmarshalCQL - unmarshaller for cql
func (*NullFloat32) UnmarshalEasyJSON ¶ added in v0.1.2
func (n *NullFloat32) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullFloat32) UnmarshalJSON ¶ added in v0.1.2
func (n *NullFloat32) UnmarshalJSON(data []byte) error
UnmarshalJSON - unmarshaller for json
func (*NullFloat32) UnmarshalText ¶ added in v0.4.0
func (n *NullFloat32) UnmarshalText(text []byte) error
UnmarshalText - unmarshaller for text
type NullFloat64 ¶ added in v0.1.1
NullFloat64 - nullable float64
func Float64 ¶ added in v0.1.9
func Float64(v float64) NullFloat64
Float64 - converts float64 to NullFloat64
func Float64Addr ¶ added in v0.8.0
func Float64Addr(v *float64) NullFloat64
Float64Addr - converts float64 address to NullFloat64
func Float64ToNullFloat64
deprecated
added in
v0.1.1
func Float64ToNullFloat64(v float64) NullFloat64
Float64ToNullFloat64 - converts float64 to NullFloat64
Deprecated: use shorter variant
func (NullFloat64) Addr ¶ added in v0.7.0
func (n NullFloat64) Addr() *float64
func (NullFloat64) IsDefined ¶ added in v0.1.10
func (n NullFloat64) IsDefined() bool
func (NullFloat64) IsValid ¶ added in v0.1.7
func (n NullFloat64) IsValid() bool
func (NullFloat64) MarshalCQL ¶ added in v0.1.1
func (n NullFloat64) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
MarshalCQL - marshaller for cql
func (NullFloat64) MarshalEasyJSON ¶ added in v0.1.1
func (n NullFloat64) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON - marshaller for easyjson
func (NullFloat64) MarshalJSON ¶ added in v0.1.1
func (n NullFloat64) MarshalJSON() ([]byte, error)
MarshalJSON - marshaller for json
func (NullFloat64) MarshalText ¶ added in v0.4.0
func (n NullFloat64) MarshalText() ([]byte, error)
MarshalText - marshaller for text
func (*NullFloat64) Scan ¶ added in v0.1.5
func (n *NullFloat64) Scan(value interface{}) error
Scan - scan value from sql driver
func (*NullFloat64) UnmarshalCQL ¶ added in v0.1.1
func (n *NullFloat64) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
UnmarshalCQL - unmarshaller for cql
func (*NullFloat64) UnmarshalEasyJSON ¶ added in v0.1.1
func (n *NullFloat64) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullFloat64) UnmarshalJSON ¶ added in v0.1.1
func (n *NullFloat64) UnmarshalJSON(data []byte) error
UnmarshalJSON - unmarshaller for json
func (*NullFloat64) UnmarshalText ¶ added in v0.4.0
func (n *NullFloat64) UnmarshalText(text []byte) error
UnmarshalText - unmarshaller for text
type NullInt ¶ added in v0.1.4
NullInt - nullable int
func IntToNullInt
deprecated
added in
v0.1.5
func (NullInt) MarshalCQL ¶ added in v0.1.4
MarshalCQL - marshaller for cql
func (NullInt) MarshalEasyJSON ¶ added in v0.1.4
MarshalEasyJSON - marshaller for easyjson
func (NullInt) MarshalJSON ¶ added in v0.1.4
MarshalJSON - marshaller for json
func (NullInt) MarshalText ¶ added in v0.4.0
MarshalText - marshaller for text
func (*NullInt) UnmarshalCQL ¶ added in v0.1.4
UnmarshalCQL - unmarshaller for cql
func (*NullInt) UnmarshalEasyJSON ¶ added in v0.1.4
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullInt) UnmarshalJSON ¶ added in v0.1.4
UnmarshalJSON - unmarshaller for json
func (*NullInt) UnmarshalText ¶ added in v0.4.0
UnmarshalText - unmarshaller for text
type NullInt16 ¶ added in v0.1.2
NullInt16 - nullable int16
func Int16ToNullInt16
deprecated
added in
v0.1.3
func (NullInt16) MarshalCQL ¶ added in v0.1.2
MarshalCQL - marshaller for cql
func (NullInt16) MarshalEasyJSON ¶ added in v0.1.2
MarshalEasyJSON - marshaller for easyjson
func (NullInt16) MarshalJSON ¶ added in v0.1.2
MarshalJSON - marshaller for json
func (NullInt16) MarshalText ¶ added in v0.4.0
MarshalText - marshaller for text
func (*NullInt16) UnmarshalCQL ¶ added in v0.1.2
UnmarshalCQL - unmarshaller for cql
func (*NullInt16) UnmarshalEasyJSON ¶ added in v0.1.2
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullInt16) UnmarshalJSON ¶ added in v0.1.2
UnmarshalJSON - unmarshaller for json
func (*NullInt16) UnmarshalText ¶ added in v0.4.0
UnmarshalText - unmarshaller for text
type NullInt32 ¶ added in v0.1.2
NullInt32 - nullable int32
func Int32ToNullInt32
deprecated
added in
v0.1.3
func (NullInt32) MarshalCQL ¶ added in v0.1.2
MarshalCQL - marshaller for cql
func (NullInt32) MarshalEasyJSON ¶ added in v0.1.2
MarshalEasyJSON - marshaller for easyjson
func (NullInt32) MarshalJSON ¶ added in v0.1.2
MarshalJSON - marshaller for json
func (NullInt32) MarshalText ¶ added in v0.4.0
MarshalText - marshaller for text
func (*NullInt32) UnmarshalCQL ¶ added in v0.1.2
UnmarshalCQL - unmarshaller for cql
func (*NullInt32) UnmarshalEasyJSON ¶ added in v0.1.2
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullInt32) UnmarshalJSON ¶ added in v0.1.2
UnmarshalJSON - unmarshaller for json
func (*NullInt32) UnmarshalText ¶ added in v0.4.0
UnmarshalText - unmarshaller for text
type NullInt64 ¶
NullInt64 - nullable int64
func Int64ToNullInt64
deprecated
func (NullInt64) MarshalCQL ¶
MarshalCQL - marshaller for cql
func (NullInt64) MarshalEasyJSON ¶
MarshalEasyJSON - marshaller for easyjson
func (NullInt64) MarshalJSON ¶
MarshalJSON - marshaller for json
func (NullInt64) MarshalText ¶ added in v0.4.0
MarshalText - marshaller for text
func (*NullInt64) UnmarshalCQL ¶
UnmarshalCQL - unmarshaller for cql
func (*NullInt64) UnmarshalEasyJSON ¶
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullInt64) UnmarshalJSON ¶
UnmarshalJSON - unmarshaller for json
func (*NullInt64) UnmarshalText ¶ added in v0.4.0
UnmarshalText - unmarshaller for text
type NullInt8 ¶ added in v0.1.2
NullInt8 - nullable int8
func Int8ToNullInt8
deprecated
added in
v0.1.3
func (NullInt8) MarshalCQL ¶ added in v0.1.2
MarshalCQL - marshaller for cql
func (NullInt8) MarshalEasyJSON ¶ added in v0.1.2
MarshalEasyJSON - marshaller for easyjson
func (NullInt8) MarshalJSON ¶ added in v0.1.2
MarshalJSON - marshaller for json
func (NullInt8) MarshalText ¶ added in v0.4.0
MarshalText - marshaller for text
func (*NullInt8) UnmarshalCQL ¶ added in v0.1.2
UnmarshalCQL - unmarshaller for cql
func (*NullInt8) UnmarshalEasyJSON ¶ added in v0.1.2
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullInt8) UnmarshalJSON ¶ added in v0.1.2
UnmarshalJSON - unmarshaller for json
func (*NullInt8) UnmarshalText ¶ added in v0.4.0
UnmarshalText - unmarshaller for text
type NullString ¶
NullString - nullable string
func String ¶ added in v0.1.9
func String(v string) NullString
String - converts string to NullString
func StringAddr ¶ added in v0.8.0
func StringAddr(v *string) NullString
StringAddr - converts string address to NullString
func StringToNullString
deprecated
func StringToNullString(v string) NullString
StringToNullString - converts string to NullString
Deprecated: use shorter variant
func (NullString) Addr ¶ added in v0.7.0
func (n NullString) Addr() *string
func (NullString) IsDefined ¶ added in v0.1.10
func (n NullString) IsDefined() bool
func (NullString) IsValid ¶ added in v0.1.7
func (n NullString) IsValid() bool
func (NullString) MarshalCQL ¶
func (n NullString) MarshalCQL(info gocql.TypeInfo) ([]byte, error)
MarshalCQL - marshaller for cql
func (NullString) MarshalEasyJSON ¶
func (n NullString) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON - marshaller for easyjson
func (NullString) MarshalJSON ¶
func (n NullString) MarshalJSON() ([]byte, error)
MarshalJSON - marshaller for json
func (NullString) MarshalText ¶ added in v0.4.0
func (n NullString) MarshalText() ([]byte, error)
MarshalText - marshaller for text
func (*NullString) Scan ¶ added in v0.1.5
func (ns *NullString) Scan(value interface{}) error
Scan - scan value from sql driver
func (*NullString) UnmarshalCQL ¶
func (n *NullString) UnmarshalCQL(info gocql.TypeInfo, data []byte) error
UnmarshalCQL - unmarshaller for cql
func (*NullString) UnmarshalEasyJSON ¶
func (n *NullString) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullString) UnmarshalJSON ¶
func (n *NullString) UnmarshalJSON(data []byte) error
UnmarshalJSON - unmarshaller for json
func (*NullString) UnmarshalText ¶ added in v0.4.0
func (n *NullString) UnmarshalText(text []byte) error
UnmarshalText - unmarshaller for text
type NullTime ¶
NullTime - nullable time.Time
func TimeToNullTime
deprecated
func (NullTime) MarshalCQL ¶
MarshalCQL - marshaller for cql
func (NullTime) MarshalEasyJSON ¶
MarshalEasyJSON - marshaller for easyjson
func (NullTime) MarshalJSON ¶
MarshalJSON - marshaller for json
func (NullTime) MarshalText ¶ added in v0.4.0
MarshalText - marshaller for text
func (*NullTime) UnmarshalCQL ¶
UnmarshalCQL - unmarshaller for cql
func (*NullTime) UnmarshalEasyJSON ¶
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullTime) UnmarshalJSON ¶
UnmarshalJSON - unmarshaller for json
func (*NullTime) UnmarshalText ¶ added in v0.4.0
UnmarshalText - unmarshaller for text
type NullUint ¶ added in v0.9.0
NullUint - nullable uint
func (NullUint) MarshalEasyJSON ¶ added in v0.9.0
MarshalEasyJSON - marshaller for easyjson
func (NullUint) MarshalJSON ¶ added in v0.9.0
MarshalJSON - marshaller for json
func (NullUint) MarshalText ¶ added in v0.9.0
MarshalText - marshaller for text
func (*NullUint) UnmarshalEasyJSON ¶ added in v0.9.0
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullUint) UnmarshalJSON ¶ added in v0.9.0
UnmarshalJSON - unmarshaller for json
func (*NullUint) UnmarshalText ¶ added in v0.9.0
UnmarshalText - unmarshaller for text
type NullUint16 ¶ added in v0.9.0
NullUint16 - nullable uint16
func Uint16 ¶ added in v0.9.0
func Uint16(v uint16) NullUint16
Uint16 - converts uint16 to NullUint16
func Uint16Addr ¶ added in v0.9.0
func Uint16Addr(v *uint16) NullUint16
Uint16Addr - converts uint16 address to NullUint16
func (NullUint16) Addr ¶ added in v0.9.0
func (n NullUint16) Addr() *uint16
func (NullUint16) IsDefined ¶ added in v0.9.0
func (n NullUint16) IsDefined() bool
func (NullUint16) IsValid ¶ added in v0.9.0
func (n NullUint16) IsValid() bool
func (NullUint16) MarshalEasyJSON ¶ added in v0.9.0
func (n NullUint16) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON - marshaller for easyjson
func (NullUint16) MarshalJSON ¶ added in v0.9.0
func (n NullUint16) MarshalJSON() ([]byte, error)
MarshalJSON - marshaller for json
func (NullUint16) MarshalText ¶ added in v0.9.0
func (n NullUint16) MarshalText() ([]byte, error)
MarshalText - marshaller for text
func (*NullUint16) UnmarshalEasyJSON ¶ added in v0.9.0
func (n *NullUint16) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullUint16) UnmarshalJSON ¶ added in v0.9.0
func (n *NullUint16) UnmarshalJSON(data []byte) error
UnmarshalJSON - unmarshaller for json
func (*NullUint16) UnmarshalText ¶ added in v0.9.0
func (n *NullUint16) UnmarshalText(text []byte) error
UnmarshalText - unmarshaller for text
type NullUint32 ¶ added in v0.9.0
NullUint32 - nullable uint32
func Uint32 ¶ added in v0.9.0
func Uint32(v uint32) NullUint32
Uint32 - converts uint32 to NullUint32
func Uint32Addr ¶ added in v0.9.0
func Uint32Addr(v *uint32) NullUint32
Uint32Addr - converts uint32 address to NullUint32
func (NullUint32) Addr ¶ added in v0.9.0
func (n NullUint32) Addr() *uint32
func (NullUint32) IsDefined ¶ added in v0.9.0
func (n NullUint32) IsDefined() bool
func (NullUint32) IsValid ¶ added in v0.9.0
func (n NullUint32) IsValid() bool
func (NullUint32) MarshalEasyJSON ¶ added in v0.9.0
func (n NullUint32) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON - marshaller for easyjson
func (NullUint32) MarshalJSON ¶ added in v0.9.0
func (n NullUint32) MarshalJSON() ([]byte, error)
MarshalJSON - marshaller for json
func (NullUint32) MarshalText ¶ added in v0.9.0
func (n NullUint32) MarshalText() ([]byte, error)
MarshalText - marshaller for text
func (*NullUint32) UnmarshalEasyJSON ¶ added in v0.9.0
func (n *NullUint32) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullUint32) UnmarshalJSON ¶ added in v0.9.0
func (n *NullUint32) UnmarshalJSON(data []byte) error
UnmarshalJSON - unmarshaller for json
func (*NullUint32) UnmarshalText ¶ added in v0.9.0
func (n *NullUint32) UnmarshalText(text []byte) error
UnmarshalText - unmarshaller for text
type NullUint64 ¶ added in v0.9.0
NullUint64 - nullable uint64
func Uint64 ¶ added in v0.9.0
func Uint64(v uint64) NullUint64
Uint64 - converts uint64 to NullUint64
func Uint64Addr ¶ added in v0.9.0
func Uint64Addr(v *uint64) NullUint64
Uint64Addr - converts uint64 address to NullUint64
func (NullUint64) Addr ¶ added in v0.9.0
func (n NullUint64) Addr() *uint64
func (NullUint64) IsDefined ¶ added in v0.9.0
func (n NullUint64) IsDefined() bool
func (NullUint64) IsValid ¶ added in v0.9.0
func (n NullUint64) IsValid() bool
func (NullUint64) MarshalEasyJSON ¶ added in v0.9.0
func (n NullUint64) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON - marshaller for easyjson
func (NullUint64) MarshalJSON ¶ added in v0.9.0
func (n NullUint64) MarshalJSON() ([]byte, error)
MarshalJSON - marshaller for json
func (NullUint64) MarshalText ¶ added in v0.9.0
func (n NullUint64) MarshalText() ([]byte, error)
MarshalText - marshaller for text
func (*NullUint64) UnmarshalEasyJSON ¶ added in v0.9.0
func (n *NullUint64) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullUint64) UnmarshalJSON ¶ added in v0.9.0
func (n *NullUint64) UnmarshalJSON(data []byte) error
UnmarshalJSON - unmarshaller for json
func (*NullUint64) UnmarshalText ¶ added in v0.9.0
func (n *NullUint64) UnmarshalText(text []byte) error
UnmarshalText - unmarshaller for text
type NullUint8 ¶ added in v0.9.0
NullUint8 - nullable uint8
func (NullUint8) MarshalEasyJSON ¶ added in v0.9.0
MarshalEasyJSON - marshaller for easyjson
func (NullUint8) MarshalJSON ¶ added in v0.9.0
MarshalJSON - marshaller for json
func (NullUint8) MarshalText ¶ added in v0.9.0
MarshalText - marshaller for text
func (*NullUint8) UnmarshalEasyJSON ¶ added in v0.9.0
UnmarshalEasyJSON - unmarshaller for easyjson
func (*NullUint8) UnmarshalJSON ¶ added in v0.9.0
UnmarshalJSON - unmarshaller for json
func (*NullUint8) UnmarshalText ¶ added in v0.9.0
UnmarshalText - unmarshaller for text