Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HasTrinary ¶
type HasTrinary interface {
ToTrinary() Value
}
type IsUndefined ¶
type IsUndefined interface {
IsUndefined() bool
}
type Value ¶
type Value int
Value represents a trinary outcome: True, False, or Unknown.
func From ¶
From coerces any Go value into a trinary Value:
- nil or IsUndefined → Unknown
- HasTrinary / Value → delegates directly
- bool → True/False
- numeric primitives (int/uint/float families) → True when != 0
- string → textual keywords first, otherwise True when len > 0
- pointers and interfaces → dereference once and retry
- reflected string/slice/array/map kinds → reuse the string/len rules
- everything else defaults to True (non-nil structs, etc.)
func Parse ¶
Parse parses a string into a trinary value. It converts:
- 1, t, T, TRUE, true, True => True
- 0, f, F, FALSE, false, False => False
- -1, n, N, UNKNOWN, unknown, Unknown => Unknown
Any other value returns Unknown.
func (Value) And ¶
And implements tri-state AND using Kleene logic. | **AND** | **True** | **False** | **Unknown** | | ----------- | -------- | --------- | ----------- | | **True** | True | False | Unknown | | **False** | False | False | False | | **Unknown** | Unknown | False | Unknown |
func (Value) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.