metadata

package
v0.0.0-...-bbc7888 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeType

type KubeType interface {
	RawType() *types.Type
	Type() *types.Type
	Tags() []string
}

KubeType is the interface representing a type to be generated.

func NewKubeType

func NewKubeType(rawType *types.Type, kubeType *types.Type, tags []string) KubeType

NewKubeType returns a new KubeType object representing the source type, the target type and its comment tags

type PackageMetadata

type PackageMetadata interface {
	// GroupVersion is the k8s Group/Version to use for the generated types.
	GroupVersion() *schema.GroupVersion

	// TargetPackage is the package into which the k8s types will be generated.
	TargetPackage() *types.Package

	// RawTypes is the list of types for which k8s types should be generated.
	RawTypes() []*types.Type

	// KubeTypes is the list of k8s types to be generated for the given rawType.
	KubeTypes(rawType *types.Type) []KubeType

	// AllKubeTypes is the list of all k8s types to be generated
	AllKubeTypes() []KubeType

	// AddMetadata is used to add metadata collected by the scanner.
	AddMetadataForType(rawType *types.Type, kubeTypes ...KubeType) error

	// Validate is used to validate the metadata prior to generation
	Validate() []error
}

PackageMetadata is the interface used to provide source data used by the package generators.

type Store

type Store interface {
	// MetadataForGV returns the package metadata associated with the Group/Version
	MetadataForGV(gv *schema.GroupVersion) PackageMetadata

	// AllMetadata returns the source metadata.
	AllMetadata() []PackageMetadata

	// Validate is used to validate the metadata prior to generation
	Validate() []error
}

Store is used to store/access the source metadata collected by the scanner

func NewMetadataStore

func NewMetadataStore(baseOutputPackage *types.Package, universe *types.Universe) Store

NewMetadataStore returns a new store used for collecting source metadata used by the generator.

Jump to

Keyboard shortcuts

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