Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeCRD(content []byte) (*apiextensionsv1.CustomResourceDefinition, error)
- func FromOpenAPIType(td *gotype.TypeDict, hooks []OpenAPI2GoHook, crdType *CRDType) (*gotype.GoType, error)
- func IsDateTimeFormat(crdType *CRDType) bool
- func IsPrimitive(crdType *CRDType) bool
- func Kind2Filename(kind string) string
- func ParseCRD(scanner *bufio.Scanner) (*apiextensionsv1.CustomResourceDefinition, error)
- type CRDType
- type OpenAPI2GoHook
- type VersionedCRD
Constants ¶
View Source
const ( OpenAPIObject = "object" OpenAPIArray = "array" OpenAPIString = "string" OpenAPIInteger = "integer" OpenAPINumber = "number" OpenAPIBoolean = "boolean" )
View Source
const (
FirstVersion = ""
)
Variables ¶
View Source
var ( // ErrNoCRD failure when the YAML is not a CRD ErrNoCRD = errors.New("not a CRD") )
View Source
var ( // ErrNotProcessed means the hook did nothing as the CRDType did not apply to this hook ErrNotProcessed = errors.New("hook not") )
Functions ¶
func DecodeCRD ¶
func DecodeCRD(content []byte) (*apiextensionsv1.CustomResourceDefinition, error)
func FromOpenAPIType ¶
func FromOpenAPIType(td *gotype.TypeDict, hooks []OpenAPI2GoHook, crdType *CRDType) (*gotype.GoType, error)
FromOpenAPIType converts an OpenAPI schema to a GoType
func IsDateTimeFormat ¶
func IsPrimitive ¶
func Kind2Filename ¶
func ParseCRD ¶
func ParseCRD(scanner *bufio.Scanner) (*apiextensionsv1.CustomResourceDefinition, error)
ParseCRD scans a YAML stream and returns the next CRD found. If more than one CRD is present in the stream, calling again on the same stream will return the next CRD found.
Types ¶
type CRDType ¶
type CRDType struct {
Name string
Parents []string
Schema *apiextensionsv1.JSONSchemaProps
}
type OpenAPI2GoHook ¶
type VersionedCRD ¶
type VersionedCRD struct {
// Spec *apiextensionsv1.CustomResourceDefinitionSpec
Kind string
Version *apiextensionsv1.CustomResourceDefinitionVersion
}
func NewVersionedCRD ¶
func NewVersionedCRD(spec *apiextensionsv1.CustomResourceDefinitionSpec, version *apiextensionsv1.CustomResourceDefinitionVersion) *VersionedCRD
func SelectVersion ¶
func SelectVersion(spec *apiextensionsv1.CustomResourceDefinitionSpec, version string) *VersionedCRD
SelectVersion returns the version from the CRD spec that matches the given version string
func (*VersionedCRD) SpecTypename ¶
func (versionedCRD *VersionedCRD) SpecTypename() string
func (*VersionedCRD) StatusTypename ¶
func (versionedCRD *VersionedCRD) StatusTypename() string
Click to show internal directories.
Click to hide internal directories.