Documentation
¶
Overview ¶
Package optional recognises functional.Option[T] by reflection, so that qrm and the SQL builder can handle it without importing pkg/functional.
This file is Nanostack-only (not in go-jet). See db/UPSTREAM.md.
Index ¶
Constants ¶
const PkgPath = "github.com/nanostack-dev/nanostack-framework/pkg/functional"
PkgPath is the import path of the package that declares Option.
Variables ¶
This section is empty.
Functions ¶
func Elem ¶
Elem reports whether t is functional.Option[E] and returns E.
The match is exact: a struct type named Option[...] declared in PkgPath. A structural rule (any type with IsPresent and Value) would also catch unrelated types, and a rename of Option breaks the match loudly in optional_test.go.
func ElemOrSelf ¶
ElemOrSelf returns E for Option[E] and t unchanged otherwise.
func Get ¶
Get returns the value of the Option held in v and whether it is present. It panics when v does not hold an Option.
Types ¶
This section is empty.