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 ¶
- func Convert[T any](holder interface{}, p *pointerValue[T], v reflect.Value) error
- func TimespanString(d time.Duration) string
- func TryConvert[T any](holder interface{}, p *pointerValue[T], v reflect.Value) bool
- type Bool
- type DateTime
- type Decimal
- func (d *Decimal) Convert(v reflect.Value) error
- func (d *Decimal) GetType() types.Column
- func (p *Decimal) GetValue() interface{}
- func (d *Decimal) ParseFloat(base int, prec uint, mode big.RoundingMode) (f *big.Float, b int, err error)
- func (p *Decimal) Ptr() *T
- func (p *Decimal) String() string
- func (d *Decimal) Unmarshal(i interface{}) error
- type Dynamic
- type GUID
- type Int
- type Kusto
- type Long
- type Real
- type String
- type Timespan
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimespanString ¶
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool represents a Kusto boolean type. Bool implements Kusto.
func NewNullBool ¶
func NewNullBool() *Bool
type DateTime ¶
type DateTime struct {
// contains filtered or unexported fields
}
DateTime represents a Kusto datetime type. DateTime implements Kusto.
func NewNullDateTime ¶
func NewNullDateTime() *DateTime
NewNullDateTime creates a new null DateTime.
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
Decimal represents a Kusto decimal type. Decimal implements Kusto.
func DecimalFromFloat ¶
func DecimalFromString ¶
func NewDecimal ¶
func NewNullDecimal ¶
func NewNullDecimal() *Decimal
type Dynamic ¶
type Dynamic struct {
Value []byte
}
Dynamic represents a Kusto dynamic type. Dynamic implements Kusto.
func DynamicFromInterface ¶
func DynamicFromInterface(v interface{}) *Dynamic
type GUID ¶
type GUID struct {
// contains filtered or unexported fields
}
GUID represents a Kusto GUID type. GUID implements Kusto.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int represents a Kusto boolean type. Bool implements Kusto.
func NewNullInt ¶
func NewNullInt() *Int
type Kusto ¶
type Kusto interface { fmt.Stringer Convert(v reflect.Value) error GetValue() interface{} GetType() types.Column Unmarshal(interface{}) error }
Kusto represents a Kusto value.
type Long ¶
type Long struct {
// contains filtered or unexported fields
}
Long represents a Kusto long type, which is an int64. Long implements Kusto.
func NewNullLong ¶
func NewNullLong() *Long
type Real ¶
type Real struct {
// contains filtered or unexported fields
}
Real represents a Kusto real type. Real implements Kusto.
func NewNullReal ¶
func NewNullReal() *Real
type String ¶
type String struct { // Value holds the value of the type. Value string }
String represents a Kusto string type. String implements Kusto.
type Timespan ¶
type Timespan struct {
// contains filtered or unexported fields
}
Timespan represents a Kusto timespan type. Timespan implements Kusto.
func NewNullTimespan ¶
func NewNullTimespan() *Timespan
func NewTimespan ¶
func TimespanFromString ¶
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 .