null

package module
v0.0.0-...-5012963 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

README

null

My implementation of nullable types in Golang.
Project is mostly for personal educational purposes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	// contains filtered or unexported fields
}

func (*Bool) Get

func (b *Bool) Get() bool

func (Bool) MarshalJSON

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

func (*Bool) Null

func (b *Bool) Null() bool

func (*Bool) Nullify

func (b *Bool) Nullify()

func (*Bool) Scan

func (b *Bool) Scan(value interface{}) (err error)

func (*Bool) Set

func (b *Bool) Set(val bool)

func (Bool) String

func (b Bool) String() string

func (*Bool) UnmarshalJSON

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

func (Bool) Value

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

type Float64

type Float64 struct {
	// contains filtered or unexported fields
}

func (*Float64) Get

func (f *Float64) Get() float64

func (Float64) MarshalJSON

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

func (*Float64) Null

func (f *Float64) Null() bool

func (*Float64) Nullify

func (f *Float64) Nullify()

func (*Float64) Scan

func (f *Float64) Scan(value interface{}) (err error)

func (*Float64) Set

func (f *Float64) Set(val float64)

func (Float64) String

func (f Float64) String() string

func (*Float64) UnmarshalJSON

func (f *Float64) UnmarshalJSON(data []byte) (err error)

func (Float64) Value

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

type Int64

type Int64 struct {
	// contains filtered or unexported fields
}

func (*Int64) Get

func (f *Int64) Get() int64

func (Int64) MarshalJSON

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

func (*Int64) Null

func (f *Int64) Null() bool

func (*Int64) Nullify

func (f *Int64) Nullify()

func (*Int64) Scan

func (f *Int64) Scan(value interface{}) (err error)

func (*Int64) Set

func (f *Int64) Set(val int64)

func (Int64) String

func (f Int64) String() string

func (*Int64) UnmarshalJSON

func (f *Int64) UnmarshalJSON(data []byte) (err error)

func (Int64) Value

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

type Nullable

type Nullable interface {
	Null() bool
	Nullify()
	String() string
}

type String

type String struct {
	// contains filtered or unexported fields
}

func (*String) Get

func (s *String) Get() string

func (String) MarshalJSON

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

func (*String) Null

func (s *String) Null() bool

func (*String) Nullify

func (s *String) Nullify()

func (*String) Scan

func (s *String) Scan(value interface{}) (err error)

func (*String) Set

func (s *String) Set(str string)

func (String) String

func (s String) String() string

func (*String) UnmarshalJSON

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

func (String) Value

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

type Time

type Time struct {
	Time  time.Time
	Valid bool
}

func (Time) MarshalJSON

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

func (*Time) Null

func (t *Time) Null() bool

func (*Time) Nullify

func (t *Time) Nullify()

func (*Time) Scan

func (t *Time) Scan(value interface{}) (err error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

func (Time) Value

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

type TimeDate

type TimeDate struct {
	Time
}

func (TimeDate) MarshalJSON

func (t TimeDate) MarshalJSON() ([]byte, error)

type TimeT

type TimeT struct {
	Time
}

func (TimeT) MarshalJSON

func (t TimeT) MarshalJSON() ([]byte, error)

type TimeTz

type TimeTz struct {
	Time
}

func (TimeTz) MarshalJSON

func (t TimeTz) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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