validation

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 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 combines native Go and SQL constraint checks for one invocation-scoped typed entity. It owns validation policy, not transactions.

Index

Constants

View Source
const ConnectorDSNCheck = "datly_connector_dsn"

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	DB *sql.DB
	Tx *sql.Tx
	// Dialect is existing source authority, not inferred from identifier syntax.
	Dialect *info.Dialect
}

Connection is an internal implementation carrier. Public handler capabilities receive Validator only, never this database/transaction pair.

type Service

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

func New

func New(source Source) *Service

func (*Service) MatchReference

func (s *Service) MatchReference(ctx context.Context, child, parent any, expected xhandler.ValidationReference) (*xhandler.ValidationReference, error)

MatchReference resolves an exact native constraint and compares SQL-bound values in the active default transaction. The generated caller separately proves parent INSERT policy, captured edge authority and execution order. This method neither queries the database nor issues a receipt for that proof.

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, value any, options ...any) (*xhandler.Validation, error)

type Source

type Source interface {
	ValidationConnection(context.Context, string) (Connection, error)
}

Jump to

Keyboard shortcuts

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