validator

package
v0.3.0-20260727164855-... Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// QueueName identifies the queue this request belongs to.
	QueueName string
}

Config carries the routing identity handed to a Factory.

type Factory

type Factory interface {
	// For returns the Validator for the given config. Returning nil indicates
	// no custom validation is needed for this config.
	For(cfg Config) (Validator, error)
}

Factory builds the Validator for a given config. Implementations are provided by integrators and inject whatever they need at construction.

type Validator

type Validator interface {
	// Validate runs custom validation on the request.
	// Returns nil if validation passes, error if the request should be rejected.
	Validate(ctx context.Context, request entity.Request) error
}

Validator runs custom validation checks against a request. Implementations are provided by integrators for company-specific checks (e.g. org-policy enforcement, repo-specific rules). The built-in validate controller invokes this after fetching change metadata and before claiming URIs in the change store.

Directories

Path Synopsis
Package fake provides a validator.Validator that always passes and a validator.Factory that returns it.
Package fake provides a validator.Validator that always passes and a validator.Factory that returns it.
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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