Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// IgnoreUnexportedFields indicates that we should skip unexported fields.
//
// Left unspecified, the default is false.
IgnoreUnexportedFields *bool `marker:",optional"`
// 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"`
// MaxDescLen specifies the maximum description length for fields in CRD's OpenAPI schema.
//
// 0 indicates drop the description for all fields completely.
// n indicates limit the description to at most n characters and truncate the description to
// closest sentence boundary if it exceeds n characters.
MaxDescLen *int `marker:",optional"`
// CRDVersions specifies the target API versions of the CRD type itself to
// generate. Defaults to v1.
//
// Currently, the only supported value is v1.
//
// The first version listed will be assumed to be the "default" version and
// will not get a version suffix in the output filename.
//
// You'll need to use "v1" to get support for features like defaulting,
// along with an API server that supports it (Kubernetes 1.16+).
CRDVersions []string `marker:"crdVersions,optional"`
// GenerateEmbeddedObjectMeta specifies if any embedded ObjectMeta in the CRD should be generated
GenerateEmbeddedObjectMeta *bool `marker:",optional"`
}
Generator is a generator for XRDs.
func (Generator) CheckFilter ¶
func (Generator) CheckFilter() loader.NodeFilter
CheckFilter returns the node filter for this generator.
type PackageOverride ¶
PackageOverride overrides the loading of some package (potentially setting custom schemata, etc). It must call AddPackage if it wants to continue with the default loading behavior.
type Parser ¶
type Parser struct {
Collector *markers.Collector
// Types contains the known TypeInfo for this parser.
Types map[crd.TypeIdent]*markers.TypeInfo
// GroupVersions contains the known group-versions of each package in this parser.
GroupVersions map[*loader.Package]schema.GroupVersion
// PackageOverrides indicates that the loading of any package with
// the given path should be handled by the given overrider.
PackageOverrides map[string]PackageOverride
// checker stores persistent partial type-checking/reference-traversal information.
Checker *loader.TypeChecker
// contains filtered or unexported fields
}
Parser is used to apply XRD markers.
func (*Parser) AddPackage ¶
AddPackage indicates that types and type-checking information is needed for the the given package, *ignoring* overrides. Generally, consumers should call NeedPackage, while PackageOverrides should call AddPackage to continue with the normal loading procedure.
func (*Parser) ApplyForXRD ¶
func (p *Parser) ApplyForXRD(xrd *xapiext.CompositeResourceDefinition)
ApplyForXRD applies all markers to the generated XRD.
func (*Parser) NeedPackage ¶
NeedPackage indicates that types and type-checking information is needed for the given package.