Documentation
¶
Index ¶
- func Apply(records []map[string]interface{}, cfg Config, source string) []map[string]interface{}
- func CopyRows(records []map[string]interface{}) []map[string]interface{}
- func Fields(records []map[string]interface{}, keyField string) []string
- func KeyField(cfg Config, source string) string
- func Keyed(records []map[string]interface{}, keyField string, omitKey bool) map[string]interface{}
- type Config
- type NumericRule
- type TableConfig
- type ValueMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Enabled bool `json:"enabled" yaml:"enabled" toml:"enabled"`
MappingFile string `json:"mapping_file,omitempty" yaml:"mapping_file,omitempty" toml:"mapping_file,omitempty"`
KeyField string `json:"key_field,omitempty" yaml:"key_field,omitempty" toml:"key_field,omitempty"`
Fields map[string]string `json:"fields,omitempty" yaml:"fields,omitempty" toml:"fields,omitempty"`
Values map[string]ValueMap `json:"values,omitempty" yaml:"values,omitempty" toml:"values,omitempty"`
Defaults map[string]interface{} `json:"defaults,omitempty" yaml:"defaults,omitempty" toml:"defaults,omitempty"`
Include []string `json:"include,omitempty" yaml:"include,omitempty" toml:"include,omitempty"`
Drop []string `json:"drop,omitempty" yaml:"drop,omitempty" toml:"drop,omitempty"`
Numeric map[string]NumericRule `json:"numeric,omitempty" yaml:"numeric,omitempty" toml:"numeric,omitempty"`
Tables map[string]TableConfig `json:"tables,omitempty" yaml:"tables,omitempty" toml:"tables,omitempty"`
}
Config describes optional key/value mapping and table-specific field rules. It is intentionally data-only so it can be embedded in JSON/YAML/TOML config files and reused by CLI, HTTP, WebSocket, and outbound sync paths.
type NumericRule ¶
type TableConfig ¶
type TableConfig struct {
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty" toml:"enabled,omitempty"`
KeyField string `json:"key_field,omitempty" yaml:"key_field,omitempty" toml:"key_field,omitempty"`
Fields map[string]string `json:"fields,omitempty" yaml:"fields,omitempty" toml:"fields,omitempty"`
Values map[string]ValueMap `json:"values,omitempty" yaml:"values,omitempty" toml:"values,omitempty"`
Defaults map[string]interface{} `json:"defaults,omitempty" yaml:"defaults,omitempty" toml:"defaults,omitempty"`
Include []string `json:"include,omitempty" yaml:"include,omitempty" toml:"include,omitempty"`
Drop []string `json:"drop,omitempty" yaml:"drop,omitempty" toml:"drop,omitempty"`
Numeric map[string]NumericRule `json:"numeric,omitempty" yaml:"numeric,omitempty" toml:"numeric,omitempty"`
}