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. |
Click to show internal directories.
Click to hide internal directories.