nullable

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

README

nullable

Helper library for nullable primitive types. Provides helper methods for null-safety checks and conversions to other type systems, such as sql nullables

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolOf added in v0.2.0

func BoolOf(val NBool) bool

func DerefBool

func DerefBool(b NBool) (bool, bool)

func DerefInt

func DerefInt(i NInt) (int, bool)

func DerefString

func DerefString(s NString) (string, bool)

func DerefTime

func DerefTime(t NTime) (time.Time, bool)

func IntOf added in v0.2.0

func IntOf(val NInt) int

func SqlString

func SqlString(s NString) sql.NullString

func StringOf added in v0.2.0

func StringOf(val NString) string

func TimeAsPointer

func TimeAsPointer(t NTime) *time.Time

func TimeOf added in v0.2.0

func TimeOf(val NTime) time.Time

Types

type NBool

type NBool *bool

func Bool

func Bool(val bool) NBool

type NInt

type NInt *int

func Int

func Int(val int) NInt

type NString

type NString *string

func String

func String(val string) NString

func StringOrNilIfEmpty added in v0.2.0

func StringOrNilIfEmpty(val string) NString

type NTime

type NTime *time.Time

func Time

func Time(val time.Time) NTime

func TimeOrNilIfEmpty added in v0.2.0

func TimeOrNilIfEmpty(val time.Time) NTime

Jump to

Keyboard shortcuts

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