def

package
v2.0.0-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemaTypes = []SchemaType{
	PROTOBUF,
	CUSTOM,
}

Functions

This section is empty.

Types

type DatetimeRange

type DatetimeRange struct {
	Begin          string `json:"begin" yaml:"begin"`
	End            string `json:"end" yaml:"end"`
	BeginTimestamp int64  `json:"beginTimestamp" yaml:"beginTimestamp"`
	EndTimestamp   int64  `json:"endTimestamp" yaml:"endTimestamp"`
}

type GraphNode

type GraphNode struct {
	Type     string                 `json:"type" yaml:"type"`
	NodeType string                 `json:"nodeType" yaml:"nodeType"`
	Props    map[string]interface{} `json:"props" yaml:"props"`
	// UI is a placeholder for ui properties
	UI map[string]interface{} `json:"ui" yaml:"ui"`
}

type PrintableTopo

type PrintableTopo struct {
	Sources []string                 `json:"sources" yaml:"sources"`
	Edges   map[string][]interface{} `json:"edges" yaml:"edges"`
}

type Qos

type Qos int
const (
	AtMostOnce Qos = iota
	AtLeastOnce
	ExactlyOnce
)

type RestartStrategy

type RestartStrategy struct {
	Attempts     int               `json:"attempts,omitempty" yaml:"attempts,omitempty"`
	Delay        cast.DurationConf `json:"delay,omitempty" yaml:"delay,omitempty"`
	Multiplier   float64           `json:"multiplier,omitempty" yaml:"multiplier,omitempty"`
	MaxDelay     cast.DurationConf `json:"maxDelay,omitempty" yaml:"maxDelay,omitempty"`
	JitterFactor float64           `json:"jitterFactor,omitempty" yaml:"jitterFactor,omitempty"`
}

type Rule

type Rule struct {
	Triggered bool                     `json:"triggered" yaml:"triggered"`
	Id        string                   `json:"id,omitempty" yaml:"id,omitempty"`
	Name      string                   `json:"name,omitempty" yaml:"name,omitempty"` // The display name of a rule
	Sql       string                   `json:"sql,omitempty" yaml:"sql,omitempty"`
	Graph     *RuleGraph               `json:"graph,omitempty" yaml:"graph,omitempty"`
	Actions   []map[string]interface{} `json:"actions,omitempty" yaml:"actions,omitempty"`
	Options   *RuleOption              `json:"options,omitempty" yaml:"options,omitempty"`
}

Rule the definition of the business logic Sql and Graph are mutually exclusive, at least one of them should be set

func GetDefaultRule

func GetDefaultRule(name, sql string) *Rule

func (*Rule) IsScheduleRule

func (r *Rule) IsScheduleRule() bool

type RuleGraph

type RuleGraph struct {
	Nodes map[string]*GraphNode `json:"nodes" yaml:"nodes"`
	Topo  *PrintableTopo        `json:"topo" yaml:"topo"`
}

type RuleOption

type RuleOption struct {
	Debug              bool              `json:"debug,omitempty" yaml:"debug,omitempty"`
	LogFilename        string            `json:"logFilename,omitempty" yaml:"logFilename,omitempty"`
	IsEventTime        bool              `json:"isEventTime,omitempty" yaml:"isEventTime,omitempty"`
	LateTol            cast.DurationConf `json:"lateTolerance,omitempty" yaml:"lateTolerance,omitempty"`
	Concurrency        int               `json:"concurrency" yaml:"concurrency"`
	BufferLength       int               `json:"bufferLength" yaml:"bufferLength"`
	SendMetaToSink     bool              `json:"sendMetaToSink,omitempty" yaml:"sendMetaToSink,omitempty"`
	SendError          bool              `json:"sendError,omitempty" yaml:"sendError,omitempty"`
	Qos                Qos               `json:"qos,omitempty" yaml:"qos,omitempty"`
	CheckpointInterval cast.DurationConf `json:"checkpointInterval,omitempty" yaml:"checkpointInterval,omitempty"`
	RestartStrategy    *RestartStrategy  `json:"restartStrategy,omitempty" yaml:"restartStrategy,omitempty"`
	Cron               string            `json:"cron,omitempty" yaml:"cron,omitempty"`
	Duration           string            `json:"duration,omitempty" yaml:"duration,omitempty"`
	CronDatetimeRange  []DatetimeRange   `json:"cronDatetimeRange,omitempty" yaml:"cronDatetimeRange,omitempty"`
	EnableRuleTracer   bool              `json:"enableRuleTracer,omitempty" yaml:"enableRuleTracer,omitempty"`
}

type SchemaType

type SchemaType string
const (
	PROTOBUF SchemaType = "protobuf"
	CUSTOM   SchemaType = "custom"
)

type SourceMeta

type SourceMeta struct {
	SourceName string `json:"sourceName"` // the name of the stream or table
	SourceType string `json:"sourceType"` // stream or table
}

SourceMeta is the metadata of a source node. It describes what existed stream/table to refer to. It is part of the Props in the GraphNode and it is optional

Jump to

Keyboard shortcuts

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