Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertGoType(v interface{}, dataType string) (interface{}, error)
- func DataTypeFromInterface(v interface{}) string
- func Flatten(v any) (string, error)
- func FloatToString(f float64) string
- func IsBlock(b []byte) bool
- func IsBlockRune(r []rune) bool
- func IsTrue(stdout []byte, exitNum int) bool
- func IsTrueString(stdout string, exitNum int) bool
- func MapToTable(v []interface{}, callback func([]string) error) error
- func Table2Map(v [][]string, callback func(map[string]any) error) error
Constants ¶
const ( // ErrDataTypeDefaulted is returned if the murex data type is unknown ErrDataTypeDefaulted = "unexpected or unknown murex data type" // ErrUnexpectedGoType is returned if the Go data type is unhandled ErrUnexpectedGoType = "unexpected Go type" )
const ( Any = "@Any" Text = "@Text" Math = "@Math" Unmarshal = "@Unmarshal" Marshal = "@Marshal" ReadArray = "@ReadArray" ReadArrayWithType = "@ReadArrayWithType" WriteArray = "@WriteArray" ReadIndex = "@ReadIndex" ReadNotIndex = "@ReadNotIndex" ReadMap = "@ReadMap" )
These are the different supported type groups
const ( Generic = "*" Null = "null" Die = "die" Boolean = "bool" String = "str" Columns = "columns" Binary = "bin" CodeBlock = "block" Json = "json" JsonLines = "jsonl" Number = "num" Integer = "int" Float = "float" Path = "path" Paths = "paths" )
These are only a list of the base types. Others can be added via builtins or during runtime. However their behavior will default to string (str).
const FalseString = "false"
FalseString is `false` boolean value
const TrueString = "true"
TrueString is `true` boolean value
Variables ¶
var FalseByte = []byte(FalseString)
FalseByte is `false` as a []byte slice
GroupMath is an array of the data types that make up the `math` type
var GroupText = []string{ Generic, String, `generic`, `string`, }
GroupText is an array of the data types that make up the `text` type
var TrueByte = []byte(TrueString)
TrueByte is `true` as a []byte slice
Functions ¶
func ConvertGoType ¶
ConvertGoType converts a Go lang variable into a murex variable
func DataTypeFromInterface ¶
func DataTypeFromInterface(v interface{}) string
DataTypeFromInterface returns the Murex data-type expected to be associated with any specific Go data type.
func Flatten ¶
Flatten takes anything that should look like a string, and turns it into a single string type.
func FloatToString ¶
FloatToString convert a Float64 (what murex numbers are stored as) into a string. Typically for outputting to Stdout/Stderr.
func IsBlockRune ¶
IsBlockRune checks if the []rune slice is a code or JSON block
func IsTrue ¶
IsTrue checks if a process has returned a `true` state. This will check a few conditions as not every external process will return a non-zero exit number on a failure.
func IsTrueString ¶
func MapToTable ¶
Types ¶
This section is empty.