ack

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)

func ResourceHookCode added in v0.0.7

func ResourceHookCode(
	templateBasePaths []string,
	r *ackmodel.CRD,
	hookID string,
	vars interface{},
	funcMap ttpl.FuncMap,
) (string, error)

ResourceHookCode returns a string with custom callback code for a resource and hook identifier

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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳