Documentation ¶
Index ¶
- type SchemaExtractor
- type SourceExtractor
- type Table
- func (r *Table) AddRule(rule *TableRule) error
- func (r *Table) FetchExtendColumn(schema, table, source string) ([]string, []string)
- func (r *Table) RemoveRule(rule *TableRule) error
- func (r *Table) Route(schema, table string) (targetSchema string, targetTable string, err error)
- func (r *Table) UpdateRule(rule *TableRule) error
- type TableExtractor
- type TableRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SchemaExtractor ¶
type SchemaExtractor struct { TargetColumn string `json:"target-column" toml:"target-column" yaml:"target-column"` SchemaRegexp string `json:"schema-regexp" toml:"schema-regexp" yaml:"schema-regexp"` // contains filtered or unexported fields }
SchemaExtractor extracts schema name to column
type SourceExtractor ¶
type SourceExtractor struct { TargetColumn string `json:"target-column" toml:"target-column" yaml:"target-column"` SourceRegexp string `json:"source-regexp" toml:"source-regexp" yaml:"source-regexp"` // contains filtered or unexported fields }
SourceExtractor extracts source name to column
type Table ¶
Table routes schema/table to target schema/table by given route rules
func NewTableRouter ¶
NewTableRouter returns a table router
func (*Table) FetchExtendColumn ¶
FetchExtendColumn get extract rule, return extracted cols and extracted vals.
func (*Table) RemoveRule ¶
RemoveRule removes a rule from table router
func (*Table) Route ¶
Route routes schema/table to target schema/table don't support to route schema/table to multiple schema/table
func (*Table) UpdateRule ¶
UpdateRule updates rule
type TableExtractor ¶
type TableExtractor struct { TargetColumn string `json:"target-column" toml:"target-column" yaml:"target-column"` TableRegexp string `json:"table-regexp" toml:"table-regexp" yaml:"table-regexp"` // contains filtered or unexported fields }
TableExtractor extracts table name to column
type TableRule ¶
type TableRule struct { TableExtractor *TableExtractor `json:"extract-table,omitempty" toml:"extract-table,omitempty" yaml:"extract-table,omitempty"` SchemaExtractor *SchemaExtractor `json:"extract-schema,omitempty" toml:"extract-schema,omitempty" yaml:"extract-schema,omitempty"` SourceExtractor *SourceExtractor `json:"extract-source,omitempty" toml:"extract-source,omitempty" yaml:"extract-source,omitempty"` SchemaPattern string `json:"schema-pattern" toml:"schema-pattern" yaml:"schema-pattern"` TablePattern string `json:"table-pattern" toml:"table-pattern" yaml:"table-pattern"` TargetSchema string `json:"target-schema" toml:"target-schema" yaml:"target-schema"` TargetTable string `json:"target-table" toml:"target-table" yaml:"target-table"` }
TableRule is a rule to route schema/table to target schema/table pattern format refers 'pkg/table-rule-selector'
Click to show internal directories.
Click to hide internal directories.