scheduled

package
v0.0.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package scheduled provides the scheduled transformation type handler

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrScheduleRequired is returned when schedule is not specified
	ErrScheduleRequired = errors.New("schedule is required for scheduled transformations")
	// ErrIntervalNotAllowed is returned when interval is specified for scheduled transformations
	ErrIntervalNotAllowed = errors.New("interval cannot be specified for scheduled transformations")
	// ErrSchedulesNotAllowed is returned when schedules are specified for scheduled transformations
	ErrSchedulesNotAllowed = errors.New("schedules (forwardfill/backfill) cannot be specified for scheduled transformations, use schedule field instead")
	// ErrAdminServiceInvalid is returned when admin service doesn't implement required interface
	ErrAdminServiceInvalid = errors.New("admin service does not implement RecordScheduledCompletion")
)

Functions

func Register

func Register()

Register registers the scheduled handler with the global registry

Types

type Config

type Config struct {
	Type         string                      `yaml:"type"`
	Database     string                      `yaml:"database"`
	Table        string                      `yaml:"table"`
	Schedule     string                      `yaml:"schedule"` // Cron expression for scheduling
	Dependencies []transformation.Dependency `yaml:"dependencies,omitempty"`
	Tags         []string                    `yaml:"tags,omitempty"`
	Env          map[string]string           `yaml:"env,omitempty"` // Model-specific environment variables
	Exec         string                      `yaml:"exec,omitempty"`
	SQL          string                      `yaml:"-"` // SQL content from separate file

	// OriginalDependencies stores the dependencies before placeholder substitution
	OriginalDependencies []transformation.Dependency `yaml:"-"`
}

Config defines the configuration for scheduled transformation models

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles scheduled transformation type operations

func NewHandler

func NewHandler(data []byte, adminTable transformation.AdminTable) (*Handler, error)

NewHandler creates a new handler for scheduled transformations

func (*Handler) ApplyOverrides added in v0.0.27

func (h *Handler) ApplyOverrides(override interface{})

ApplyOverrides applies configuration overrides to this scheduled transformation handler Uses reflection to avoid circular dependency with models package

func (*Handler) Config

func (h *Handler) Config() any

Config returns the typed configuration

func (*Handler) GetAdminTable

func (h *Handler) GetAdminTable() transformation.AdminTable

GetAdminTable returns the admin table configuration

func (*Handler) GetDependencies added in v0.0.45

func (h *Handler) GetDependencies() []transformation.Dependency

GetDependencies returns the dependencies (after placeholder substitution)

func (*Handler) GetFlattenedDependencies added in v0.0.45

func (h *Handler) GetFlattenedDependencies() []string

GetFlattenedDependencies returns all dependencies as a flat string array

func (*Handler) GetID

func (h *Handler) GetID() string

GetID returns the unique identifier for the transformation model

func (*Handler) GetOriginalDependencies added in v0.0.45

func (h *Handler) GetOriginalDependencies() []transformation.Dependency

GetOriginalDependencies returns the original dependencies before placeholder substitution

func (*Handler) GetSchedule

func (h *Handler) GetSchedule() string

GetSchedule returns the cron schedule expression

func (*Handler) GetTags

func (h *Handler) GetTags() []string

GetTags returns the tags for this transformation

func (*Handler) GetTemplateVariables

func (h *Handler) GetTemplateVariables(_ context.Context, taskInfo transformation.TaskInfo) map[string]any

GetTemplateVariables returns template variables for scheduled transformations

func (*Handler) RecordCompletion

func (h *Handler) RecordCompletion(ctx context.Context, adminService any, modelID string, taskInfo transformation.TaskInfo) error

RecordCompletion records the completion of a scheduled transformation

func (*Handler) ShouldTrackPosition

func (h *Handler) ShouldTrackPosition() bool

ShouldTrackPosition returns false for scheduled transformations

func (*Handler) SubstituteDependencyPlaceholders added in v0.0.45

func (h *Handler) SubstituteDependencyPlaceholders(externalDefaultDB, transformationDefaultDB string)

SubstituteDependencyPlaceholders replaces {{external}} and {{transformation}} placeholders

func (*Handler) Type

func (h *Handler) Type() transformation.Type

Type returns the transformation type (scheduled)

func (*Handler) Validate

func (h *Handler) Validate() error

Validate validates the configuration for scheduled transformations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL