filter

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 8 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
}

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).

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