Documentation ¶
Index ¶
- Variables
- func GenerateOpenApiValidationSchemas(project *model.Project, options *ValidationSchemaOptions, ...) error
- func GetCRDFromFile(pathToFile string) (apiextv1.CustomResourceDefinition, error)
- func GetCRDsFromDirectory(crdDirectory string) ([]apiextv1.CustomResourceDefinition, error)
- func NewCueGenerator(importsCollector collector.Collector, absoluteRoot string) *cueGenerator
- func NewProtocGenerator(importsCollector collector.Collector, absoluteRoot string, ...) *protocGenerator
- type CrdWriter
- type JsonSchemaGenerator
- type OpenApiSchemas
- type ValidationSchemaOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ApiVersionMismatch = func(expected, actual string) error { return eris.Errorf("Expected ApiVersion [%s] but found [%s]", expected, actual) } )
Functions ¶
func GetCRDFromFile ¶ added in v0.20.2
func GetCRDFromFile(pathToFile string) (apiextv1.CustomResourceDefinition, error)
func GetCRDsFromDirectory ¶ added in v0.20.2
func GetCRDsFromDirectory(crdDirectory string) ([]apiextv1.CustomResourceDefinition, error)
func NewCueGenerator ¶
func NewProtocGenerator ¶
func NewProtocGenerator(importsCollector collector.Collector, absoluteRoot string, validationSchemaOptions *ValidationSchemaOptions) *protocGenerator
Types ¶
type CrdWriter ¶
type CrdWriter struct {
// contains filtered or unexported fields
}
func NewCrdWriter ¶
func (*CrdWriter) ApplyValidationSchemaToCRD ¶
func (c *CrdWriter) ApplyValidationSchemaToCRD(crd apiextv1.CustomResourceDefinition, validationSchema *apiextv1.CustomResourceValidation) error
type JsonSchemaGenerator ¶
type JsonSchemaGenerator interface {
GetJsonSchemaForProject(project *model.Project) (map[schema.GroupVersionKind]*apiextv1.JSONSchemaProps, error)
}
type OpenApiSchemas ¶
type OpenApiSchemas map[string]*openapi.OrderedMap
Mapping from protobuf message name to OpenApi schema
type ValidationSchemaOptions ¶
type ValidationSchemaOptions struct { // Path to the directory where CRDs will be read from and written to CrdDirectory string // Tool used to generate JsonSchemas, defaults to protoc JsonSchemaTool string // Whether to remove descriptions from validation schemas // Default: false // // NOTE: I'd prefer a positive field name (ie includeDescriptions) // but I wanted to avoid changing the default behavior RemoveDescriptionsFromSchema bool // Whether to assign Enum fields the `x-kubernetes-int-or-string` property // which allows the value to either be an integer or a string // If this is false, only string values are allowed // Default: false EnumAsIntOrString bool // A list of messages (core.solo.io.Status) whose validation schema should // not be generated MessagesWithEmptySchema []string // Whether to exclude kubebuilder markers and validations (such as PreserveUnknownFields, MinItems, default, and all CEL rules) // Type and Required markers will be included regardless // Default: false DisableKubeMarkers bool }
Click to show internal directories.
Click to hide internal directories.