Documentation
¶
Index ¶
- type Config
- type Factory
- type SchemaConfig
- type SchemaFactory
- type SchemaProvider
- type Source
- func (s *Source) GetMetadata() adapters.SourceMetadata
- func (s *Source) GetSourceSchema() *adapters.Schema
- func (s *Source) HealthCheck() error
- func (s *Source) Start(ctx context.Context) error
- func (s *Source) Stop(ctx context.Context) error
- func (s *Source) Subscribe(ctx context.Context, factTypes []string) (<-chan *adapters.TypedFact, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
SourceID string `json:"source_id" yaml:"source_id"`
Driver string `json:"driver" yaml:"driver"`
DSN string `json:"dsn" yaml:"dsn"`
Mode string `json:"mode" yaml:"mode"` // "batch" or "stream"
Query string `json:"query" yaml:"query"`
StreamingQuery string `json:"stream_query" yaml:"stream_query"`
Table string `json:"table" yaml:"table"`
WatermarkColumn string `json:"watermark_column" yaml:"watermark_column"`
StartWatermark string `json:"start_watermark" yaml:"start_watermark"`
WatermarkType string `json:"watermark_type" yaml:"watermark_type"` // "string", "int", "float", "time"
PollInterval time.Duration `json:"poll_interval" yaml:"poll_interval"`
MaxRows int `json:"max_rows" yaml:"max_rows"`
SchemaName string `json:"schema_name" yaml:"schema_name"`
SchemaVersion string `json:"schema_version" yaml:"schema_version"`
SourceKey string `json:"source_key" yaml:"source_key"`
Timeout time.Duration `json:"timeout" yaml:"timeout"`
ColumnMapping map[string]string `json:"column_mapping" yaml:"column_mapping"`
}
Config holds SQL source configuration.
type Factory ¶
type Factory struct{}
Factory for SQL sources.
func (*Factory) Create ¶
func (f *Factory) Create(config adapters.SourceConfig) (adapters.FactSource, error)
func (*Factory) GetConfigSchema ¶
func (f *Factory) GetConfigSchema() adapters.ConfigSchema
func (*Factory) ValidateConfig ¶
func (f *Factory) ValidateConfig(config adapters.SourceConfig) error
type SchemaConfig ¶
type SchemaConfig struct {
Driver string `json:"driver" yaml:"driver"`
DSN string `json:"dsn" yaml:"dsn"`
Table string `json:"table" yaml:"table"`
Schema string `json:"schema" yaml:"schema"`
Catalog string `json:"catalog" yaml:"catalog"`
SchemaName string `json:"schema_name" yaml:"schema_name"`
SchemaVersion string `json:"schema_version" yaml:"schema_version"`
IncludeCols []string `json:"include_columns" yaml:"include_columns"`
ExcludeCols []string `json:"exclude_columns" yaml:"exclude_columns"`
ColumnMapping map[string]string `json:"column_mapping" yaml:"column_mapping"`
}
SchemaConfig controls SQL schema introspection.
type SchemaFactory ¶
type SchemaFactory struct{}
SchemaFactory creates SQL schema providers.
func (*SchemaFactory) Create ¶
func (f *SchemaFactory) Create(config adapters.SchemaSourceConfig) (adapters.SchemaProvider, error)
func (*SchemaFactory) GetConfigSchema ¶
func (f *SchemaFactory) GetConfigSchema() adapters.ConfigSchema
func (*SchemaFactory) ValidateConfig ¶
func (f *SchemaFactory) ValidateConfig(config adapters.SchemaSourceConfig) error
type SchemaProvider ¶
type SchemaProvider struct {
// contains filtered or unexported fields
}
SchemaProvider introspects SQL tables into JSON schema definitions.
func (*SchemaProvider) Close ¶
func (p *SchemaProvider) Close() error
func (*SchemaProvider) LoadSchemas ¶
func (p *SchemaProvider) LoadSchemas(ctx context.Context) ([]adapters.SchemaDefinition, error)
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source implements a generic SQL fact source with batch or streaming modes.
func (*Source) GetMetadata ¶
func (s *Source) GetMetadata() adapters.SourceMetadata
GetMetadata returns source metadata.
func (*Source) GetSourceSchema ¶
GetSourceSchema returns schema metadata.
func (*Source) HealthCheck ¶
HealthCheck checks DB connectivity.
Click to show internal directories.
Click to hide internal directories.