nnz

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package nnz defines variants of primitive types where the zero value represents null when (de)serializing with encoding/json and database/sql.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool bool

func (Bool) MarshalJSON

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

func (*Bool) Scan

func (b *Bool) Scan(v interface{}) error

func (*Bool) UnmarshalJSON

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

func (Bool) Value

func (b Bool) Value() (driver.Value, error)

type Int

type Int int

Int is a wrapper around int where Go int(0) serializes to SQL/JSON null, and SQL/JSON null deserializes to Go int(0).

func (Int) MarshalJSON

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

MarshalJSON implements the encoding/json.Marshaler interface.

func (*Int) Scan

func (i *Int) Scan(v interface{}) error

Scan implements the database/sql/driver.Scanner interface.

func (*Int) UnmarshalJSON

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

UnmarshalJSON implements the encoding/json.Unmarshaler interface.

func (Int) Value

func (i Int) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

type Int64

type Int64 int64

Int64 is a wrapper around int64 where Go int64(0) serializes to SQL/JSON null, and SQL/JSON null deserializes to Go int64(0).

func (Int64) MarshalJSON

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

MarshalJSON implements the encoding/json.Marshaler interface.

func (*Int64) Scan

func (i *Int64) Scan(v interface{}) error

Scan implements the database/sql/driver.Scanner interface.

func (*Int64) UnmarshalJSON

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

UnmarshalJSON implements the encoding/json.Unmarshaler interface.

func (Int64) Value

func (i Int64) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

type String

type String string

String is a wrapper around string where Go "" serializes to SQL/JSON null, and SQL/JSON null deserializes to Go "".

func (String) MarshalJSON

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

MarshalJSON implements the encoding/json.Marshaler interface.

func (*String) Scan

func (s *String) Scan(v interface{}) error

Scan implements the database/sql/driver.Scanner interface.

func (*String) UnmarshalJSON

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

UnmarshalJSON implements the encoding/json.Unmarshaler interface.

func (String) Value

func (s String) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

Jump to

Keyboard shortcuts

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