Documentation
¶
Index ¶
Constants ¶
View Source
const ( TargetType markers.TargetType = markers.DescribesType TargetField markers.TargetType = markers.DescribesField )
View Source
const (
// Kubebuilder marker used in comments
Kubebuilder = "+kubebuilder:"
)
Variables ¶
View Source
var AllDefinitions []*definitionWithHelp
AllDefinitions contains all marker definitions for this package.
View Source
var ValidationMarkers = mustMakeAllWithPrefix("kubebuilder:validation", markers.DescribesField, XValidation{}, Type(""), )
Functions ¶
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) ApplyRulesToSchema ¶
func (*Registry) GetSchemaType ¶
func (*Registry) MustApplyRulesToSchema ¶
type SchemaMarker ¶
type Type ¶
type Type string
Type is a marker that specifies the type of a field in the schema It only supports the following types: - object: an opaque object - value: an opauqe value
func (Type) ApplyToSchema ¶
func (Type) Help ¶
func (Type) Help() *markers.DefinitionHelp
type XValidation ¶
type XValidation struct { Rule string `json:"rule"` Message string `marker:",optional" json:"message,omitempty"` MessageExpression string `marker:",optional" json:"messageExpression,omitempty"` }
XValidation marks a field as requiring a value for which a given expression evaluates to true.
This marker may be repeated to specify multiple expressions, all of which must evaluate to true.
func (XValidation) ApplyToSchema ¶
func (x XValidation) ApplyToSchema(o *openapi3.Schema)
func (XValidation) Help ¶
func (XValidation) Help() *markers.DefinitionHelp
Click to show internal directories.
Click to hide internal directories.