MCPcopy
hub / github.com/gofiber/fiber / ConstraintHandler

Interface ConstraintHandler

constraint.go:70–78  ·  constraint.go::ConstraintHandler

ConstraintHandler is the interface that all constraints must implement. Built-in and custom constraints are treated uniformly through this interface.

Source from the content-addressed store, hash-verified

68// ConstraintHandler is the interface that all constraints must implement.
69// Built-in and custom constraints are treated uniformly through this interface.
70type ConstraintHandler interface {
71 // Name returns the constraint identifier used in route patterns (e.g. "int", "minLen", "regex").
72 Name() string
73
74 // Execute validates a request parameter value against the constraint.
75 // param is the request parameter value to check.
76 // data contains the pre-typed constraint data produced by Analyze() at registration time.
77 Execute(param string, data []any) bool
78}
79
80// ConstraintAnalyzer is an optional interface that constraints can implement
81// to preprocess data at route registration time. The returned values are stored

Callers

nothing calls this directly

Implementers 15

customConstraintapp_test.go
intConstraintTypeconstraint.go
boolConstraintTypeconstraint.go
floatConstraintTypeconstraint.go
alphaConstraintTypeconstraint.go
guidConstraintTypeconstraint.go

Calls

no outgoing calls

Tested by

no test coverage detected