{"modulePath":"github.com/110y/controller-tools","version":"v0.1.12","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package codegen\n\n## Types\n\n```go\ntype APIGroup struct {\n\t// Package is the name of the go package the api group is under - e.g. github.com/me/apiserver-helloworld/apis\n\tPackage string\n\t// Domain is the domain portion of the group - e.g. k8s.io\n\tDomain string\n\t// Group is the short name of the group - e.g. mushroomkingdom\n\tGroup      string\n\tGroupTitle string\n\t// Versions is the list of all versions for this group keyed by name\n\tVersions map[string]*APIVersion\n\n\tUnversionedResources map[string]*APIResource\n\n\t// Structs is a list of unversioned definitions that must be generated\n\tStructs []*Struct\n\tPkg     *types.Package\n\tPkgPath string\n}\n```\nAPIGroup contains information of an API group.\n\n```go\ntype APIResource struct {\n\t// Domain is the group domain - e.g. k8s.io\n\tDomain string\n\t// Group is the group name - e.g. mushroomkingdom\n\tGroup string\n\t// Version is the api version - e.g. v1beta1\n\tVersion string\n\t// Kind is the resource name - e.g. PeachesCastle\n\tKind string\n\t// Resource is the resource name - e.g. peachescastles\n\tResource string\n\t// REST is the rest.Storage implementation used to handle requests\n\t// This field is optional. The standard REST implementation will be used\n\t// by default.\n\tREST string\n\t// Subresources is a map of subresources keyed by name\n\tSubresources map[string]*APISubresource\n\t// Type is the Type object from code-gen\n\tType *types.Type\n\t// Strategy is name of the struct to use for the strategy\n\tStrategy string\n\t// Strategy is name of the struct to use for the strategy\n\tStatusStrategy string\n\t// NonNamespaced indicates that the resource kind is non namespaced\n\tNonNamespaced bool\n\n\tShortName string\n\n\tJSONSchemaProps    v1beta1.JSONSchemaProps\n\tCRD                v1beta1.CustomResourceDefinition\n\tValidation         string\n\tValidationComments string\n\t// DocAnnotation is a map of annotations by name for doc. e.g. warning, notes message\n\tDocAnnotation map[string]string\n\t// Categories is a list of categories the resource is part of.\n\tCategories []string\n}\n```\nAPIResource contains information of an API resource.\n\n```go\ntype APISubresource struct {\n\t// Domain is the group domain - e.g. k8s.io\n\tDomain string\n\t// Group is the group name - e.g. mushroomkingdom\n\tGroup string\n\t// Version is the api version - e.g. v1beta1\n\tVersion string\n\t// Kind is the resource name - e.g. PeachesCastle\n\tKind string\n\t// Resource is the resource name - e.g. peachescastles\n\tResource string\n\t// Request is the subresource request type - e.g. ScaleCastle\n\tRequest string\n\t// REST is the rest.Storage implementation used to handle requests\n\tREST string\n\t// Path is the subresource path - e.g. scale\n\tPath string\n\n\t// ImportPackage is the import statement that must appear for the Request\n\tImportPackage string\n\n\t// RequestType is the type of the request\n\tRequestType *types.Type\n\n\t// RESTType is the type of the request handler\n\tRESTType *types.Type\n}\n```\nAPISubresource contains information of an API subresource.\n\n```go\ntype APIVersion struct {\n\t// Domain is the group domain - e.g. k8s.io\n\tDomain string\n\t// Group is the group name - e.g. mushroomkingdom\n\tGroup string\n\t// Version is the api version - e.g. v1beta1\n\tVersion string\n\t// Resources is a list of resources appearing in the API version keyed by name\n\tResources map[string]*APIResource\n\t// Pkg is the Package object from code-gen\n\tPkg *types.Package\n}\n```\nAPIVersion contains information of an API version.\n\n```go\ntype APIs struct {\n\t// Domain is the domain portion of the group - e.g. k8s.io\n\tDomain string\n\n\t// Package is the name of the root API package - e.g. github.com/my-org/my-repo/pkg/apis\n\tPackage string\n\n\t// Pkg the Package for the root API package\n\tPkg *types.Package\n\n\t// Groups is the list of API groups found under the apis package\n\tGroups map[string]*APIGroup\n\n\tRules []rbacv1.PolicyRule\n\n\tInformers map[v1.GroupVersionKind]bool\n}\n```\nAPIs is the information of a collection of API\n\n```go\nfunc (apis *APIs) GetRules() []rbacv1.PolicyRule\n```\nGetRules get rules of the APIs\n\n```go\ntype Controller struct {\n\tTarget   schema.GroupVersionKind\n\tResource string\n\tPkg      *types.Package\n\tRepo     string\n}\n```\nController contains information of a controller.\n\n```go\ntype Field struct {\n\t// Name is the name of the field\n\tName string\n\t// For versioned Kubernetes types, this is the versioned package\n\tVersionedPackage string\n\t// For versioned Kubernetes types, this is the unversioned package\n\tUnversionedImport string\n\tUnversionedType   string\n}\n```\nField contains information of a field.\n\n```go\ntype Struct struct {\n\t// Name is the name of the type\n\tName string\n\t// genClient\n\tGenClient     bool\n\tGenDeepCopy   bool\n\tNonNamespaced bool\n\n\tGenUnversioned bool\n\t// Fields is the list of fields appearing in the struct\n\tFields []*Field\n}\n```\nStruct contains information of a struct.\n\n","path":"github.com/110y/controller-tools/pkg/internal/codegen","name":"codegen","synopsis":"","isRedistributable":true}
