processor

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

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) (string, error)

func (*RuleProcessor) ExecExists

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

func (*RuleProcessor) ExecQuery

func (p *RuleProcessor) ExecQuery(ruleid, sql string) (*topo.Topo, error)

func (*RuleProcessor) ExecReplaceRuleState

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

func (*RuleProcessor) ExecUpdate

func (p *RuleProcessor) ExecUpdate(name, ruleJson string) (*def.Rule, 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(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 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) GetInferredJsonSchema

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

GetInferredJsonSchema return schema in json schema type

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) 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