Documentation ¶
Overview ¶
Package optional has optional types and functions used by Agent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
Option represents an optional type. By default, no value is set and a call to Get() returns (T{}, false)
func MapOption ¶
MapOption returns fct(value) if a value is set, otherwise it returns NewNoneOption[T2]().
func NewNoneOption ¶
NewNoneOption creates a new instance of Option[T] without any value set.
func NewOption ¶
NewOption creates a new instance of Option[T] with a value set. A call to Get() will returns (value, true)
func (*Option[T]) Get ¶
Get returns the value and true if a value is set, otherwise it returns (undefined, false).
func (*Option[T]) UnmarshalYAML ¶
UnmarshalYAML unmarshals an Option[T] from YAML
Click to show internal directories.
Click to hide internal directories.