Documentation
¶
Overview ¶
Package routing provides message routing capabilities for pg_flo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsOperation ¶
func ContainsOperation(operations []utils.OperationType, operation utils.OperationType) bool
ContainsOperation checks if the given operation is in the list of operations
func GetMappedColumnName ¶
func GetMappedColumnName(mappings []ColumnMapping, sourceName string) string
GetMappedColumnName returns the destination column name for a given source column name
Types ¶
type ColumnMapping ¶
ColumnMapping defines how columns are mapped between source and destination
type Router ¶
type Router struct {
Routes map[string]TableRoute
// contains filtered or unexported fields
}
Router manages message routing and transformation
func (*Router) AddRoute ¶
func (r *Router) AddRoute(route TableRoute)
AddRoute adds a new table route to the router
func (*Router) ApplyRouting ¶
func (r *Router) ApplyRouting(message *utils.CDCMessage) (*utils.CDCMessage, error)
ApplyRouting applies routing rules to transform a CDC message
func (*Router) LoadRoutes ¶
func (r *Router) LoadRoutes(config map[string]TableRoute) error
LoadRoutes loads routes from the provided configuration
type TableRoute ¶
type TableRoute struct {
SourceTable string `yaml:"source_table"`
DestinationTable string `yaml:"destination_table"`
ColumnMappings []ColumnMapping `yaml:"column_mappings"`
Operations []utils.OperationType `yaml:"operations"`
}
TableRoute defines routing configuration for a specific table
Click to show internal directories.
Click to hide internal directories.