Documentation
¶
Overview ¶
Package transformation provides transformation model configuration and validation
Index ¶
- Constants
- Variables
- func ValidateScheduleFormat(schedule string) error
- type Config
- func (c *Config) AllowsPartialIntervals() bool
- func (c *Config) GetBackfillSchedule() string
- func (c *Config) GetForwardSchedule() string
- func (c *Config) GetID() string
- func (c *Config) GetMaxInterval() uint64
- func (c *Config) GetMaxLimit() uint64
- func (c *Config) GetMinInterval() uint64
- func (c *Config) GetMinLimit() uint64
- func (c *Config) HasLimits() bool
- func (c *Config) IsBackfillEnabled() bool
- func (c *Config) IsForwardFillEnabled() bool
- func (c *Config) Validate() error
- type Exec
- type ExecParser
- type IntervalConfig
- type LimitsConfig
- type SQL
- type SQLParser
- type SchedulesConfig
Constants ¶
const TransformationTypeExec = "exec"
TransformationTypeExec identifies exec transformation models
const TransformationTypeSQL = "sql"
TransformationTypeSQL identifies SQL transformation models
Variables ¶
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") // ErrNoSchedulesConfig is returned when no schedules are configured ErrNoSchedulesConfig = errors.New("at least one schedule must be configured") // ErrIntervalRequired is returned when interval is not specified ErrIntervalRequired = errors.New("interval configuration is required") // ErrIntervalMaxRequired is returned when interval.max is not specified ErrIntervalMaxRequired = errors.New("interval.max is required") // ErrInvalidInterval is returned when interval.min exceeds interval.max ErrInvalidInterval = errors.New("interval.min cannot exceed interval.max") // ErrDependenciesRequired is returned when dependencies are not specified ErrDependenciesRequired = errors.New("dependencies is required") // ErrInvalidLimits is returned when min limit is greater than max limit ErrInvalidLimits = errors.New("min limit cannot be greater than max limit") )
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") )
var ( // ErrExecRequired is returned when exec is not specified ErrExecRequired = errors.New("exec is required") )
Functions ¶
func ValidateScheduleFormat ¶
ValidateScheduleFormat validates a cron schedule expression
Types ¶
type Config ¶
type Config struct {
Database string `yaml:"database"`
Table string `yaml:"table"`
Limits *LimitsConfig `yaml:"limits,omitempty"`
Interval *IntervalConfig `yaml:"interval"`
Schedules *SchedulesConfig `yaml:"schedules"`
Dependencies []string `yaml:"dependencies"`
Tags []string `yaml:"tags"`
}
Config defines the configuration for transformation models
func (*Config) AllowsPartialIntervals ¶ added in v0.0.7
AllowsPartialIntervals returns true if partial intervals are allowed
func (*Config) GetBackfillSchedule ¶ added in v0.0.7
GetBackfillSchedule returns the schedule for backfill operations
func (*Config) GetForwardSchedule ¶ added in v0.0.2
GetForwardSchedule returns the schedule for forward fill operations
func (*Config) GetMaxInterval ¶ added in v0.0.7
GetMaxInterval returns the maximum interval size
func (*Config) GetMaxLimit ¶ added in v0.0.2
GetMaxLimit returns the maximum position limit (0 means no limit)
func (*Config) GetMinInterval ¶ added in v0.0.7
GetMinInterval returns the minimum interval size
func (*Config) GetMinLimit ¶ added in v0.0.2
GetMinLimit returns the minimum position limit
func (*Config) IsBackfillEnabled ¶ added in v0.0.2
IsBackfillEnabled returns true if backfill is configured
func (*Config) IsForwardFillEnabled ¶ added in v0.0.7
IsForwardFillEnabled returns true if forward fill is configured
type Exec ¶
Exec represents a transformation exec model with YAML config
func NewTransformationExec ¶
NewTransformationExec creates a new transformation exec model from content
type IntervalConfig ¶ added in v0.0.7
type IntervalConfig struct {
Max uint64 `yaml:"max"` // Maximum interval size for processing
Min uint64 `yaml:"min"` // Minimum interval size (0 = allow any partial size)
}
IntervalConfig defines interval configuration for transformations
func (*IntervalConfig) Validate ¶ added in v0.0.7
func (c *IntervalConfig) Validate() error
Validate checks if the interval configuration is valid
type LimitsConfig ¶ added in v0.0.2
LimitsConfig defines position limits for transformations
func (*LimitsConfig) Validate ¶ added in v0.0.2
func (c *LimitsConfig) Validate() error
Validate checks if the limits configuration is valid
type SQL ¶
SQL represents a transformation SQL model with YAML frontmatter
func NewTransformationSQL ¶
NewTransformationSQL creates a new transformation SQL model from content
type SchedulesConfig ¶ added in v0.0.7
type SchedulesConfig struct {
ForwardFill string `yaml:"forwardfill,omitempty"` // Forward fill schedule (optional)
Backfill string `yaml:"backfill,omitempty"` // Backfill schedule (optional)
}
SchedulesConfig defines scheduling configuration for transformations
func (*SchedulesConfig) Validate ¶ added in v0.0.7
func (c *SchedulesConfig) Validate() error
Validate checks if the schedules configuration is valid