results

package
v0.5.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

*

This package is for all interfaces that are imported in multiple packages in the
code base

This package MUST never import any other `steampipe` package

*

Index

Constants

View Source
const (
	ControlOk      = "ok"
	ControlAlarm   = "alarm"
	ControlSkipped = "skipped"
	ControlInfo    = "info"
	ControlError   = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchmarkResult

type BenchmarkResult struct {
}

BenchmarkResult :: the result of a control run - will contain one or more result items (oi.e. for one or more resources)

type ControlResult

type ControlResult struct {
	Error error
	// any completed results items
	Results []*ControlResultItem
	// the parent control
	Control *modconfig.Control
	// contains filtered or unexported fields
}

ControlResult :: the result of a control run - will contain one or more result items (oi.e. for one or more resources)

func NewControlResult

func NewControlResult(control *modconfig.Control) *ControlResult

func (*ControlResult) Children

func (r *ControlResult) Children() []ControlResultTreeNode

Children :: implementation of ControlResultTreeNode

func (*ControlResult) Finished

func (r *ControlResult) Finished() bool

func (*ControlResult) GetStatus

func (r *ControlResult) GetStatus() ControlRunStatus

func (*ControlResult) SetError

func (r *ControlResult) SetError(err error)

func (*ControlResult) Start

func (r *ControlResult) Start(result *QueryResult)

func (*ControlResult) ValidateColumns

func (r *ControlResult) ValidateColumns(result *QueryResult) error

type ControlResultItem

type ControlResultItem struct {
	Reason   string
	Resource string
	Status   ControlStatus
	// the parent control
	Control *modconfig.Control
}

ControlResultItem :: the result of a control for a single resource

func NewControlResultItem

func NewControlResultItem(control *modconfig.Control, row *RowResult, colTypes []*sql.ColumnType) (*ControlResultItem, error)

type ControlResultTreeNode

type ControlResultTreeNode interface {
	Children() []ControlResultTreeNode
	Parent() BenchmarkResult
}

type ControlRunStatus

type ControlRunStatus uint32
const (
	ControlRunReady ControlRunStatus = 1 << iota
	ControlRunStarted
	ControlRunComplete
	ControlRunError
)

type ControlStatus

type ControlStatus string

type QueryResult

type QueryResult struct {
	RowChan  *chan *RowResult
	ColTypes []*sql.ColumnType
	Duration chan time.Duration
}

func NewQueryResult

func NewQueryResult(colTypes []*sql.ColumnType) *QueryResult

func (QueryResult) Close

func (r QueryResult) Close()

close the channels

func (QueryResult) StreamError

func (r QueryResult) StreamError(err error)

func (QueryResult) StreamRow

func (r QueryResult) StreamRow(rowResult []interface{})

type ResultStreamer

type ResultStreamer struct {
	Results chan *QueryResult
	// contains filtered or unexported fields
}

func NewResultStreamer

func NewResultStreamer() *ResultStreamer

func (*ResultStreamer) Close

func (q *ResultStreamer) Close()

func (*ResultStreamer) Done

func (q *ResultStreamer) Done()

Done :: signals that the next QueryResult has been processed

func (*ResultStreamer) StreamResult

func (q *ResultStreamer) StreamResult(result *QueryResult)

func (*ResultStreamer) StreamSingleResult

func (q *ResultStreamer) StreamSingleResult(result *QueryResult)

func (*ResultStreamer) Wait

func (q *ResultStreamer) Wait()

Wait :: waits for the next QueryResult to get processed

type RowResult

type RowResult struct {
	Data  []interface{}
	Error error
}

type SyncQueryResult

type SyncQueryResult struct {
	Rows     []interface{}
	ColTypes []*sql.ColumnType
	Duration time.Duration
}

Jump to

Keyboard shortcuts

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