scheduled

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 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")
	// ErrDependenciesNotAllowed is returned when dependencies are specified for scheduled transformations
	ErrDependenciesNotAllowed = errors.New("dependencies cannot be specified for scheduled transformations")
	// 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

func ValidateScheduleFormat

func ValidateScheduleFormat(schedule string) error

ValidateScheduleFormat validates a cron schedule expression

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
	Tags     []string `yaml:"tags,omitempty"`
	Exec     string   `yaml:"exec,omitempty"`
	SQL      string   `yaml:"-"` // SQL content from separate file
}

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) GetID

func (h *Handler) GetID() string

GetID returns the unique identifier for the transformation model

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) 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