Documentation ¶
Index ¶
- func GetListMapKeys(definition spec.Schema) ([]string, error)
- func GetListType(definition spec.Schema) (*string, error)
- func GetPatchMergeKeyExtension(definition spec.Schema) (*string, error)
- func GetPatchStrategyExtension(definition spec.Schema) (*string, error)
- type APIGroup
- type APIKind
- type APIVersion
- type GVKExtension
- type GVToKeyMap
- type Key
- type Property
- type Resource
- type ResourceList
- type ResourceMap
- type Spec
- type VersionStage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetListMapKeys ¶
GetListMapKeys returns the ListMapKeys extension of a definition, or nil if not found
func GetListType ¶
GetListType returns the ListType extension of a definition, or nil if not found
func GetPatchMergeKeyExtension ¶
GetPatchMergeKeyExtension returns the GetPatchMergeKey extension of a definition, or nil if not found
Types ¶
type APIGroup ¶
type APIGroup string
APIGroup represents the group of a Kubernetes API
type APIVersion ¶
type APIVersion struct { // Version is the *1* in v1alpha2 Version int // Stage is *alpha* in v1alpha2 Stage VersionStage // StageVersion is *2* in v1alpha2, or nil in v1 StageVersion *int }
APIVersion represents the version of a Kubernetes API (v1aplha1, v1beta2, v1, v2, etc)
func NewAPIVersion ¶
func NewAPIVersion(literal string) (apiversion *APIVersion, err error)
NewAPIVersion creates a new APIVersion struct from the literal version (for example v1alpha1)
func (*APIVersion) Equals ¶
func (o *APIVersion) Equals(p *APIVersion) bool
Equals returns true if 'o' and 'p' represent the same version
func (*APIVersion) LessThan ¶
func (o *APIVersion) LessThan(p *APIVersion) bool
LessThan returns true if 'o' version comes before 'p' version
func (*APIVersion) Replaces ¶
func (o *APIVersion) Replaces(p *APIVersion) bool
Replaces returns true if 'o' version replaces 'p' version
func (*APIVersion) String ¶
func (o *APIVersion) String() string
String returns the literal representation of an APIVersion
func (*APIVersion) UnmarshalYAML ¶
func (o *APIVersion) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML helps unmarshal APIVersion values from YAML
type GVKExtension ¶
type GVKExtension struct { Group APIGroup Version APIVersion Kind APIKind }
GVKExtension represents the OpenAPI extension x-kubernetes-group-version-kind
type GVToKeyMap ¶
GVToKeyMap maps Kubernetes resource Group/Version with Spec Definition key (without Kind) e.g. GVToKey["v1"]: "io.k8s.api.core.v1"
func (GVToKeyMap) Add ¶
func (o GVToKeyMap) Add(key string, resource *Resource)
Add adds a new match between key and resource GV
type Key ¶
type Key string
Key of the resource in the OpenAPI definition (e.g. io.k8s.api.core.v1.Pod)
func (Key) GoImportPrefix ¶
GoImportPrefix returns the path to use for this group in go import
func (Key) RemoveResourceName ¶
RemoveResourceName removes the last part of the key corresponding to the resource name
func (Key) ResourceName ¶
ResourceName returns the resource name part of a key
type Property ¶
type Property struct { Name string Type string TypeKey *Key Description string Required bool RetainKeysStrategy bool MergeStrategyKey *string ListType *string ListMapKeys []string HardCodedValue *string }
Property represents a property of a definition
func NewHardCodedValueProperty ¶
NewHardCodedValueProperty returns a property with an hardcoded value (useful for apiVersion, Kind)
type Resource ¶
type Resource struct { Key Key GVKExtension Definition spec.Schema // Replaced indicates if this version is replaced by another one ReplacedBy *Key // Documented indicates if this resource was included in the TOC Documented bool }
Resource represent a Kubernetes API resource
func (*Resource) Equals ¶
func (o *Resource) Equals(group APIGroup, version APIVersion, kind APIKind) bool
Equals returns true if a resource is referenced by group/version/kind
type ResourceList ¶
type ResourceList []*Resource
ResourceList is the list of resources for a given Kind
func (ResourceList) Len ¶
func (a ResourceList) Len() int
func (ResourceList) Less ¶
func (a ResourceList) Less(i, j int) bool
func (ResourceList) Swap ¶
func (a ResourceList) Swap(i, j int)
type ResourceMap ¶
type ResourceMap map[APIKind]ResourceList
ResourceMap contains a map of resources, classified by Kind
func (*ResourceMap) Add ¶
func (o *ResourceMap) Add(resource *Resource)
Add a resource to the resource list
type Spec ¶
type Spec struct { // Swagger is the openAPI representation of the k8s spec // populated by calling getSwagger Swagger *spec.Swagger // Resources is the list of K8s resources // populated by calling getResources Resources *ResourceMap // GVToKey maps beetween Kubernetes Group/Version and Swagger definition key GVToKey GVToKeyMap }
Spec represents the Kubernetes API Specification
func (*Spec) GetDefinition ¶
GetDefinition returns the definition referenced by key
func (*Spec) GetResource ¶
func (o *Spec) GetResource(group APIGroup, version APIVersion, kind APIKind, markAsDocumented bool) (Key, *spec.Schema)
GetResource returns the resource referenced by group/version/kind, or nil if not found
type VersionStage ¶
type VersionStage int
VersionStage represents the stage of the version: alpha, beta, ga
const ( // StageAlpha is the first stage during development StageAlpha VersionStage = iota // StageBeta is the next stage StageBeta // StageGA is the latest stage StageGA )