null

package
v0.33.19 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 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]

func NewBool added in v0.27.6

func NewBool(v bool) Bool

type Bytes added in v0.23.7

type Bytes = Null[[]byte]

func NewBytes added in v0.27.6

func NewBytes(v []byte) Bytes

type Float32 added in v0.23.7

type Float32 = Null[float32]

func NewFloat32 added in v0.27.6

func NewFloat32(v float32) Float32

type Float64 added in v0.23.7

type Float64 = Null[float64]

func NewFloat64 added in v0.27.6

func NewFloat64(v float64) Float64

type Int added in v0.23.7

type Int = Null[int]

func NewInt added in v0.27.6

func NewInt(v int) Int

type Int16 added in v0.23.7

type Int16 = Null[int16]

func NewInt16 added in v0.27.6

func NewInt16(v int16) Int16

type Int32 added in v0.23.7

type Int32 = Null[int32]

func NewInt32 added in v0.27.6

func NewInt32(v int32) Int32

type Int64 added in v0.23.7

type Int64 = Null[int64]

func NewInt64 added in v0.27.6

func NewInt64(v int64) Int64

type Int8 added in v0.23.7

type Int8 = Null[int8]

func NewInt8 added in v0.27.6

func NewInt8(v int8) 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]

func NewString added in v0.27.6

func NewString(v string) String

type Uint added in v0.23.7

type Uint = Null[uint]

func NewUint added in v0.27.6

func NewUint(v uint) Uint

type Uint16 added in v0.23.7

type Uint16 = Null[uint16]

func NewUint16 added in v0.27.6

func NewUint16(v uint16) Uint16

type Uint32 added in v0.23.7

type Uint32 = Null[uint32]

func NewUint32 added in v0.27.6

func NewUint32(v uint32) Uint32

type Uint64 added in v0.23.7

type Uint64 = Null[uint64]

func NewUint64 added in v0.27.6

func NewUint64(v uint64) Uint64

type Uint8 added in v0.23.7

type Uint8 = Null[uint8]

func NewUint8 added in v0.27.6

func NewUint8(v uint8) Uint8

Jump to

Keyboard shortcuts

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