Documentation
¶
Overview ¶
Code below generated from scalar_gen.go.tmpl
Index ¶
- Variables
- type ActualBigIntFn
- type ActualBitBufFn
- type ActualBoolFn
- type ActualFFn
- type ActualSFn
- type ActualStrFn
- type ActualUFn
- type BoolToDescription
- type BoolToScalar
- type BoolToSymBool
- type BoolToSymF
- type BoolToSymS
- type BoolToSymStr
- type BoolToSymU
- type BytesToScalar
- type DisplayFormat
- type Fn
- type Mapper
- func Actual(v any) Mapper
- func Description(v string) Mapper
- func DescriptionActualSTime(epoch time.Time, format string) Mapper
- func DescriptionActualUTime(epoch time.Time, format string) Mapper
- func DescriptionSymSTime(epoch time.Time, format string) Mapper
- func DescriptionSymUTime(epoch time.Time, format string) Mapper
- func Sym(v any) Mapper
- func SymFParseFloat(base int) Mapper
- func SymSParseInt(base int) Mapper
- func SymUParseUint(base int) Mapper
- func TrySymFParseFloat(base int) Mapper
- func TrySymSParseInt(base int) Mapper
- func TrySymUParseUint(base int) Mapper
- type S
- func (s S) ActualBigInt() *big.Int
- func (s S) ActualBitBuf() bitio.ReaderAtSeeker
- func (s S) ActualBool() bool
- func (s S) ActualF() float64
- func (s S) ActualS() int64
- func (s S) ActualStr() string
- func (s S) ActualU() uint64
- func (s S) SymBigInt() *big.Int
- func (s S) SymBitBuf() bitio.ReaderAtSeeker
- func (s S) SymBool() bool
- func (s S) SymF() float64
- func (s S) SymS() int64
- func (s S) SymStr() string
- func (s S) SymU() uint64
- func (s S) Value() any
- type SRangeEntry
- type SRangeToScalar
- type SToDescription
- type SToScalar
- type SToSymBool
- type SToSymF
- type SToSymS
- type SToSymStr
- type SToSymU
- type StrToDescription
- type StrToScalar
- type StrToSymBool
- type StrToSymF
- type StrToSymS
- type StrToSymStr
- type StrToSymU
- type SymBigIntFn
- type SymBitBufFn
- type SymBoolFn
- type SymFFn
- type SymSFn
- type SymStrFn
- type SymUFn
- type URangeEntry
- type URangeToScalar
- type UToDescription
- type UToScalar
- type UToSymBool
- type UToSymF
- type UToSymS
- type UToSymStr
- type UToSymU
Constants ¶
This section is empty.
Variables ¶
var ActualBin = Fn(func(s S) (S, error) { s.ActualDisplay = NumberBinary; return s, nil })
var ActualDec = Fn(func(s S) (S, error) { s.ActualDisplay = NumberDecimal; return s, nil })
var ActualOct = Fn(func(s S) (S, error) { s.ActualDisplay = NumberOctal; return s, nil })
var ActualTrimSpace = ActualStrFn(strings.TrimSpace)
var DescriptionActualSUnixTime = DescriptionActualSTime(unixTimeEpochDate, time.RFC3339)
var DescriptionActualUUnixTime = DescriptionActualUTime(unixTimeEpochDate, time.RFC3339)
var DescriptionSymSUnixTime = DescriptionSymSTime(unixTimeEpochDate, time.RFC3339)
var DescriptionSymUUnixTime = DescriptionSymUTime(unixTimeEpochDate, time.RFC3339)
var RawHex = Fn(func(s S) (S, error) { return RawSym(s, -1, func(b []byte) string { return fmt.Sprintf("%x", b) }) })
var RawUUID = Fn(func(s S) (S, error) { return RawSym(s, -1, func(b []byte) string { return fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) }) })
var SymBin = Fn(func(s S) (S, error) { s.SymDisplay = NumberBinary; return s, nil })
var SymDec = Fn(func(s S) (S, error) { s.SymDisplay = NumberDecimal; return s, nil })
var SymOct = Fn(func(s S) (S, error) { s.SymDisplay = NumberOctal; return s, nil })
Functions ¶
This section is empty.
Types ¶
type ActualBigIntFn ¶ added in v0.0.8
ActualBigIntFn map actual BigInt using f
type ActualBitBufFn ¶ added in v0.0.8
type ActualBitBufFn func(a bitio.ReaderAtSeeker) bitio.ReaderAtSeeker
ActualBitBufFn map actual BitBuf using f
type ActualBoolFn ¶ added in v0.0.8
ActualBoolFn map actual Bool using f
type ActualStrFn ¶ added in v0.0.8
ActualStrFn map actual Str using f
func ActualTrim ¶ added in v0.0.8
func ActualTrim(cutset string) ActualStrFn
type BoolToDescription ¶ added in v0.0.7
Map Bool -> Description
type BoolToScalar ¶
Map Bool -> Scalar
type BoolToSymBool ¶
Map Bool -> Sym Bool
type BoolToSymF ¶
Map Bool -> Sym F
type BoolToSymS ¶
Map Bool -> Sym S
type BoolToSymStr ¶
Map Bool -> Sym Str
type BoolToSymU ¶
Map Bool -> Sym U
type BytesToScalar ¶
type DisplayFormat ¶
type DisplayFormat int
const ( NumberDecimal DisplayFormat = iota NumberBinary NumberOctal NumberHex )
func (DisplayFormat) FormatBase ¶
func (df DisplayFormat) FormatBase() int
type Mapper ¶
func Description ¶
func DescriptionActualSTime ¶ added in v0.0.8
func DescriptionActualUTime ¶ added in v0.0.8
func DescriptionSymSTime ¶ added in v0.0.8
func DescriptionSymUTime ¶ added in v0.0.8
func SymFParseFloat ¶ added in v0.0.8
func SymSParseInt ¶ added in v0.0.8
func SymUParseUint ¶ added in v0.0.8
func TrySymFParseFloat ¶ added in v0.0.9
func TrySymSParseInt ¶ added in v0.0.9
func TrySymUParseUint ¶ added in v0.0.9
type S ¶
type S struct { Actual any // nil, int, int64, uint64, float64, string, bool, []byte, *bit.Int, bitio.BitReaderAtSeeker, ActualDisplay DisplayFormat Sym any SymDisplay DisplayFormat Description string Unknown bool }
func (S) ActualBigInt ¶ added in v0.0.4
ActualBigInt asserts actual value is a BigInt and returns it
func (S) ActualBitBuf ¶
func (s S) ActualBitBuf() bitio.ReaderAtSeeker
ActualBitBuf asserts actual value is a BitBuf and returns it
func (S) ActualBool ¶
ActualBool asserts actual value is a Bool and returns it
func (S) SymBitBuf ¶
func (s S) SymBitBuf() bitio.ReaderAtSeeker
SymBitBuf asserts symbolic value is a BitBuf and returns it
type SRangeEntry ¶ added in v0.0.3
SRangeToScalar maps ranges to a scalar, first in range is chosen
type SRangeToScalar ¶
type SRangeToScalar []SRangeEntry
SRangeToScalar maps sint64 ranges to a scalar, first in range is chosen
type SToDescription ¶ added in v0.0.7
Map S -> Description
type SToSymBool ¶
Map S -> Sym Bool
type StrToDescription ¶ added in v0.0.7
Map Str -> Description
type StrToScalar ¶
Map Str -> Scalar
type StrToSymBool ¶
Map Str -> Sym Bool
type StrToSymStr ¶
Map Str -> Sym Str
type SymBigIntFn ¶ added in v0.0.8
SymBigIntFn map sym BigInt using f
type SymBitBufFn ¶ added in v0.0.8
type SymBitBufFn func(a bitio.ReaderAtSeeker) bitio.ReaderAtSeeker
SymBitBufFn map sym BitBuf using f
type URangeEntry ¶ added in v0.0.3
type URangeToScalar ¶
type URangeToScalar []URangeEntry
URangeToScalar maps uint64 ranges to a scalar, first in range is chosen
type UToDescription ¶ added in v0.0.7
Map U -> Description
type UToSymBool ¶
Map U -> Sym Bool