123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- package api
- import (
- "context"
- "github.com/sirupsen/logrus"
- )
- type ConsumeFunc func(data interface{})
- type Source interface {
- Open(context StreamContext, consume ConsumeFunc) error
- }
- type Emitter interface {
- AddOutput(chan<- interface{}, string) error
- }
- type Collector interface {
- GetInput() (chan<- interface{}, string)
- }
- type TopNode interface {
- GetName() string
- }
- type Rule struct {
- Id string `json:"id"`
- Sql string `json:"sql"`
- Actions []map[string]interface{} `json:"actions"`
- Options map[string]interface{} `json:"options"`
- }
- type StreamContext interface {
- GetContext() context.Context
- GetLogger() *logrus.Entry
- GetRuleId() string
- GetOpId() string
- }
- type SinkConnector interface {
- Open(context.Context, chan<- error)
- }
- type Sink interface {
- Collector
- SinkConnector
- }
- type Operator interface {
- Emitter
- Collector
- Exec(context context.Context) error
- }
|