Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SchemaFrom ¶
func SchemaFrom(typ reflect.Type) *apiext.JSONSchemaProps
SchemaFrom builds an openapi schema for a given type as described by the kubernetes apiextensions server. These schema's are used to translate Go types to openapi to be consumed by CustomResourceDefinitions.
The following JSON Tags are supported and will add their properties to the resulting schema for a given field: "Enum", "XValidations", "Maximum", "Minimum", "MaxLength", "MinLength", "MaxItems", "MinItems", "UniqueItems", "Pattern", "ExclusiveMaximum", "ExclusiveMinimum", "MultipleOf", "Format"
JSON Tags with an improper value (Say a string where an int is expected for example: `MaxLenghth:"hello"`) will cause a panic.
Types ¶
type Duration ¶
func (Duration) MarshalJSON ¶
func (Duration) OpenAPISchema ¶
func (Duration) OpenAPISchema() *apiext.JSONSchemaProps
func (*Duration) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.