rule

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DorisRuleName = "doris"
View Source
const MysqlRuleName = "mysql"
View Source
const StarrocksRuleName = "starrocks"

Variables

This section is empty.

Functions

func GetRuleKeySchemaTable added in v0.4.1

func GetRuleKeySchemaTable(ruleKey string) (string, string, error)

func RuleKeyFormat added in v0.3.0

func RuleKeyFormat(schema string, table string) string

func SchemaTableToStrRegex added in v0.3.0

func SchemaTableToStrRegex(schema string, table string) string

func StrRegexToSchemaTable added in v0.4.1

func StrRegexToSchemaTable(regex string) (string, string)

Types

type DorisRule added in v0.3.0

type DorisRule struct {
	SourceSchema string   `toml:"source-schema" json:"source-schema" mapstructure:"source-schema"`
	SourceTable  string   `toml:"source-table" json:"source-table" mapstructure:"source-table"`
	TargetSchema string   `toml:"target-schema" json:"target-schema" mapstructure:"target-schema"`
	TargetTable  string   `toml:"target-table" json:"target-table" mapstructure:"target-table"`
	RuleType     RuleType `default:"init" json:"rule-type"` // default: init, init、dynamic add
	// for api delete rule, only logical deleted, fix output get ruleMap failed problem. when add the same rule physical deleted
	Deleted bool `default:"false" json:"deleted"`
}

type DorisRules added in v0.3.0

type DorisRules struct {
	Rules      []*DorisRule
	RulesRegex []string
	RulesMap   map[string]interface{}
}

func (*DorisRules) Configure added in v0.5.0

func (drs *DorisRules) Configure(pipelineName string, configOutput map[string]interface{}) error

func (*DorisRules) GetRule added in v0.3.0

func (drs *DorisRules) GetRule(schemaTable string) interface{}

func (*DorisRules) GetRuleToMap added in v0.3.0

func (drs *DorisRules) GetRuleToMap() map[string]interface{}

func (*DorisRules) GetRuleToRegex added in v0.3.0

func (drs *DorisRules) GetRuleToRegex() []string

func (*DorisRules) NewRule added in v0.3.0

func (drs *DorisRules) NewRule(config map[string]interface{})

func (*DorisRules) RuleToMap added in v0.3.0

func (drs *DorisRules) RuleToMap()

func (*DorisRules) RuleToRegex added in v0.3.0

func (drs *DorisRules) RuleToRegex()

func (*DorisRules) TargetString added in v0.3.0

func (drs *DorisRules) TargetString() string

type MysqlRule added in v0.4.0

type MysqlRule struct {
	SourceSchema  string   `toml:"source-schema" json:"source-schema" mapstructure:"source-schema"`
	SourceTable   string   `toml:"source-table" json:"source-table" mapstructure:"source-table"`
	TargetSchema  string   `toml:"target-schema" json:"target-schema" mapstructure:"target-schema"`
	TargetTable   string   `toml:"target-table" json:"target-table" mapstructure:"target-table"`
	PrimaryKeys   []string `toml:"primary-keys" json:"primary-keys" mapstructure:"primary-keys"`
	SourceColumns []string `toml:"source-columns" json:"source-columns" mapstructure:"source-columns"`
	TargetColumns []string `toml:"target-columns" json:"target-columns" mapstructure:"target-columns"`
	RuleType      RuleType `default:"init" json:"rule-type"` // default: init, init、dynamic add
	// for api delete rule, only logical deleted, fix output get ruleMap failed problem. when add the same rule physical deleted
	Deleted bool `default:"false" json:"deleted"`
}

type MysqlRules added in v0.4.0

type MysqlRules struct {
	Rules      []*MysqlRule
	RulesRegex []string
	RulesMap   map[string]interface{}
}

func (*MysqlRules) Configure added in v0.5.0

func (mrs *MysqlRules) Configure(pipelineName string, configOutput map[string]interface{}) error

func (*MysqlRules) GetRule added in v0.4.0

func (mrs *MysqlRules) GetRule(schemaTable string) interface{}

func (*MysqlRules) GetRuleToMap added in v0.4.0

func (mrs *MysqlRules) GetRuleToMap() map[string]interface{}

func (*MysqlRules) GetRuleToRegex added in v0.4.0

func (mrs *MysqlRules) GetRuleToRegex() []string

func (*MysqlRules) NewRule added in v0.4.0

func (mrs *MysqlRules) NewRule(config map[string]interface{})

func (*MysqlRules) RuleToMap added in v0.4.0

func (mrs *MysqlRules) RuleToMap()

func (*MysqlRules) RuleToRegex added in v0.4.0

func (mrs *MysqlRules) RuleToRegex()

func (*MysqlRules) TargetString added in v0.4.0

func (mrs *MysqlRules) TargetString() string

type RuleType added in v0.3.0

type RuleType string
const (
	TypeInit       RuleType = "init"
	TypeDynamicAdd RuleType = "dynamic add"
)

type StarrocksRule added in v0.3.0

type StarrocksRule struct {
	SourceSchema string   `toml:"source-schema" json:"source-schema" mapstructure:"source-schema"`
	SourceTable  string   `toml:"source-table" json:"source-table" mapstructure:"source-table"`
	TargetSchema string   `toml:"target-schema" json:"target-schema" mapstructure:"target-schema"`
	TargetTable  string   `toml:"target-table" json:"target-table" mapstructure:"target-table"`
	RuleType     RuleType `default:"init" json:"rule-type"` // init、dynamic add
	// for api delete rule, only logical deleted, fix output get ruleMap failed problem. when add the same rule physical deleted
	Deleted bool `default:"false" json:"deleted"`
}

type StarrocksRules added in v0.3.0

type StarrocksRules struct {
	Rules      []*StarrocksRule
	RulesRegex []string
	RulesMap   map[string]interface{}
}

func (*StarrocksRules) Configure added in v0.5.0

func (srs *StarrocksRules) Configure(pipelineName string, configOutput map[string]interface{}) error

func (*StarrocksRules) GetRule added in v0.3.0

func (srs *StarrocksRules) GetRule(schemaTable string) interface{}

func (*StarrocksRules) GetRuleToMap added in v0.3.0

func (srs *StarrocksRules) GetRuleToMap() map[string]interface{}

func (*StarrocksRules) GetRuleToRegex added in v0.3.0

func (srs *StarrocksRules) GetRuleToRegex() []string

func (*StarrocksRules) NewRule added in v0.3.0

func (srs *StarrocksRules) NewRule(config map[string]interface{})

func (*StarrocksRules) RuleToMap added in v0.3.0

func (srs *StarrocksRules) RuleToMap()

func (*StarrocksRules) RuleToRegex added in v0.3.0

func (srs *StarrocksRules) RuleToRegex()

func (*StarrocksRules) TargetString added in v0.3.0

func (srs *StarrocksRules) TargetString() string

Jump to

Keyboard shortcuts

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