Documentation
¶
Overview ¶
Package external provides external model configuration and validation
Index ¶
Constants ¶
View Source
const ExternalTypeSQL = "sql"
ExternalTypeSQL identifies SQL external models
Variables ¶
View Source
var ( // ErrDatabaseRequired is returned when database is not specified ErrDatabaseRequired = errors.New("database is required") // ErrTableRequired is returned when table is not specified ErrTableRequired = errors.New("table is required") // ErrCacheConfigRequired is returned when cache configuration is not specified ErrCacheConfigRequired = errors.New("cache configuration is required") // ErrInvalidIncrementalInterval is returned when incremental scan interval is invalid ErrInvalidIncrementalInterval = errors.New("incremental_scan_interval must be positive") // ErrInvalidFullInterval is returned when full scan interval is invalid ErrInvalidFullInterval = errors.New("full_scan_interval must be positive") // ErrInvalidIntervalOrder is returned when incremental interval is not less than full interval ErrInvalidIntervalOrder = errors.New("incremental_scan_interval must be less than full_scan_interval") )
View Source
var ( // ErrInvalidFrontmatter is returned when frontmatter is invalid ErrInvalidFrontmatter = errors.New("invalid frontmatter") // ErrSQLContentRequired is returned when SQL content is not specified ErrSQLContentRequired = errors.New("sql content is required") )
Functions ¶
This section is empty.
Types ¶
type CacheConfig ¶ added in v0.0.2
type CacheConfig struct {
IncrementalScanInterval time.Duration `yaml:"incremental_scan_interval"`
FullScanInterval time.Duration `yaml:"full_scan_interval"`
}
CacheConfig defines caching configuration for external models
type Config ¶
type Config struct {
Database string `yaml:"database"` // Optional, can fall back to default
Table string `yaml:"table" validate:"required"`
Cache *CacheConfig `yaml:"cache"`
Lag uint64 `yaml:"lag"`
}
Config defines configuration for external models
func (*Config) SetDefaults ¶ added in v0.0.8
SetDefaults applies default values to the configuration
type SQL ¶
SQL represents an external SQL model with YAML frontmatter
func NewExternalSQL ¶
NewExternalSQL creates a new external SQL model from content
func (*SQL) GetConfigMutable ¶ added in v0.0.24
GetConfigMutable returns a mutable pointer to the external model configuration
func (*SQL) SetDefaultDatabase ¶ added in v0.0.8
SetDefaultDatabase applies the default database if not already set
Click to show internal directories.
Click to hide internal directories.