nulls

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: ISC Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct{ sql.NullBool }

func NewBool

func NewBool(b bool) Bool

func NewNullBool

func NewNullBool() Bool

func (Bool) IsEmpty

func (n Bool) IsEmpty() bool

func (Bool) IsValid

func (n Bool) IsValid() bool

func (Bool) MarshalJSON

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

func (*Bool) UnmarshalJSON

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

type Date

type Date struct{ sql.NullString }

Date is 'timezone-less' so we base if off string as all we care about is YYYY-MM-DD format.

func NewDate

func NewDate(s string) (Date, error)

func NewNullDate

func NewNullDate() Date

func (Date) IsEmpty

func (n Date) IsEmpty() bool

func (Date) IsValid

func (n Date) IsValid() bool

func (Date) MarshalJSON

func (nd Date) MarshalJSON() ([]byte, error)

func (*Date) Scan

func (nt *Date) Scan(value interface{}) error

func (*Date) UnmarshalJSON

func (nd *Date) UnmarshalJSON(b []byte) error

type Float64

type Float64 struct{ sql.NullFloat64 }

func NewFloat64

func NewFloat64(f float64) Float64

func NewNullFloat64

func NewNullFloat64() Float64

func (Float64) IsEmpty

func (n Float64) IsEmpty() bool

func (Float64) IsValid

func (n Float64) IsValid() bool

func (Float64) MarshalJSON

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

func (*Float64) UnmarshalJSON

func (nf *Float64) UnmarshalJSON(b []byte) error

type Int64

type Int64 struct{ sql.NullInt64 }

func NewInt64

func NewInt64(i int64) Int64

func NewNullInt64

func NewNullInt64() Int64

func (Int64) IsEmpty

func (n Int64) IsEmpty() bool

func (Int64) IsValid

func (n Int64) IsValid() bool

func (Int64) MarshalJSON

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

func (*Int64) UnmarshalJSON

func (ni *Int64) UnmarshalJSON(b []byte) error

type Nullable

type Nullable interface {
	IsEmpty() bool
	IsValid() bool
}

type String

type String struct{ sql.NullString }

func NewNullString

func NewNullString() String

func NewString

func NewString(s string) String

func (String) IsEmpty

func (ns String) IsEmpty() bool

func (String) IsValid

func (ns String) IsValid() bool

func (String) MarshalJSON

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

func (*String) UnmarshalJSON

func (ns *String) UnmarshalJSON(b []byte) error

type Timestamp

type Timestamp struct{ mysql.NullTime }

func NewNullTimestamp

func NewNullTimestamp() Timestamp

func NewTimestamp

func NewTimestamp(t time.Time) Timestamp

func (Timestamp) IsEmpty

func (n Timestamp) IsEmpty() bool

func (Timestamp) IsValid

func (n Timestamp) IsValid() bool

func (Timestamp) MarshalJSON

func (nt Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON

func (nt *Timestamp) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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