nullable

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Bool  bool
	Valid bool
}

Bool defines a nullable bool

func MakeBool

func MakeBool(b *bool) Bool

MakeBool creates a new Bool

func (Bool) MarshalJSON

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

MarshalJSON for Bool

func (*Bool) Scan

func (n *Bool) Scan(src interface{}) error

Scan implements the Scanner interface from database/sql

func (*Bool) UnmarshalJSON

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

UnmarshalJSON for Bool

func (Bool) Value

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

Value returns the database/sql driver value for Bool

type Float64

type Float64 struct {
	Float64 float64
	Valid   bool
}

Float64 aliases sql.Float64

func MakeFloat64

func MakeFloat64(i *float64) Float64

MakeFloat64 returns a new Float64

func (Float64) MarshalJSON

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

MarshalJSON for Float64

func (*Float64) Scan

func (n *Float64) Scan(src interface{}) error

Scan implements the Scanner interface from database/sql

func (*Float64) UnmarshalJSON

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

UnmarshalJSON for Float64

func (Float64) Value

func (n Float64) Value() (driver.Value, error)

Value returns the database/sql driver value for Float64

type Int64

type Int64 struct {
	Int64 int64
	Valid bool // Valid is true if Time is not NULL
}

Int64 defines a nullable int64

func MakeInt64

func MakeInt64(i *int64) Int64

MakeInt64 returns a new Int64

func (Int64) MarshalJSON

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

MarshalJSON for Int64

func (*Int64) Scan

func (n *Int64) Scan(src interface{}) error

Scan implements the Scanner interface from database/sql

func (*Int64) UnmarshalJSON

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

UnmarshalJSON for Int64

func (Int64) Value

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

Value returns the database/sql driver value for Int64

type RawJSON

type RawJSON json.RawMessage

RawJSON aliases json.RawMessage

func (RawJSON) MarshalJSON

func (n RawJSON) MarshalJSON() ([]byte, error)

MarshalJSON for String

func (*RawJSON) Scan

func (n *RawJSON) Scan(src interface{}) error

Scan implements the Scanner interface from database/sql

func (*RawJSON) UnmarshalJSON

func (n *RawJSON) UnmarshalJSON(b []byte) error

UnmarshalJSON for String

func (RawJSON) Value

func (n RawJSON) Value() (driver.Value, error)

Value returns the database/sql driver value for RawJson

type String

type String struct {
	String string
	Valid  bool // Valid is true if String is not NULL
}

String defines a nullable string

func MakeString

func MakeString(s *string) String

MakeString returns a new String

func (String) MarshalJSON

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

MarshalJSON for String

func (*String) Scan

func (n *String) Scan(src interface{}) error

Scan implements the Scanner interface from database/sql

func (*String) UnmarshalJSON

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

UnmarshalJSON for String

func (String) Value

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

Value returns the database/sql driver value for String

type Time

type Time struct {
	Time  time.Time
	Valid bool // Valid is true if Time is not NULL
}

Time defines a nullable time

func MakeTime

func MakeTime(t time.Time) Time

MakeTime creates a new NullTime

func (Time) MarshalJSON

func (n Time) MarshalJSON() ([]byte, error)

MarshalJSON for Time

func (*Time) Scan

func (n *Time) Scan(src interface{}) error

Scan implements the Scanner interface from database/sql

func (*Time) UnmarshalJSON

func (n *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON for Time

func (Time) Value

func (n Time) Value() (driver.Value, error)

Value returns the database/sql driver value for Time

Jump to

Keyboard shortcuts

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