conversion

package
v1.0.0-alpha8 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

package conversion defines conversion helpers for code generated by github.com/ngicks/go-codegen/codegen

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LenNAtLeast

func LenNAtLeast[Opts ~[]T, T any](n int, u und.Und[Opts]) und.Und[Opts]

func LenNAtLeastSlice

func LenNAtLeastSlice[Opts ~[]T, T any](n int, u sliceund.Und[Opts]) sliceund.Und[Opts]

func LenNAtMost

func LenNAtMost[Opts ~[]T, T any](n int, u und.Und[Opts]) und.Und[Opts]

func LenNAtMostSlice

func LenNAtMostSlice[Opts ~[]T, T any](n int, u sliceund.Und[Opts]) sliceund.Und[Opts]

func NonNull

func NonNull[Opts ~[]option.Option[T], T any](u und.Und[Opts]) und.Und[[]T]

func NonNullSlice

func NonNullSlice[Opts ~[]option.Option[T], T any](u sliceund.Und[Opts]) sliceund.Und[[]T]

func Nullify

func Nullify[T any](u und.Und[[]T]) und.Und[[]option.Option[T]]

func NullifySlice

func NullifySlice[T any](u sliceund.Und[[]T]) sliceund.Und[[]option.Option[T]]

func NullishElastic

func NullishElastic[T any](o option.Option[Empty]) elastic.Elastic[T]

func NullishElasticSlice

func NullishElasticSlice[T any](o option.Option[Empty]) sliceelastic.Elastic[T]

func NullishUnd

func NullishUnd[T any](o option.Option[Empty]) und.Und[T]

func NullishUndSlice

func NullishUndSlice[T any](o option.Option[Empty]) sliceund.Und[T]

func OptionOptionElastic

func OptionOptionElastic[T any](null bool, o option.Option[[]option.Option[T]]) elastic.Elastic[T]

func OptionOptionElasticSlice

func OptionOptionElasticSlice[T any](null bool, o option.Option[[]option.Option[T]]) sliceelastic.Elastic[T]

func OptionUnd

func OptionUnd[T any](null bool, o option.Option[T]) und.Und[T]

func OptionUndSlice

func OptionUndSlice[T any](null bool, o option.Option[T]) sliceund.Und[T]

func ToPlain

func ToPlain[T interface{ UndPlain() U }, U any](t T) U

func ToRaw

func ToRaw[T interface{ UndRaw() U }, U any](t T) U

func UndNullish

func UndNullish[T UndLike](t T) option.Option[Empty]

func UnwrapElastic

func UnwrapElastic[T any](e elastic.Elastic[T]) und.Und[[]option.Option[T]]

func UnwrapElasticSlice

func UnwrapElasticSlice[T any](e sliceelastic.Elastic[T]) sliceund.Und[[]option.Option[T]]

func UnwrapLen1

func UnwrapLen1[T any](u und.Und[[1]T]) und.Und[T]

func UnwrapLen1Slice

func UnwrapLen1Slice[T any](u sliceund.Und[[1]T]) sliceund.Und[T]

func WrapLen1

func WrapLen1[T any](u und.Und[T]) und.Und[[1]T]

func WrapLen1Slice

func WrapLen1Slice[T any](u sliceund.Und[T]) sliceund.Und[[1]T]

Types

type Empty

type Empty []struct{}

func (Empty) IsZero

func (e Empty) IsZero() bool

IsZero always returns true.

func (Empty) MarshalJSON

func (e Empty) MarshalJSON() ([]byte, error)

func (*Empty) UnmarshalJSON

func (e *Empty) UnmarshalJSON(data []byte) error

type UndLike

type UndLike = undtag.UndLike

Jump to

Keyboard shortcuts

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