validation

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: GPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package validation provides dependency validation for CBT models

Package validation provides dependency validation for CBT models

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrModelNotFound          = errors.New("model not found")
	ErrDependencyNotFound     = errors.New("dependency model not found")
	ErrRangeNotAvailable      = errors.New("required range not available")
	ErrRangeNotCovered        = errors.New("range not fully covered")
	ErrNotTransformationModel = errors.New("model is not a transformation")
	ErrInvalidDependencyType  = errors.New("invalid dependency type")
	ErrInvalidModelType       = errors.New("invalid dependency model type")
	ErrFailedModelCast        = errors.New("failed to cast model to transformation")
)

Validation-specific errors

View Source
var (
	// ErrNotSQLModel is returned when external model is not a SQL model
	ErrNotSQLModel = errors.New("external model is not a SQL model")
)

Functions

This section is empty.

Types

type DependencyStatus

type DependencyStatus struct {
	ModelID   string
	Available bool
	MinPos    uint64
	MaxPos    uint64
	Error     error
}

DependencyStatus represents the status of a single dependency

type DependencyValidator

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

DependencyValidator implements the DependencyValidator interface

func NewDependencyValidator

func NewDependencyValidator(
	log *logrus.Logger,
	chClient clickhouse.ClientInterface,
	adminService *admin.Service,
	modelsService *models.Service,
) *DependencyValidator

NewDependencyValidator creates a new dependency validator

func (*DependencyValidator) GetInitialPosition

func (v *DependencyValidator) GetInitialPosition(ctx context.Context, modelID string) (uint64, error)

GetInitialPosition calculates the initial position for a model based on its dependencies Returns the earliest position where all dependencies have data available

func (*DependencyValidator) ValidateDependencies

func (v *DependencyValidator) ValidateDependencies(ctx context.Context, modelID string, position, interval uint64) (Result, error)

ValidateDependencies checks if all dependencies are satisfied for a model at a given position

type ExternalModelValidator

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

ExternalModelValidator implements the ExternalModelExecutor interface

func NewExternalModelExecutor

func NewExternalModelExecutor(log *logrus.Logger, chClient clickhouse.ClientInterface, adminService *admin.Service, modelsService *models.Service) *ExternalModelValidator

NewExternalModelExecutor creates a new external model executor The cacheManager can be nil if caching is not desired

func (*ExternalModelValidator) GetMinMax

func (e *ExternalModelValidator) GetMinMax(ctx context.Context, model models.External) (minPos, maxPos uint64, err error)

GetMinMax retrieves the min and max position values for an external model

type Result

type Result struct {
	CanProcess   bool
	Dependencies []DependencyStatus
	Errors       []error
}

Result contains the result of dependency validation

Jump to

Keyboard shortcuts

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