v2

package
v1.0.0-preview-5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
const DefaultRowCapacity = 1000
View Source
const DefaultTableCapacity = 1
View Source
const PrimaryResultTableKind = "PrimaryResult"
View Source
const QueryCompletionInformationKind = "QueryCompletionInformation"
View Source
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 DataSetHeader struct {
	IsProgressive           bool
	Version                 string
	IsFragmented            bool
	ErrorReportingPlacement string
}

type DataTable

type DataTable struct {
	Header TableHeader
	Rows   []query.Row
}

func (*DataTable) UnmarshalJSON

func (q *DataTable) UnmarshalJSON(b []byte) error

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

type QueryProperties struct {
	TableId int
	Key     string
	Value   map[string]interface{}
}

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

type TableFragment struct {
	Columns       []query.Column
	Rows          []query.Row
	PreviousIndex int
}

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

type TableHeader struct {
	TableId   int
	TableKind string
	TableName string
	Columns   []query.Column
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL