parser

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientsGeneratedForType

func ClientsGeneratedForType(info *markers.TypeInfo) bool

ClientsGeneratedForType verifies if the genclient marker is enabled for this type or not.

func CollectKinds

func CollectKinds(ctx *genall.GenerationContext, verbs ...string) (map[Group]map[types.PackageVersion][]Kind, error)

CollectKinds finds all groupVersionKinds for which the k8s client-generators are run and the set of verbs are supported. When we are looking at a package, we can determine the group and version by copying the upstream logic: https://github.com/kubernetes/kubernetes/blob/f046bdf24e69ac31d3e1ed56926d9a7c715f1cc8/staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go#L93-L106

func GenclientMarker

func GenclientMarker() *markers.Definition

func GroupGoNameMarker

func GroupGoNameMarker() *markers.Definition

func GroupNameMarker

func GroupNameMarker() *markers.Definition

func IsClusterScoped

func IsClusterScoped(info *markers.TypeInfo) bool

IsClusterScoped verifies if the genclient marker for this type is namespaced or clusterscoped.

func IsNamespaced

func IsNamespaced(info *markers.TypeInfo) bool

IsNamespaced verifies if the genclient marker for this type is namespaced.

func NoStatusMarker

func NoStatusMarker() *markers.Definition

func NoVerbsMarker

func NoVerbsMarker() *markers.Definition

func NonNamespacedMarker

func NonNamespacedMarker() *markers.Definition

func OnlyVerbsMarker

func OnlyVerbsMarker() *markers.Definition

func ReadOnlyMarker

func ReadOnlyMarker() *markers.Definition

func SkipVerbsMarker

func SkipVerbsMarker() *markers.Definition

func SupportedVerbs

func SupportedVerbs(info *markers.TypeInfo) (sets.Set[string], error)

SupportedVerbs determines which verbs the type supports.

func SupportsVerbs

func SupportsVerbs(info *markers.TypeInfo, verbs ...string) (bool, error)

SupportsVerbs determines if the type supports all the verbs.

Types

type Extension

type Extension struct {
	Method      string
	Verb        string
	Subresource string
	InputPath   string
	InputType   string
	ResultPath  string
	ResultType  string
}

func ClientExtensions

func ClientExtensions(info *markers.TypeInfo) []Extension

type Group

type Group struct {
	types.Group
	GoName               string `marker:",+groupGoName"`
	Version              Version
	PackageAlias         string
	LowerCaseGroupGoName string
}

func (Group) GoPackageAlias added in v2.3.1

func (g Group) GoPackageAlias() string

func (Group) GroupGoName added in v2.3.1

func (g Group) GroupGoName() string

func (Group) GroupGoNameLower added in v2.3.1

func (g Group) GroupGoNameLower() string

func (Group) PackageName added in v2.3.1

func (g Group) PackageName() string

type Kind

type Kind struct {
	SupportedVerbs sets.Set[string]
	Extensions     []Extension
	// contains filtered or unexported fields
}

func NewKind

func NewKind(kind string, namespaced bool, supportedVerbs sets.Set[string], extensions []Extension) Kind

func (*Kind) IsNamespaced

func (k *Kind) IsNamespaced() bool

func (*Kind) Plural

func (k *Kind) Plural() string

func (*Kind) String

func (k *Kind) String() string

func (*Kind) SupportsListWatch

func (k *Kind) SupportsListWatch() bool

type Version added in v2.3.1

type Version string

func (Version) NonEmpty added in v2.3.1

func (v Version) NonEmpty() string

func (Version) PackageName added in v2.3.1

func (v Version) PackageName() string

func (Version) String added in v2.3.1

func (v Version) String() string

Jump to

Keyboard shortcuts

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