Documentation ¶
Overview ¶
Package table contains types that represent the makeup of a Kusto table.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { // Name is the name of the column. Name string `json:"ColumnName"` // Type is the type of value stored in this column. These are described // via constants starting with CT<type>. Type types.Column `json:"ColumnType"` }
Column describes a column descriptor.
type Row ¶
type Row struct { // ColumnType contains all the column type information for the row. ColumnTypes Columns // Values is the list of values that make up the row. Values value.Values // Op is the operation that resulted in the row. This is for internal use. Op errors.Op // Replace indicates whether the existing result set should be cleared and replaced with this row. Replace bool // contains filtered or unexported fields }
Row represents a row of Kusto data. Methods are not thread-safe.
func (*Row) ColumnNames ¶
ColumnNames returns a list of all column names.
func (*Row) Columns ¶
Columns fetches all column names in the row at once. The name of the kth column will be decoded into the kth argument to Columns. The number of arguments must be equal to the number of columns. Pass nil to specify that a column should be ignored. ptrs may be either the *string or *types.Column type. An error in decoding may leave some ptrs set and others not.
func (*Row) ExtractValues ¶ added in v0.6.0
ExtractValues fetches all values in the row at once. The value of the kth column will be decoded into the kth argument to ExtractValues. The number of arguments must be equal to the number of columns. Pass nil to specify that a column should be ignored. ptrs should be compatible with column types. An error in decoding may leave some ptrs set and others not.
func (*Row) String ¶
String implements fmt.Stringer for a Row. This simply outputs a CSV version of the row.
func (*Row) ToStruct ¶
ToStruct fetches the columns in a row into the fields of a struct. p must be a pointer to struct. The rules for mapping a row's columns into a struct's exported fields are:
If a field has a `kusto: "column_name"` tag, then decode column 'column_name' into the field. A special case is the `column_name: "-"` tag, which instructs ToStruct to ignore the field during decoding.
Otherwise, if the name of a field matches the name of a column (ignoring case), decode the column into the field.
Slice and pointer fields will be set to nil if the source column is a null value, and a non-nil value if the column is not NULL. To decode NULL values of other types, use one of the kusto types (Int, Long, Dynamic, ...) as the type of the destination field. You can check the .Valid field of those types to see if the value was set.