Documentation ¶
Index ¶
- func GetAnnotation(c, name string) string
- func GetVersion(pwd string) string
- func HasDocAnnotation(comments []string) bool
- func HasSubresource(comments []string) bool
- func IsAPIResource(comments []string) bool
- func IsAPISubresource(comments []string) bool
- func IsInformer(comments []string) bool
- func IsNonNamespaced(comments []string) bool
- func ParseKV(s string) (key, value string, err error)
- type Comments
- type DefinitionPruner
- type ExternalReferences
- type MultiVersionGenerator
- type MultiVersionOptions
- type SingleVersionGenerator
- type SingleVersionOptions
- type TypeReference
- type WriterOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAnnotation ¶
GetAnnotation extracts the annotation from comment text. It will return "foo" for comment "+kubebuilder:webhook:foo" .
func HasDocAnnotation ¶
HasDocAnnotation returns true if t is an APIResource with doc annotation +kubebuilder:doc
func HasSubresource ¶
HasSubresource returns true if t is an APIResource with one or more Subresources
func IsAPIResource ¶
IsAPIResource returns true if either of the two conditions become true: 1. t has a +resource/+kubebuilder:resource comment tag 2. t has TypeMeta and ObjectMeta in its member list.
func IsAPISubresource ¶
IsAPISubresource returns true if t has a +subresource-request comment tag
func IsInformer ¶
IsInformer returns true if t has a +informers or +kubebuilder:informers tag
func IsNonNamespaced ¶
IsNonNamespaced returns true if t has a +nonNamespaced comment tag
Types ¶
type Comments ¶
type Comments []string
Comments is a structure for using comment tags on go structs and fields
type DefinitionPruner ¶
type DefinitionPruner struct {
// contains filtered or unexported fields
}
DefinitionPruner prunes unwanted definitions
type ExternalReferences ¶
type ExternalReferences map[string][]TypeReference
ExternalReferences map contains list of "type: packageName" entries
type MultiVersionGenerator ¶
type MultiVersionGenerator struct { MultiVersionOptions WriterOptions }
func (*MultiVersionGenerator) Generate ¶
func (op *MultiVersionGenerator) Generate()
type MultiVersionOptions ¶
type SingleVersionGenerator ¶
type SingleVersionGenerator struct { SingleVersionOptions WriterOptions // contains filtered or unexported fields }
func (*SingleVersionGenerator) Generate ¶
func (op *SingleVersionGenerator) Generate()
type SingleVersionOptions ¶
type SingleVersionOptions struct { // InputPackage is the path of the input package that contains source files. InputPackage string // Types is a list of target types. Types []string // Flatten contains if we use a flattened structure or a embedded structure. Flatten bool // contains filtered or unexported fields }
type TypeReference ¶
TypeReference denotes the (typeName, packageName) tuple