optional

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NullInt    = Null[int]()
	NullString = Null[string]()
	NullBool   = Null[bool]()
	NullFloat  = Null[float64]()
)

Functions

This section is empty.

Types

type Bool added in v0.0.7

type Bool = Value[bool]

type Float added in v0.0.7

type Float = Value[float64]

type Int

type Int = Value[int]

type String added in v0.0.7

type String = Value[string]

type Value

type Value[T any] struct {
	Value  T
	Exists bool
}

func FromAny added in v0.0.7

func FromAny[T any](value any) Value[T]

func New

func New[T any](value T) Value[T]

func NewBool added in v0.0.7

func NewBool(value bool) Value[bool]

func NewFloat added in v0.0.7

func NewFloat(value float64) Value[float64]

func NewInt added in v0.0.7

func NewInt(value int) Value[int]

func NewString added in v0.0.7

func NewString(value string) Value[string]

func Null

func Null[T any]() Value[T]

func (Value[T]) MarshalJSON added in v0.0.7

func (v Value[T]) MarshalJSON() ([]byte, error)

func (*Value[T]) UnmarshalJSON added in v0.0.7

func (v *Value[T]) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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