Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnFilter ¶
type ColumnFilter interface {
// MatchColumn checks if a column can be processed after applying the columnFilter.
MatchColumn(column string) bool
}
ColumnFilter is a structure to check if a column should be included for processing.
func ParseColumnFilter ¶
func ParseColumnFilter(args []string) (ColumnFilter, error)
ParseColumnFilter a columnFilter from a list of serialized columnFilter rules. Column is not case-sensitive on any platform, nor are column aliases. So the parsed columnFilter is case-insensitive.
type Filter ¶
type Filter interface {
// MatchTable checks if a table can be processed after applying the tableFilter.
MatchTable(schema string, table string) bool
// MatchSchema checks if a schema can be processed after applying the tableFilter.
MatchSchema(schema string) bool
// contains filtered or unexported methods
}
Filter is a structure to check if a table should be included for processing.
func CaseInsensitive ¶
CaseInsensitive returns a new tableFilter which is the case-insensitive version of the input tableFilter.
func NewSchemasFilter ¶
NewSchemasFilter creates a tableFilter which only accepts a list of schemas.
func NewTablesFilter ¶
NewTablesFilter creates a tableFilter which only accepts a list of tables.
func Parse ¶
Parse a tableFilter from a list of serialized tableFilter rules. The parsed tableFilter is case-sensitive by default.
func ParseMySQLReplicationRules ¶
func ParseMySQLReplicationRules(rules *MySQLReplicationRules) (Filter, error)
ParseMySQLReplicationRules constructs up to 2 filters from the MySQLReplicationRules. Tables have to pass *both* filters to be processed.
type MySQLReplicationRules ¶
type MySQLReplicationRules struct {
// DoTables is an allowlist of tables.
DoTables []*Table `json:"do-tables" toml:"do-tables" yaml:"do-tables"`
// DoDBs is an allowlist of schemas.
DoDBs []string `json:"do-dbs" toml:"do-dbs" yaml:"do-dbs"`
// IgnoreTables is a blocklist of tables.
IgnoreTables []*Table `json:"ignore-tables" toml:"ignore-tables" yaml:"ignore-tables"`
// IgnoreDBs is a blocklist of schemas.
IgnoreDBs []string `json:"ignore-dbs" toml:"ignore-dbs" yaml:"ignore-dbs"`
}
MySQLReplicationRules is a set of rules based on MySQL's replication tableFilter.
func (*MySQLReplicationRules) ToLower ¶
func (r *MySQLReplicationRules) ToLower()
ToLower convert all entries to lowercase Deprecated: use `filter.CaseInsensitive` instead.
type Table ¶
type Table struct {
// Schema is the name of the schema (database) containing this table.
Schema string `toml:"db-name" json:"db-name" yaml:"db-name"`
// Name is the unqualified table name.
Name string `toml:"tbl-name" json:"tbl-name" yaml:"tbl-name"`
}
Table represents a qualified table name.