gov

package module
v1.0.1-test Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State uint8
const (
	StateNone State = iota
	StateNil
	StateFilled
)

type Value

type Value[T any] struct {
	// contains filtered or unexported fields
}

func Filled

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

func Nil

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

func None

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

func Pointer

func Pointer[T any](ptr *T, noneOnNil ...bool) Value[T]

func When

func When[T any](value T, ok bool, noneOnFalse ...bool) Value[T]

func (Value[T]) AsPointer

func (v Value[T]) AsPointer() *T

func (Value[T]) Filled

func (v Value[T]) Filled() bool

func (Value[T]) Get

func (v Value[T]) Get() (_ T, _ bool)

func (Value[T]) GetOr

func (v Value[T]) GetOr(fallback T) T

func (Value[T]) GetOrZero

func (v Value[T]) GetOrZero() (_ T)

func (Value[T]) IsZero

func (v Value[T]) IsZero() bool

func (Value[T]) MarshalJSON

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

func (Value[T]) Nil

func (v Value[T]) Nil() bool

func (Value[T]) Present

func (v Value[T]) Present() bool

func (*Value[T]) Scan

func (v *Value[T]) Scan(src any) error

func (Value[T]) State

func (v Value[T]) State() State

func (*Value[T]) UnmarshalJSON

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

func (Value[T]) Value

func (v Value[T]) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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