transformer

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnTransformers added in v0.5.0

type ColumnTransformers map[string]transformers.Transformer

type Config

type Config struct {
	TransformerRules []TableRules
	ValidationMode   string
}

type Option

type Option func(t *Transformer)

func WithLogger

func WithLogger(l loglib.Logger) Option

func WithParser added in v0.5.0

func WithParser(parser ParseFn) Option

type ParseFn added in v0.5.0

type ParseFn func(ctx context.Context, rules Rules) (map[string]ColumnTransformers, error)

type PostgresTransformerParser added in v0.5.0

type PostgresTransformerParser struct {
	// contains filtered or unexported fields
}

func NewPostgresTransformerParser added in v0.5.0

func NewPostgresTransformerParser(ctx context.Context, pgURL string, builder transformerBuilder, requiredTables []string) (*PostgresTransformerParser, error)

func (*PostgresTransformerParser) Close added in v0.5.0

func (v *PostgresTransformerParser) Close() error

func (*PostgresTransformerParser) ParseAndValidate added in v0.5.0

func (v *PostgresTransformerParser) ParseAndValidate(ctx context.Context, rules Rules) (map[string]ColumnTransformers, error)

type Rules

type Rules struct {
	Transformers   []TableRules `yaml:"transformations"`
	ValidationMode string       `yaml:"validation_mode"`
}

type TableRules

type TableRules struct {
	Schema         string                      `yaml:"schema"`
	Table          string                      `yaml:"table"`
	ColumnRules    map[string]TransformerRules `yaml:"column_transformers"`
	ValidationMode string                      `yaml:"validation_mode"`
}

type Transformer

type Transformer struct {
	// contains filtered or unexported fields
}

Transformer is a decorator around a wal processor that transforms wal event column values following the configured transformation rules.

func New

func New(ctx context.Context, cfg *Config, processor processor.Processor, builder transformerBuilder, opts ...Option) (*Transformer, error)

New will return a transformer processor wrapper that will transform incoming wal event column values as configured by the transformation rules.

func (*Transformer) Close

func (t *Transformer) Close() error

func (*Transformer) Name

func (t *Transformer) Name() string

func (*Transformer) ProcessWALEvent

func (t *Transformer) ProcessWALEvent(ctx context.Context, event *wal.Event) error

type TransformerRules

type TransformerRules struct {
	Name              string         `yaml:"name"`
	Parameters        map[string]any `yaml:"parameters"`
	DynamicParameters map[string]any `yaml:"dynamic_parameters"`
}

Jump to

Keyboard shortcuts

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