Documentation
¶
Index ¶
- func AddLicenseHeader(f *jen.File)
- func FromConfig(resultPath, crdKind, controllerOutDir, indexerOutDir, typesPath string, ...) error
- func GenerateIndexers(resultPath, crdKind, indexerOutDir string) error
- func GenerateServiceLayers(resourceName string, mappings []MappingWithConfig, translationOutDir string) error
- func GetAtlasAPIForCRD(crdKind string) (string, error)
- func PrintCRDs(resultPath string) error
- type APIMapping
- type CRDDocument
- type CRDInfo
- type CRDMetadata
- type CRDVersionInfo
- type IndexerInfo
- type KubernetesMapping
- type KubernetesRefType
- type MappingWithConfig
- type OpenAPIConfig
- type OpenAPIMapping
- type ParsedConfig
- type PropertyMapping
- type ReferenceField
- type SpecProperty
- type VersionProperties
- type VersionProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLicenseHeader ¶
AddLicenseHeader adds the standard license header to generated files
func FromConfig ¶
func FromConfig(resultPath, crdKind, controllerOutDir, indexerOutDir, typesPath string, override bool) error
FromConfig generates controllers and handlers based on the parsed CRD result file
func GenerateIndexers ¶
func GenerateServiceLayers ¶
func GenerateServiceLayers(resourceName string, mappings []MappingWithConfig, translationOutDir string) error
GenerateServiceLayers generates service layers for all mappings
func GetAtlasAPIForCRD ¶
GetAtlasAPIForCRD maps CRD kinds to their corresponding Atlas API types
Types ¶
type APIMapping ¶
type APIMapping struct {
Properties map[string]SpecProperty `yaml:"properties"`
}
type CRDDocument ¶
type CRDDocument struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata CRDMetadata `yaml:"metadata"`
Spec v1.CustomResourceDefinitionSpec `yaml:"spec"`
}
type CRDInfo ¶
type CRDInfo struct {
Kind string
Group string
Version string
Plural string
ShortNames []string
Categories []string
Versions []CRDVersionInfo
}
func ParseCRDResult ¶
type CRDMetadata ¶
type CRDVersionInfo ¶
type IndexerInfo ¶
type KubernetesMapping ¶
type KubernetesMapping struct {
NameSelector string `yaml:"nameSelector"`
Properties []string `yaml:"properties"`
Type KubernetesRefType `yaml:"type"`
}
type KubernetesRefType ¶
type MappingWithConfig ¶
type MappingWithConfig struct {
Version string
OpenAPIConfig OpenAPIConfig
}
type OpenAPIConfig ¶
type OpenAPIMapping ¶
type ParsedConfig ¶
type ParsedConfig struct {
SelectedCRD CRDInfo
Mappings []MappingWithConfig
ResourceName string
APIVersion string // API version package (e.g., "v1", "v3")
StorageVersion string
PluralName string
CRDGroup string
}
func ParseCRDConfig ¶
func ParseCRDConfig(resultPath, crdKind string) (*ParsedConfig, error)
type PropertyMapping ¶
type PropertyMapping struct {
KubernetesMapping *KubernetesMapping `yaml:"x-kubernetes-mapping,omitempty"`
OpenAPIMapping *OpenAPIMapping `yaml:"x-openapi-mapping,omitempty"`
}
type ReferenceField ¶
type ReferenceField struct {
FieldName string
FieldPath string
ReferencedKind string
ReferencedGroup string
ReferencedVersion string
IndexerType string
}
func ParseReferenceFields ¶
func ParseReferenceFields(resultPath, crdKind string) ([]ReferenceField, error)
type SpecProperty ¶
type SpecProperty struct {
Properties map[string]VersionProperty `yaml:"properties"`
}
type VersionProperties ¶
type VersionProperties struct {
Properties map[string]PropertyMapping `yaml:"properties"`
}
type VersionProperty ¶
type VersionProperty struct {
AtlasSDKVersion string `yaml:"x-atlas-sdk-version"`
}
Click to show internal directories.
Click to hide internal directories.