schemas

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Optional = "optional"
	Required = "required"
	Empty    = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	OutputDir string

	// AllowDangerousTypes allows types which are usually omitted from CRD generation
	// because they are not recommended.
	//
	// Currently the following additional types are allowed when this is true:
	// float32
	// float64
	//
	// Left unspecified, the default is false
	AllowDangerousTypes *bool `marker:",optional"`
}

Generator generates JSON schema objects.

func (Generator) CheckFilter

func (Generator) CheckFilter() loader.NodeFilter

func (Generator) Generate

func (g Generator) Generate(ctx *genall.GenerationContext) error

func (Generator) RegisterMarkers

func (Generator) RegisterMarkers(into *markers.Registry) error

type GeneratorContext

type GeneratorContext struct {
	// contains filtered or unexported fields
}

func (*GeneratorContext) NeedSchemaFor

func (context *GeneratorContext) NeedSchemaFor(typ crd.TypeIdent)
func (context *GeneratorContext) TypeRefLink(from *loader.Package, to crd.TypeIdent) string

type ObjName added in v0.2.0

type ObjName string

func (ObjName) ApplyToSchema added in v0.2.0

func (n ObjName) ApplyToSchema(schema *apiext.JSONSchemaProps) error

type SchemaMarker

type SchemaMarker interface {
	// ApplyToSchema is called after the rest of the schema for a given type
	// or field is generated, to modify the schema appropriately.
	ApplyToSchema(*apiext.JSONSchemaProps) error
}

SchemaMarker is any marker that needs to modify the schema of the underlying type or field.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL