processor

package
v2.4.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanReplace added in v2.3.0

func CanReplace(old, new string) bool

CanReplace compare which version is newer, return true if new version is newer If both version are empty, need to replace to be backward compatible

func DescribeToJson

func DescribeToJson(s string) string

DescribeToJson takes the human redable text from execDescribe and converts it to json Intended use is for CLI when passing -json flag

func GetStreamProcessorDataSource

func GetStreamProcessorDataSource(name string) (*ast.StreamStmt, error)

GetStreamProcessorDataSource is a global function that uses the global StreamProcessor instance to retrieve stream/table definitions from both persistent and temp stores.

Types

type RuleProcessor

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

func NewRuleProcessor

func NewRuleProcessor() *RuleProcessor

func (*RuleProcessor) ExecCreate

func (p *RuleProcessor) ExecCreate(name, ruleJson string) error

func (*RuleProcessor) ExecCreateWithValidation

func (p *RuleProcessor) ExecCreateWithValidation(name, ruleJson string) (*def.Rule, error)

func (*RuleProcessor) ExecDesc

func (p *RuleProcessor) ExecDesc(name string) (string, error)

func (*RuleProcessor) ExecDrop

func (p *RuleProcessor) ExecDrop(name string) error

func (*RuleProcessor) ExecExists

func (p *RuleProcessor) ExecExists(name string) bool

func (*RuleProcessor) ExecReplaceRuleState

func (p *RuleProcessor) ExecReplaceRuleState(name string, triggered bool) error

func (*RuleProcessor) ExecUpsert added in v2.2.0

func (p *RuleProcessor) ExecUpsert(id, ruleJson string) error

func (*RuleProcessor) GetAllRules

func (p *RuleProcessor) GetAllRules() ([]string, error)

func (*RuleProcessor) GetAllRulesJson

func (p *RuleProcessor) GetAllRulesJson() (map[string]string, error)

func (*RuleProcessor) GetRuleById

func (p *RuleProcessor) GetRuleById(id string) (*def.Rule, error)

func (*RuleProcessor) GetRuleByJson

func (p *RuleProcessor) GetRuleByJson(id, ruleJson string) (*def.Rule, error)

func (*RuleProcessor) GetRuleByJsonValidated

func (p *RuleProcessor) GetRuleByJsonValidated(id, ruleJson string) (*def.Rule, error)

GetRuleByJsonValidated called when the json is getting from trusted source like db

func (*RuleProcessor) GetRuleJson

func (p *RuleProcessor) GetRuleJson(id string) (string, error)

type Ruleset

type Ruleset struct {
	Streams map[string]string `json:"streams"`
	Tables  map[string]string `json:"tables"`
	Rules   map[string]string `json:"rules"`
}

type RulesetProcessor

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

func NewRulesetProcessor

func NewRulesetProcessor(r *RuleProcessor, s *StreamProcessor) *RulesetProcessor

func (*RulesetProcessor) Export

func (rs *RulesetProcessor) Export() (io.ReadSeeker, []int, error)

func (*RulesetProcessor) ExportRuleSet

func (rs *RulesetProcessor) ExportRuleSet() *Ruleset

func (*RulesetProcessor) ExportRuleSetStatus

func (rs *RulesetProcessor) ExportRuleSetStatus() *Ruleset

func (*RulesetProcessor) Import

func (rs *RulesetProcessor) Import(content []byte) ([]string, []int, error)

func (*RulesetProcessor) ImportRuleSet

func (rs *RulesetProcessor) ImportRuleSet(all Ruleset) Ruleset

type StreamDetail

type StreamDetail struct {
	Name   string `json:"name"`
	Type   string `json:"type"`
	Format string `json:"format"`
}

type StreamProcessor

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

func NewStreamProcessor

func NewStreamProcessor() *StreamProcessor

func (*StreamProcessor) DescStream

func (p *StreamProcessor) DescStream(name string, st ast.StreamType) (r ast.Statement, err error)

func (*StreamProcessor) DropStream

func (p *StreamProcessor) DropStream(name string, st ast.StreamType) (r string, err error)

func (*StreamProcessor) ExecReplaceStream

func (p *StreamProcessor) ExecReplaceStream(name string, statement string, st ast.StreamType) (info string, err error)

func (*StreamProcessor) ExecStmt

func (p *StreamProcessor) ExecStmt(statement string) (result []string, err error)

func (*StreamProcessor) ExecStreamSql

func (p *StreamProcessor) ExecStreamSql(statement string) (info string, err error)

func (*StreamProcessor) GetAll

func (p *StreamProcessor) GetAll() (result map[string]map[string]string, err error)

GetAll return all streams and tables defined to export.

func (*StreamProcessor) GetDataSource

func (p *StreamProcessor) GetDataSource(name string) (*ast.StreamStmt, error)

GetDataSource retrieves a stream/table definition by name from both persistent and temp stores. It first checks the persistent store, then falls back to the temp store if not found.

func (*StreamProcessor) GetInferredJsonSchema

func (p *StreamProcessor) GetInferredJsonSchema(name string, st ast.StreamType) (r map[string]*ast.JsonStreamField, err error)

GetInferredJsonSchema return schema in json schema type TODO merge external schema and inferred dynamic schema

func (*StreamProcessor) GetInferredSchema

func (p *StreamProcessor) GetInferredSchema(name string, st ast.StreamType) (r ast.StreamFields, err error)

func (*StreamProcessor) GetStream

func (p *StreamProcessor) GetStream(name string, st ast.StreamType) (res string, err error)

func (*StreamProcessor) RecoverLookupTable

func (p *StreamProcessor) RecoverLookupTable() (err error)

func (*StreamProcessor) ShowStream

func (p *StreamProcessor) ShowStream(st ast.StreamType) (res []string, err error)

func (*StreamProcessor) ShowStreamOrTableDetails

func (p *StreamProcessor) ShowStreamOrTableDetails(kind string, st ast.StreamType) (res []StreamDetail, err error)

func (*StreamProcessor) ShowTable

func (p *StreamProcessor) ShowTable(kind string) (res []string, err error)

Jump to

Keyboard shortcuts

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