Documentation
¶
Index ¶
- Constants
- func NewIterativeDataset(ctx context.Context, r io.ReadCloser, ioCapacity int, rowCapacity int, ...) (query.IterativeDataset, error)
- func NewIterativeTable(dataset *iterativeDataset, th TableHeader) (query.IterativeTable, error)
- type DataSetCompletion
- type DataSetHeader
- type DataTable
- type ErrorContext
- type ErrorMessage
- type FrameColumn
- type FrameType
- type OneApiError
- type QueryCompletionInformation
- type QueryProperties
- type TableCompletion
- type TableFragment
- type TableHeader
Constants ¶
const DefaultIoCapacity = 1
DefaultIoCapacity is the default capacity of the channel that receives frames from the Kusto service. Lower capacity means less memory usage, but might cause the channel to block if the frames are not consumed fast enough.
const DefaultRowCapacity = 1000
const DefaultTableCapacity = 1
const PrimaryResultTableKind = "PrimaryResult"
const QueryCompletionInformationKind = "QueryCompletionInformation"
const QueryPropertiesKind = "QueryProperties"
Variables ¶
This section is empty.
Functions ¶
func NewIterativeDataset ¶
func NewIterativeDataset(ctx context.Context, r io.ReadCloser, ioCapacity int, rowCapacity int, tableCapacity int) (query.IterativeDataset, error)
NewIterativeDataset creates a new IterativeDataset from a ReadCloser. ioCapacity is the amount of buffered rows to keep in memory. tableCapacity is the amount of tables to buffer. rowCapacity is the amount of rows to buffer per table.
func NewIterativeTable ¶
func NewIterativeTable(dataset *iterativeDataset, th TableHeader) (query.IterativeTable, error)
Types ¶
type DataSetCompletion ¶
type DataSetCompletion struct { HasErrors bool Cancelled bool OneApiErrors []OneApiError }
type DataSetHeader ¶
type DataTable ¶
type DataTable struct { Header TableHeader Rows []query.Row }
func (*DataTable) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for DataTable. A DataTable is "just" a TableHeader and TableFragment, so we can reuse the existing functions.
type ErrorContext ¶
type ErrorContext struct { Timestamp string `json:"timestamp"` ServiceAlias string `json:"serviceAlias"` MachineName string `json:"machineName"` ProcessName string `json:"processName"` ProcessId int `json:"processId"` ThreadId int `json:"threadId"` ClientRequestId string `json:"clientRequestId"` ActivityId string `json:"activityId"` SubActivityId string `json:"subActivityId"` ActivityType string `json:"activityType"` ParentActivityId string `json:"parentActivityId"` ActivityStack string `json:"activityStack"` }
func (*ErrorContext) String ¶
func (e *ErrorContext) String() string
type ErrorMessage ¶
type ErrorMessage struct { Code string `json:"code"` Message string `json:"message"` Description string `json:"@message"` Type string `json:"@type"` Context ErrorContext `json:"@context"` IsPermanent bool `json:"@permanent"` }
func (*ErrorMessage) String ¶
func (e *ErrorMessage) String() string
type FrameColumn ¶
type FrameColumn struct { ColumnIndex int `json:"-"` ColumnName string `json:"ColumnName"` ColumnType string `json:"ColumnType"` }
func (FrameColumn) Index ¶
func (f FrameColumn) Index() int
func (FrameColumn) Name ¶
func (f FrameColumn) Name() string
func (FrameColumn) Type ¶
func (f FrameColumn) Type() types.Column
type FrameType ¶
type FrameType string
const ( DataSetHeaderFrameType FrameType = "DataSetHeader" DataTableFrameType FrameType = "DataTable" TableHeaderFrameType FrameType = "TableHeader" TableFragmentFrameType FrameType = "TableFragment" TableCompletionFrameType FrameType = "TableCompletion" DataSetCompletionFrameType FrameType = "DataSetCompletion" )
type OneApiError ¶
type OneApiError struct {
ErrorMessage ErrorMessage `json:"error"`
}
func (*OneApiError) Error ¶
func (e *OneApiError) Error() string
func (*OneApiError) String ¶
func (e *OneApiError) String() string
type QueryCompletionInformation ¶
type QueryCompletionInformation struct { Timestamp time.Time ClientRequestId string ActivityId uuid.UUID SubActivityId uuid.UUID ParentActivityId uuid.UUID Level int LevelName string StatusCode int StatusCodeName string EventType int EventTypeName string Payload string }
QueryCompletionInformation represents the query completion information table, which arrives after the last result.
func AsQueryCompletionInformation ¶
func AsQueryCompletionInformation(table query.BaseTable) ([]QueryCompletionInformation, error)
type QueryProperties ¶
QueryProperties represents the query properties table, which arrives before the first result.
func AsQueryProperties ¶
func AsQueryProperties(table query.BaseTable) ([]QueryProperties, error)
type TableCompletion ¶
type TableCompletion struct { TableId int RowCount int OneApiErrors []OneApiError }
type TableFragment ¶
func (*TableFragment) UnmarshalJSON ¶
func (t *TableFragment) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for TableFragment. See decodeTableFragment for further explanation.
type TableHeader ¶
func (*TableHeader) UnmarshalJSON ¶
func (t *TableHeader) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for DataSetHeader. We need to decode this manually to set the correct Columns, in order to save on allocations later on.