Documentation
¶
Index ¶
- Variables
- func IncludeTemplate(t *ttpl.Template, tplDir string, tplName string) (*ttpl.Template, error)
- type Generator
- func (g *Generator) GenerateAPIFile(target string) (*bytes.Buffer, error)
- func (g *Generator) GenerateCRDFile(crdName string) (*bytes.Buffer, error)
- func (g *Generator) GenerateCmdControllerMainFile() (*bytes.Buffer, error)
- func (g *Generator) GenerateConfigFile(target string) (*bytes.Buffer, error)
- func (g *Generator) GenerateReleaseFile(target string, releaseVersion string, imageRepository string, ...) (*bytes.Buffer, error)
- func (g *Generator) GenerateResourcePackageFile(crdName string, target string) (*bytes.Buffer, error)
- func (g *Generator) GenerateResourceRegistryFile() (*bytes.Buffer, error)
- func (g *Generator) GetCRDs() ([]*ackmodel.CRD, error)
- func (g *Generator) GetEnumDefs() ([]*ackmodel.EnumDef, error)
- func (g *Generator) GetTypeDefs() ([]*ackmodel.TypeDef, map[string]string, error)
- func (g *Generator) IsShapeUsedInCRDs(shapeName string) bool
- func (g *Generator) RemoveIgnoredOperations(crdOps *ackmodel.CRDOps)
Constants ¶
This section is empty.
Variables ¶
var ( // ConfigFiles is the set of configuration files that are generated. ConfigFiles = []string{ "config/controller/deployment.yaml", "config/controller/kustomization.yaml", "config/default/kustomization.yaml", "config/rbac/cluster-role-binding.yaml", "config/rbac/kustomization.yaml", } // ReleaseFiles is the set of template files that are generated for Helm // chart releases artifacts. ReleaseFiles = append(releaseTemplateFiles, releaseCopyFiles...) )
Functions ¶
Types ¶
type Generator ¶
Generator creates the ACK service controller Kubernetes API types (CRDs) and the service controller implementation/SDK linkage
func New ¶
func New( SDKAPI *ackmodel.SDKAPI, apiVersion string, configPath string, templateBasePath string, defaultConfig ackgenconfig.Config, ) (*Generator, error)
New returns a new Generator struct for a supplied API model. Optionally, pass a file path to a generator config file that can be used to instruct the code generator how to handle the API properly
func (*Generator) GenerateAPIFile ¶
GenerateAPIFile returns a byte buffer containing the output of an executed template for the Kubernetes API type definitions for a service API
func (*Generator) GenerateCRDFile ¶
GenerateCRDFile returns a byte buffer containing the output of an executed template for a particular top-level resource/CRD
func (*Generator) GenerateCmdControllerMainFile ¶
GenerateCmdControllerMainFile returns a byte buffer containing the output of an executed template for a service controller's main.go file
func (*Generator) GenerateConfigFile ¶
GenerateConfigFile returns a byte buffer containing the output of an executed template for the Kubernetes YAML manifest/configuration file
func (*Generator) GenerateReleaseFile ¶
func (g *Generator) GenerateReleaseFile( target string, releaseVersion string, imageRepository string, serviceAccountName string, ) (*bytes.Buffer, error)
GenerateReleaseFile returns a byte buffer containing the output of an executed template for a release artifact (e.g. Helm chart)
func (*Generator) GenerateResourcePackageFile ¶
func (g *Generator) GenerateResourcePackageFile( crdName string, target string, ) (*bytes.Buffer, error)
GenerateResourcePackageFile returns a byte buffer containing the output of an executed template containing a file in a specific CRD's resource package
func (*Generator) GenerateResourceRegistryFile ¶
GenerateResourceRegistryFile returns a byte buffer containing the output of an executed template containing the resource registry for the service controller
func (*Generator) GetCRDs ¶
GetCRDs returns a slice of `ackmodel.CRD` structs that describe the top-level resources discovered by the code generator for an AWS service API
func (*Generator) GetEnumDefs ¶
GetEnumDefs returns a slice of pointers to `ackmodel.EnumDef` structs which represent string fields whose value is constrained to one or more specific string values.
func (*Generator) GetTypeDefs ¶
GetTypeDefs returns a slice of `ackmodel.TypeDef` pointers and a map of package import information
func (*Generator) IsShapeUsedInCRDs ¶
IsShapeUsedInCRDs returns true if the supplied shape name is a member of amy CRD's payloads or those payloads sub-member shapes
func (*Generator) RemoveIgnoredOperations ¶
RemoveIgnoredOperations updates CRDOps argument by setting those operations to nil that are configured to be ignored in generator config for the AWS service