null

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: AGPL-3.0, AGPL-3.0-only Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NilString

func NilString(s string) *string

func NilUint16

func NilUint16(i uint16) *uint16

func NilUint8

func NilUint8(i uint8) *uint8

Types

type Bool added in v0.23.7

type Bool = Null[bool]

type Bytes added in v0.23.7

type Bytes = Null[[]byte]

type Float32 added in v0.23.7

type Float32 = Null[float32]

type Float64 added in v0.23.7

type Float64 = Null[float64]

type Int added in v0.23.7

type Int = Null[int]

type Int16 added in v0.23.7

type Int16 = Null[int16]

type Int32 added in v0.23.7

type Int32 = Null[int32]

type Int64 added in v0.23.7

type Int64 = Null[int64]

type Int8 added in v0.23.7

type Int8 = Null[int8]

type Null added in v0.23.7

type Null[T any] struct {
	Value T
	Set   bool
}

Null is a nullable type.

func New added in v0.23.7

func New[T any](t T) Null[T]

func NewFromPtr added in v0.23.7

func NewFromPtr[T any](p *T) Null[T]

func (Null[T]) Default added in v0.23.7

func (t Null[T]) Default(v T) T

Default return default value its value is Null or not Set.

func (Null[T]) Interface added in v0.23.7

func (t Null[T]) Interface() any

func (Null[T]) Ptr added in v0.23.7

func (t Null[T]) Ptr() *T

func (*Null[T]) UnmarshalJSON added in v0.23.7

func (t *Null[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type String added in v0.23.7

type String = Null[string]

type Uint added in v0.23.7

type Uint = Null[uint]

type Uint16 added in v0.23.7

type Uint16 = Null[uint16]

type Uint32 added in v0.23.7

type Uint32 = Null[uint32]

type Uint64 added in v0.23.7

type Uint64 = Null[uint64]

type Uint8 added in v0.23.7

type Uint8 = Null[uint8]

Jump to

Keyboard shortcuts

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