Documentation
¶
Index ¶
- func Feature(config ...func(installer *Installer)) miruken.Feature
- func Output(installer *Installer)
- func Rules(groups ...any) miruken.BindingConstraint
- type ApiMapping
- type ApiOutcome
- type Builder
- type Group
- type Installer
- type Outcome
- type Provider
- type Validates
- func (v *Validates) Dispatch(handler any, greedy bool, composer miruken.Handler) miruken.HandleResult
- func (v *Validates) Groups() []any
- func (v *Validates) InGroup(group any) bool
- func (v *Validates) Key() any
- func (v *Validates) Outcome() *Outcome
- func (v *Validates) Policy() miruken.Policy
- func (v *Validates) Source() any
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rules ¶
func Rules(groups ...any) miruken.BindingConstraint
Rules builds a validation Group constraint.
Types ¶
type ApiMapping ¶
type ApiMapping struct{}
ApiMapping maps validation errors for api transport.
func (*ApiMapping) ForApi ¶
func (m *ApiMapping) ForApi( _ *struct { miruken.Maps miruken.Format `to:"api:error"` }, outcome *Outcome, ) (ao []ApiOutcome)
func (*ApiMapping) FromApi ¶
func (m *ApiMapping) FromApi( _ *struct { miruken.Maps miruken.Format `from:"api:error"` }, apiOutcome []*ApiOutcome, ) (*Outcome, error)
func (*ApiMapping) New ¶ added in v0.12.0
func (m *ApiMapping) New( _ *struct { miruken.Creates `key:"validate.ApiOutcome"` }, ) *ApiOutcome
type ApiOutcome ¶
type ApiOutcome struct { PropertyName string Errors []string Nested []ApiOutcome }
ApiOutcome transports Outcome information over an api.
type Builder ¶
type Builder struct { miruken.CallbackBuilder // contains filtered or unexported fields }
Builder builds Validates callbacks.
func (*Builder) NewValidates ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group marks a set of related validations.
func (*Group) Require ¶
func (g *Group) Require(metadata *miruken.BindingMetadata)
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer configures validation support.
func (*Installer) ValidateOutput ¶
func (v *Installer) ValidateOutput()
type Outcome ¶
type Outcome struct {
// contains filtered or unexported fields
}
Outcome captures structured validation errors.
func Validate ¶
func Validate( handler miruken.Handler, target any, constraints ...any, ) (o *Outcome, po *promise.Promise[*Outcome], err error)
Validate initiates validation of the `target`.
func (*Outcome) FieldErrors ¶
func (*Outcome) RequirePath ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a FilterProvider for validation.
Click to show internal directories.
Click to hide internal directories.