crd

package
v0.0.0-...-dfd0391 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAnnotation

func GetAnnotation(c, name string) string

GetAnnotation extracts the annotation from comment text. It will return "foo" for comment "+kubebuilder:webhook:foo" .

func GetVersion

func GetVersion(pwd string) string

GetVersion returns version of t.

func HasDocAnnotation

func HasDocAnnotation(comments []string) bool

HasDocAnnotation returns true if t is an APIResource with doc annotation +kubebuilder:doc

func HasSubresource

func HasSubresource(comments []string) bool

HasSubresource returns true if t is an APIResource with one or more Subresources

func IsAPIResource

func IsAPIResource(comments []string) bool

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

func IsAPISubresource(comments []string) bool

IsAPISubresource returns true if t has a +subresource-request comment tag

func IsInformer

func IsInformer(comments []string) bool

IsInformer returns true if t has a +informers or +kubebuilder:informers tag

func IsNonNamespaced

func IsNonNamespaced(comments []string) bool

IsNonNamespaced returns true if t has a +nonNamespaced comment tag

func ParseKV

func ParseKV(s string) (key, value string, err error)

ParseKV parses key-value string formatted as "foo=bar" and returns key and value.

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

func (*DefinitionPruner) Prune

func (pruner *DefinitionPruner) Prune(ignoreUnknownTypes bool) map[string]bool

Prune prunes the 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 MultiVersionOptions struct {
	// InputPackage is the path of the input package that contains source files.
	InputPackage string
	// Types is a list of target types.
	Types []string
	// contains filtered or unexported fields
}

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

type TypeReference struct {
	TypeName    string
	PackageName string
}

TypeReference denotes the (typeName, packageName) tuple

type WriterOptions

type WriterOptions struct {
	// OutputPath is the path that the schema will be written to.
	OutputPath string
	// OutputFormat should be either json or yaml. Default to json
	OutputFormat string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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