parse

package
v0.1.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultNameSystem

func DefaultNameSystem() string

DefaultNameSystem returns public by default.

func GetGroup

func GetGroup(t *types.Type) string

GetGroup returns group of t.

func GetGroupPackage

func GetGroupPackage(t *types.Type) string

GetGroupPackage returns group package of t.

func GetKind

func GetKind(t *types.Type, group string) string

GetKind returns kind of t.

func GetVersion

func GetVersion(t *types.Type, group string) string

GetVersion returns version of t.

func HasDocAnnotation

func HasDocAnnotation(t *types.Type) bool

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

func HasSubresource

func HasSubresource(t *types.Type) bool

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

func IsAPIResource

func IsAPIResource(t *types.Type) 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(t *types.Type) bool

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

func IsApisDir

func IsApisDir(dir string) bool

IsApisDir returns true if a directory path is a Kubernetes api directory

func IsController

func IsController(t *types.Type) bool

IsController returns true if t has a +controller or +kubebuilder:controller tag

func IsInformer

func IsInformer(t *types.Type) bool

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

func IsNonNamespaced

func IsNonNamespaced(t *types.Type) bool

IsNonNamespaced returns true if t has a +nonNamespaced comment tag

func IsRBAC

func IsRBAC(t *types.Type) bool

IsRBAC returns true if t has a +rbac or +kubebuilder:rbac tag

func IsUnversioned

func IsUnversioned(t *types.Type, group string) bool

IsUnversioned returns true if t is in given group, and not in versioned path.

func IsVersioned

func IsVersioned(t *types.Type, group string) bool

IsVersioned returns true if t is in given group, and in versioned path.

func NameSystems

func NameSystems() namer.NameSystems

NameSystems returns the name system used by the generators in this package. e.g. black-magic

func NewContext

func NewContext(p *parser.Builder) (*generator.Context, error)

NewContext returns a new Context from the builder

Types

type APIs

type APIs struct {
	Domain          string
	VersionedPkgs   sets.String
	UnversionedPkgs sets.String
	APIsPkg         string
	APIsPkgRaw      *types.Package
	GroupNames      sets.String

	APIs        *codegen.APIs
	Controllers []codegen.Controller

	ByGroupKindVersion    map[string]map[string]map[string]*codegen.APIResource
	ByGroupVersionKind    map[string]map[string]map[string]*codegen.APIResource
	SubByGroupVersionKind map[string]map[string]map[string]*types.Type
	Groups                map[string]types.Package
	Rules                 []rbacv1.PolicyRule
	Informers             map[v1.GroupVersionKind]bool
	// contains filtered or unexported fields
}

APIs is the information of a collection of API

func NewAPIs

func NewAPIs(context *generator.Context, arguments *args.GeneratorArgs, domain, apisPkg string) *APIs

NewAPIs returns a new APIs instance with given context.

type Comments

type Comments []string

Comments is a structure for using comment tags on go structs and fields

type Options

type Options struct {
	SkipMapValidation bool

	// SkipRBACValidation flag determines whether to check RBAC annotations
	// for the controller or not at parse stage.
	SkipRBACValidation bool
}

Options contains the parser options

Jump to

Keyboard shortcuts

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