Documentation
¶
Index ¶
- Variables
- func APIs(g *generate.Generator, templateBasePaths []string) (*templateset.TemplateSet, error)
- func Controller(g *generate.Generator, templateBasePaths []string) (*templateset.TemplateSet, error)
- func CreateGenerationMetadata(apiVersion string, apisPath string, modificationReason UpdateReason, ...) error
- func Release(g *generate.Generator, templateBasePaths []string, releaseVersion string, ...) (*templateset.TemplateSet, error)
- func ResourceHookCode(templateBasePaths []string, r *ackmodel.CRD, hookID string, vars interface{}, ...) (string, error)
- type GenerationMetadata
- type UpdateReason
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = config.Config{ PrefixConfig: config.PrefixConfig{ SpecField: ".Spec", StatusField: ".Status", }, IncludeACKMetadata: true, SetManyOutputNotFoundErrReturn: "return nil, ackerr.NotFound", }
DefaultConfig is the default configuration for generating ACK code
Functions ¶
func APIs ¶
func APIs( g *generate.Generator, templateBasePaths []string, ) (*templateset.TemplateSet, error)
APIs returns a pointer to a TemplateSet containing all the templates for generating ACK service controller's apis/ contents
func Controller ¶
func Controller( g *generate.Generator, templateBasePaths []string, ) (*templateset.TemplateSet, error)
Controller returns a pointer to a TemplateSet containing all the templates for generating ACK service controller implementations
func CreateGenerationMetadata ¶ added in v0.2.3
func CreateGenerationMetadata( apiVersion string, apisPath string, modificationReason UpdateReason, awsSDKGo string, generatorFileName string, ) error
CreateGenerationMetadata gathers information about the generated code and save a yaml version in the API version directory
func Release ¶
func Release( g *generate.Generator, templateBasePaths []string, releaseVersion string, imageRepository string, serviceAccountName string, ) (*templateset.TemplateSet, error)
Release returns a pointer to a TemplateSet containing all the templates for generating an ACK service controller release (Helm artifacts, etc)
Types ¶
type GenerationMetadata ¶ added in v0.2.3
type GenerationMetadata struct { // The APIs version e.g v1alpha2 APIVersion string `json:"api_version"` // The checksum of all the combined files generated within the APIs directory APIDirectoryChecksum string `json:"api_directory_checksum"` // Last modification reason LastModification lastModificationInfo `json:"last_modification"` // AWS SDK Go version used generate the APIs AWSSDKGoVersion string `json:"aws_sdk_go_version"` // Informatiom about the ack-generate binary used to generate the APIs ACKGenerateInfo ackGenerateInfo `json:"ack_generate_info"` // Information about the generator config file used to generate the APIs GeneratorConfigInfo generatorConfigInfo `json:"generator_config_info"` }
GenerationMetadata represents the parameters used to generate/update the API version directory.
This type is public because soon it will be used by conversion generators to load APIs generation metadata. TODO(hilalymh) Add functions to load/edit metadata files.
type UpdateReason ¶ added in v0.2.3
type UpdateReason string
UpdateReason is the reason a package got modified.
const ( // UpdateReasonAPIGeneration should be used when an API package // is modified by the APIs generator (ack-generate apis). UpdateReasonAPIGeneration UpdateReason = "API generation" // UpdateReasonConversionFunctionsGeneration Should be used when // an API package is modified by conversion functions generator. // TODO(hilalymh) ack-generate conversion-functions UpdateReasonConversionFunctionsGeneration UpdateReason = "Conversion functions generation" )