filter

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// List of tables to allow. Tables should be schema qualified. If no schema
	// is provided, the public schema will be assumed. Wildcards "*" are
	// supported.
	IncludeTables []string
	// List of tables to skip. Tables should be schema qualified. If no schema
	// is provided, the public schema will be assumed. Wildcards "*" are
	// supported.
	ExcludeTables []string
	// List of tables for which DDL events are allowed but data (DML) events
	// are skipped. Tables should be schema qualified. If no schema is
	// provided, the public schema will be assumed. Wildcards "*" are
	// supported. Tables listed explicitly (no wildcards) in the include list
	// take precedence over a schema-only wildcard match, and the exclude list
	// takes precedence over the schema-only list.
	SchemaOnlyTables []string
}

type Filter

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

Filter is a processor wrapper that filter table WAL events based on the configured table include/exclude lists.

func New

func New(
	processor processor.Processor, cfg *Config, opts ...Option,
) (*Filter, error)

New will return a filter processor wrapper that will skip WAL events as per the configuration provided. Only one of include or exclude table list can be provided (not both). The schema-only table list can be combined with either.

func (*Filter) Close

func (f *Filter) Close() error

func (*Filter) Name

func (f *Filter) Name() string

func (*Filter) ProcessWALEvent

func (f *Filter) ProcessWALEvent(ctx context.Context, event *wal.Event) error

type Option

type Option func(*Filter)

func WithDefaultIncludeTables

func WithDefaultIncludeTables(tables []string) Option

WithDefaultIncludeTables will use the tables on input as default include table list or add them to the configured one if provided. If the filter has an exclude table list configured, the default include table list won't apply, since only one can be provided.

func WithLogger

func WithLogger(logger loglib.Logger) Option

Jump to

Keyboard shortcuts

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