deepql

package
v0.0.0-...-bfa2730 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Code generated by goyacc -l -o pkg/deepql/deepql.y.go pkg/deepql/deepql.y. DO NOT EDIT.

Index

Constants

View Source
const (
	List       = "list"
	DeleteType = "delete"
)
View Source
const CLOSE_BRACE = 57354
View Source
const CLOSE_BRACK = 57362
View Source
const CLOSE_PARAN = 57360
View Source
const COMMAND = 57349
View Source
const DOT = 57358
View Source
const DURATION = 57352
View Source
const EQ = 57363
View Source
const FALSE = 57357
View Source
const FLOAT = 57351
View Source
const GT = 57367
View Source
const GTE = 57368
View Source
const IDENTIFIER = 57347
View Source
const INTEGER = 57350
View Source
const LT = 57365
View Source
const LTE = 57366
View Source
const NEQ = 57364
View Source
const NIL = 57355
View Source
const NREG = 57370
View Source
const OPEN_BRACE = 57353
View Source
const OPEN_BRACK = 57361
View Source
const OPEN_PARAN = 57359
View Source
const REG = 57369
View Source
const STRING = 57346
View Source
const TRIGGER = 57348
View Source
const TRUE = 57356

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRequest

type CommandRequest struct {
	Command    string
	Conditions []Condition
}

type Condition

type Condition struct {
	Attribute string
	Op        Operator
	Operands  Operands
}

func (Condition) MatchesInt

func (c Condition) MatchesInt(value int) bool

func (Condition) MatchesString

func (c Condition) MatchesString(value string) bool

type Engine

type Engine struct{}

func NewEngine

func NewEngine() *Engine

func (*Engine) ExecuteCommandQuery

func (e *Engine) ExecuteCommandQuery(ctx context.Context, expr *RootExpr, handler CommandHandler) ([]*deeptp.TracePointConfig, []*deeptp.TracePointConfig, string, error)

func (*Engine) ExecuteSearch

func (e *Engine) ExecuteSearch(ctx context.Context, searchReq *deeppb.SearchRequest, snapshotResultFetcher SnapshotResultFetcher) (*deeppb.SearchResponse, error)

func (*Engine) ExecuteTriggerQuery

func (e *Engine) ExecuteTriggerQuery(ctx context.Context, expr *RootExpr, handler TriggerHandler) (*deeptp.TracePointConfig, []*deeptp.TracePointConfig, error)

type FetchSnapshotRequest

type FetchSnapshotRequest struct {
	StartTimeUnixNanos uint64
	EndTimeUnixNanos   uint64
	Conditions         []Condition
}

type FetchSnapshotResponse

type FetchSnapshotResponse struct {
	Results SnapshotResultIterator
	Bytes   func() uint64
}

type Operands

type Operands []Static

type Operator

type Operator int
const (
	OpNone Operator = iota
	OpEqual
	OpNotEqual
	OpGreater
	OpGreaterEqual
	OpLess
	OpLessEqual
	OpRegex
	OpNotRegex
)

type RootExpr

type RootExpr struct {
	// contains filtered or unexported fields
}

func ParseString

func ParseString(str string) (*RootExpr, error)

func (RootExpr) IsCommand

func (e RootExpr) IsCommand() bool

func (RootExpr) IsSearch

func (e RootExpr) IsSearch() bool

func (RootExpr) IsTrigger

func (e RootExpr) IsTrigger() bool

type Snapshot

type Snapshot interface {
	// Attributes are the actual fields used by the engine to evaluate queries
	// if a Filter parameter is passed the snapshots returned will only have this field populated
	Attributes() map[string]Static

	ID() []byte
	StartTimeUnixNanos() uint64
	EndTimeUnixNanos() uint64
}

type SnapshotResult

type SnapshotResult struct {
	SnapshotID         []byte
	ServiceName        string
	FilePath           string
	LineNo             uint32
	StartTimeUnixNanos uint64
	DurationNanos      uint64
}

type SnapshotResultIterator

type SnapshotResultIterator interface {
	Next(context.Context) (*SnapshotResult, error)
	Close()
}

type Static

type Static struct {
	Type StaticType
	N    int
	F    float64
	S    string
	B    bool
	D    time.Duration
}

func NewStaticBool

func NewStaticBool(b bool) Static

func NewStaticDuration

func NewStaticDuration(d time.Duration) Static

func NewStaticFloat

func NewStaticFloat(f float64) Static

func NewStaticInt

func NewStaticInt(n int) Static

func NewStaticNil

func NewStaticNil() Static

func NewStaticString

func NewStaticString(s string) Static

func (Static) String

func (s Static) String() string

type StaticType

type StaticType int
const (
	TypeNil StaticType = iota
	TypeInt
	TypeFloat
	TypeString
	TypeBoolean
	TypeDuration
)

Jump to

Keyboard shortcuts

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