queries

package
v0.0.0-...-81473b2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LookbackParam  = "lookback"
	NamespaceParam = "namespace"
	KindParam      = "kind"
	NameParam      = "name"
	NameMatchParam = "namematch" // substring match on name
	UuidParam      = "uuid"
	StartTimeParam = "start_time"
	EndTimeParam   = "end_time"
	ClickTimeParam = "click_time"
	QueryParam     = "query"
	SortParam      = "sort"
)

Parameters are shared between webserver and here Keep this in sync with pkg/sloop/webserver/webfiles/filter.js

View Source
const (
	AllKinds         = "_all"
	AllNamespaces    = "_all"
	DefaultNamespace = "default"
)
View Source
const EmptyPartition = ""

Variables

This section is empty.

Functions

func Default

func Default() string

func EventHeatMap3Query

func EventHeatMap3Query(params url.Values, t typed.Tables, queryStartTime time.Time, queryEndTime time.Time, requestId string) ([]byte, error)

func GetEventData

func GetEventData(params url.Values, t typed.Tables, startTime time.Time, endTime time.Time, requestId string) ([]byte, error)

func GetNamesOfQueries

func GetNamesOfQueries() []string

func GetResPayload

func GetResPayload(params url.Values, t typed.Tables, startTime time.Time, endTime time.Time, requestId string) ([]byte, error)

func GetResSummaryData

func GetResSummaryData(params url.Values, t typed.Tables, startTime time.Time, endTime time.Time, requestId string) ([]byte, error)

func GetSeekKey

func GetSeekKey(keyComparator *typed.WatchTableKey, startTime time.Time) *typed.WatchTableKey

func KindQuery

func KindQuery(params url.Values, tables typed.Tables, startTime time.Time, endTime time.Time, requestId string) ([]byte, error)

TODO: Only return kinds for the specified namespace

func NamespaceQuery

func NamespaceQuery(params url.Values, tables typed.Tables, startTime time.Time, endTime time.Time, requestId string) ([]byte, error)

Consider: Make use of resources to limit what namespaces we return. For example, if kind == ConfigMap, only return namespaces that contain a ConfigMap

func QueryAvailableQueries

func QueryAvailableQueries(params url.Values, tables typed.Tables, startTime time.Time, endTime time.Time, requestId string) ([]byte, error)

func RunQuery

func RunQuery(queryName string, params url.Values, tables typed.Tables, maxLookBack time.Duration, requestId string) ([]byte, error)

Types

type EventOutput

type EventOutput struct {
	PartitionId    string                          `json:"partitionId"`
	Namespace      string                          `json:"namespace"`
	Name           string                          `json:"name"`
	WatchTimestamp time.Time                       `json:"watchTimestamp,omitempty"`
	Kind           string                          `json:"kind,omitempty"`
	WatchType      typed.KubeWatchResult_WatchType `json:"watchType,omitempty"`
	Payload        string                          `json:"payload,omitempty"`
	EventKey       string                          `json:"eventKey"`
}

type EventsData

type EventsData struct {
	EventsList []EventOutput `json:"eventsList"`
}

type Overlay

type Overlay struct {
	Text      string `json:"text"`
	StartDate int64  `json:"start_date"`
	Duration  int64  `json:"duration"`
	EndDate   int64  `json:"end_date"`
}

type PayloadOuput

type PayloadOuput struct {
	PayloadKey  string `json:"payloadKey"`
	PayLoadTime int64  `json:"payloadTime"`
	Payload     string `json:"payload,omitempty"`
}

type ResPayLoadData

type ResPayLoadData struct {
	PayloadList []PayloadOuput `json:"payloadList"`
}

type ResSummaryOutput

type ResSummaryOutput struct {
	typed.ResourceSummaryKey
	typed.ResourceSummary
}

func (ResSummaryOutput) IsEmpty

func (r ResSummaryOutput) IsEmpty() bool

type TimelineRoot

type TimelineRoot struct {
	ViewOpt ViewOptions   `json:"view_options"`
	Rows    []TimelineRow `json:"rows"`
}

type TimelineRow

type TimelineRow struct {
	Text       string    `json:"text"`
	Duration   int64     `json:"duration"`
	Kind       string    `json:"kind"`
	Namespace  string    `json:"namespace"`
	Overlays   []Overlay `json:"overlays"`
	ChangedAt  []int64   `json:"changedat"`
	NoChangeAt []int64   `json:"nochangeat"`
	StartDate  int64     `json:"start_date"`
	EndDate    int64     `json:"end_date"`
}

type ViewOptions

type ViewOptions struct {
	Sort string `json:"sort"`
}

Jump to

Keyboard shortcuts

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