Documentation
¶
Index ¶
- func CanReplace(old, new string) bool
- func DescribeToJson(s string) string
- func GetStreamProcessorDataSource(name string) (*ast.StreamStmt, error)
- type RuleProcessor
- func (p *RuleProcessor) ExecCreate(name, ruleJson string) error
- func (p *RuleProcessor) ExecCreateWithValidation(name, ruleJson string) (*def.Rule, error)
- func (p *RuleProcessor) ExecDesc(name string) (string, error)
- func (p *RuleProcessor) ExecDrop(name string) error
- func (p *RuleProcessor) ExecExists(name string) bool
- func (p *RuleProcessor) ExecReplaceRuleState(name string, triggered bool) error
- func (p *RuleProcessor) ExecUpsert(id, ruleJson string) error
- func (p *RuleProcessor) GetAllRules() ([]string, error)
- func (p *RuleProcessor) GetAllRulesJson() (map[string]string, error)
- func (p *RuleProcessor) GetRuleById(id string) (*def.Rule, error)
- func (p *RuleProcessor) GetRuleByJson(id, ruleJson string) (*def.Rule, error)
- func (p *RuleProcessor) GetRuleByJsonValidated(id, ruleJson string) (*def.Rule, error)
- func (p *RuleProcessor) GetRuleJson(id string) (string, error)
- type Ruleset
- type RulesetProcessor
- func (rs *RulesetProcessor) Export() (io.ReadSeeker, []int, error)
- func (rs *RulesetProcessor) ExportRuleSet() *Ruleset
- func (rs *RulesetProcessor) ExportRuleSetStatus() *Ruleset
- func (rs *RulesetProcessor) Import(content []byte) ([]string, []int, error)
- func (rs *RulesetProcessor) ImportRuleSet(all Ruleset) Ruleset
- type StreamDetail
- type StreamProcessor
- func (p *StreamProcessor) DescStream(name string, st ast.StreamType) (r ast.Statement, err error)
- func (p *StreamProcessor) DropStream(name string, st ast.StreamType) (r string, err error)
- func (p *StreamProcessor) ExecReplaceStream(name string, statement string, st ast.StreamType) (info string, err error)
- func (p *StreamProcessor) ExecStmt(statement string) (result []string, err error)
- func (p *StreamProcessor) ExecStreamSql(statement string) (info string, err error)
- func (p *StreamProcessor) GetAll() (result map[string]map[string]string, err error)
- func (p *StreamProcessor) GetDataSource(name string) (*ast.StreamStmt, error)
- func (p *StreamProcessor) GetInferredJsonSchema(name string, st ast.StreamType) (r map[string]*ast.JsonStreamField, err error)
- func (p *StreamProcessor) GetInferredSchema(name string, st ast.StreamType) (r ast.StreamFields, err error)
- func (p *StreamProcessor) GetStream(name string, st ast.StreamType) (res string, err error)
- func (p *StreamProcessor) RecoverLookupTable() (err error)
- func (p *StreamProcessor) ShowStream(st ast.StreamType) (res []string, err error)
- func (p *StreamProcessor) ShowStreamOrTableDetails(kind string, st ast.StreamType) (res []StreamDetail, err error)
- func (p *StreamProcessor) ShowTable(kind string) (res []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanReplace ¶ added in v2.3.0
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 ¶
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) 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 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 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)