Documentation ¶
Overview ¶
Package value holds Kusto data value representations. All types provide a Kusto that stores the native value and Valid which indicates if the value was set or was null.
Kusto Value ¶
A value.Kusto can hold types that represent Kusto Scalar types that define column data. We represent that with an interface:
type Kusto interface
This interface can hold the following values:
value.Bool value.Int value.Long value.Real value.Decimal value.String value.Dynamic value.DateTime value.Timespan
Each type defined above has at minimum two fields:
.Value - The type specific value .Valid - True if the value was non-null in the Kusto table
Each provides at minimum the following two methods:
.String() - Returns the string representation of the value. .Unmarshal() - Unmarshals the value into a standard Go type.
The Unmarshal() is for internal use, it should not be needed by an end user. Use .Value or table.Row.ToStruct() instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DecRE = regexp.MustCompile(`^((\d+\.?\d*)|(\d*\.?\d+))$`) // Matches decimal numbers, with or without decimal dot, with optional parts missing.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool struct { // Value holds the value of the type. Value bool // Valid indicates if this value was set. Valid bool }
Bool represents a Kusto boolean type. Bool implements Kusto.
type DateTime ¶
type DateTime struct { // Value holds the value of the type. Value time.Time // Valid indicates if this value was set. Valid bool }
DateTime represents a Kusto datetime type. DateTime implements Kusto.
type Decimal ¶
type Decimal struct { // Value holds the value of the type. Value string // Valid indicates if this value was set. Valid bool }
Decimal represents a Kusto decimal type. Decimal implements Kusto. Because Go does not have a dynamic decimal type that meets all needs, Decimal provides the string representation for you to unmarshal into.
type Dynamic ¶
type Dynamic struct { // Value holds the value of the type. Value []byte // Valid indicates if this value was set. Valid bool }
Dynamic represents a Kusto dynamic type. Dynamic implements Kusto.
type GUID ¶
type GUID struct { // Value holds the value of the type. Value uuid.UUID // Valid indicates if this value was set. Valid bool }
GUID represents a Kusto GUID type. GUID implements Kusto.
type Int ¶
type Int struct { // Value holds the value of the type. Value int32 // Valid indicates if this value was set. Valid bool }
Int represents a Kusto int type. Values int type's are int32 values. Int implements Kusto.
type Kusto ¶
type Kusto interface { // String implements fmt.Stringer(). String() string // Convert into reflect value. Convert(v reflect.Value) error // contains filtered or unexported methods }
Kusto represents a Kusto value.
type Long ¶
type Long struct { // Value holds the value of the type. Value int64 // Valid indicates if this value was set. Valid bool }
Long represents a Kusto long type, which is an int64. Long implements Kusto.
type Real ¶
type Real struct { // Value holds the value of the type. Value float64 // Valid indicates if this value was set. Valid bool }
Real represents a Kusto real type. Real implements Kusto.
type String ¶
type String struct { // Value holds the value of the type. Value string // Valid indicates if this value was set. Valid bool }
String represents a Kusto string type. String implements Kusto.
type Timespan ¶
type Timespan struct { // Value holds the value of the type. Value time.Duration // Valid indicates if this value was set. Valid bool }
Timespan represents a Kusto timespan type. Timespan implements Kusto.
func (Timespan) Marshal ¶
Marshal marshals the Timespan into a Kusto compatible string. The string is the contant invariant(c) format. See https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings .