nullable

package module
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 7 Imported by: 0

README

nullable

Go Reference test Go Report Card

Installation

go get github.com/m0t0k1ch1-go/nullable

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool added in v1.4.0

type Bool struct {
	sql.NullBool
}

Bool is a nullable bool.

func NewBool added in v1.4.0

func NewBool(b bool, valid bool) Bool

NewBool returns a new Bool.

func (Bool) MarshalJSON added in v1.4.0

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

MarshalJSON implements the json.Marshaler interface.

func (*Bool) UnmarshalJSON added in v1.4.0

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

UnmarshalJSON implements the json.Unmarshaler interface.

type EthAddress added in v1.5.0

type EthAddress struct {
	Address ethcommon.Address
	Valid   bool
}

EthAddress is a nullable github.com/ethereum/go-ethereum/common.Address.

func NewEthAddress added in v1.5.0

func NewEthAddress(address ethcommon.Address, valid bool) EthAddress

NewEthAddress returns a new EthAddress.

func (EthAddress) MarshalJSON added in v1.5.0

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

MarshalJSON implements the json.Marshaler interface.

func (EthAddress) NullableString added in v1.5.0

func (n EthAddress) NullableString() String

NullableString returns the String.

func (*EthAddress) Scan added in v1.5.0

func (n *EthAddress) Scan(src any) error

Scan implements the sql.Scanner interface.

func (*EthAddress) UnmarshalJSON added in v1.5.0

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

UnmarshalJSON implements the json.Unmarshaler interface.

func (EthAddress) Value added in v1.5.0

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

Value implements the driver.Valuer interface.

type EthHash

type EthHash struct {
	Hash  ethcommon.Hash
	Valid bool
}

EthHash is a nullable github.com/ethereum/go-ethereum/common.Hash.

func NewEthHash

func NewEthHash(h ethcommon.Hash, valid bool) EthHash

NewEthHash returns a new EthHash.

func (EthHash) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface.

func (EthHash) NullableString

func (n EthHash) NullableString() String

NullableString returns the String.

func (*EthHash) Scan

func (n *EthHash) Scan(src any) error

Scan implements the sql.Scanner interface.

func (*EthHash) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaler interface.

func (EthHash) Value

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

Value implements the driver.Valuer interface.

type Int32 added in v1.9.0

type Int32 struct {
	sql.NullInt32
}

Int32 is a nullable int32.

func NewInt32 added in v1.9.0

func NewInt32(i int32, valid bool) Int32

NewInt32 returns a new Int32.

func (Int32) MarshalJSON added in v1.9.0

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

MarshalJSON implements the json.Marshaler interface.

func (*Int32) UnmarshalJSON added in v1.9.0

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

UnmarshalJSON implements the json.Unmarshaler interface.

type Int64 added in v1.5.0

type Int64 struct {
	sql.NullInt64
}

Int64 is a nullable int64.

func NewInt64 added in v1.5.0

func NewInt64(i int64, valid bool) Int64

NewInt64 returns a new Int64.

func (Int64) MarshalJSON added in v1.5.0

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

MarshalJSON implements the json.Marshaler interface.

func (*Int64) UnmarshalJSON added in v1.5.0

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

UnmarshalJSON implements the json.Unmarshaler interface.

type String

type String struct {
	sql.NullString
}

String is a nullable string.

func NewString

func NewString(s string, valid bool) String

NewString returns a new String.

func (String) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface.

func (String) MarshalYAML added in v1.3.0

func (n String) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface.

func (*String) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaler interface.

func (*String) UnmarshalYAML added in v1.3.0

func (n *String) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Timestamp added in v1.2.0

type Timestamp struct {
	Timestamp timeutil.Timestamp
	Valid     bool
}

Timestamp is a nullable github.com/m0t0k1ch1-go/timeutil.Timestamp.

func NewTimestamp added in v1.2.0

func NewTimestamp(ts timeutil.Timestamp, valid bool) Timestamp

NewTimestamp returns a new Timestamp.

func (Timestamp) MarshalJSON added in v1.2.0

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

MarshalJSON implements the json.Marshaler interface.

func (Timestamp) NullableString added in v1.2.0

func (n Timestamp) NullableString() String

NullableString returns the String.

func (*Timestamp) Scan added in v1.2.0

func (n *Timestamp) Scan(src any) error

Scan implements the sql.Scanner interface.

func (*Timestamp) UnmarshalJSON added in v1.2.0

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

UnmarshalJSON implements the json.Unmarshaler interface.

func (Timestamp) Value added in v1.2.0

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

Value implements the driver.Valuer interface.

type Uint256 added in v1.1.0

type Uint256 struct {
	Uint256 bigutil.Uint256
	Valid   bool
}

Uint256 is a nullable github.com/m0t0k1ch1-go/bigutil.Uint256.

func NewUint256 added in v1.1.0

func NewUint256(i bigutil.Uint256, valid bool) Uint256

NewUint256 returns a new Uint256.

func (Uint256) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaler interface.

func (Uint256) NullableString added in v1.1.0

func (n Uint256) NullableString() String

NullableString returns the String.

func (*Uint256) Scan added in v1.1.0

func (n *Uint256) Scan(src any) error

Scan implements the sql.Scanner interface.

func (*Uint256) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaler interface.

func (Uint256) Value added in v1.1.0

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

Value implements the driver.Valuer interface.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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