nullable

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 7 Imported by: 0

README

nullable

go nullable type for database/sql and encoding/json, this is not monadic library

alternatives

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type[T constraint] struct {
	Valid bool
	// contains filtered or unexported fields
}

func New

func New[T constraint](value T) Type[T]

func (Type[T]) MarshalJSON

func (t Type[T]) MarshalJSON() ([]byte, error)

for encoding/json.Marshaler

func (*Type[T]) Scan

func (t *Type[T]) Scan(value any) error

for database/sql.Scanner

func (*Type[T]) UnmarshalJSON

func (t *Type[T]) UnmarshalJSON(b []byte) error

for encoding/json.Unmarshaler

func (Type[T]) Value

func (t Type[T]) Value() (driver.Value, error)

for database/sql/driver.Valuer

Jump to

Keyboard shortcuts

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