This repository contains generator that generates code from template files passing to them a list of AWS Service definitions parsed from AWS Go SDK.
go get go.temporal.io/aws-sdk-generator
aws-sdk-generator --template-dir <dir> --output-dir <dir>
template-dir
directory with template files. Only files with.tmpl
extension are processed. Required.output-dir
base directory for generated files. Required.service
name of AWS service to generate code for. Optional. Default is all the services.
Templates must be in Go template format.
The data structure passed to the templates is AWSSDKDefinition.
A template file must call SetFileName
function at the beginning to specify the output file name.
It is allowed to call SetFileName
multiple times to generate multiple files from the same template.
The following functions are available inside templates:
SetFileName(fileName string)
sets output file name. It can contain directories. So "foo/bar/baz.go" is a valid name.ToUpper(s string) string
maps all string letters to upper caseToLower(s string) string
maps all string letters to lower caseHasPrefix(s, previx string) bool
returns true if string has prefixCapitalizeFirstLetter(s string) string
capitalizes the first letter of the stringIsNil(value) boolean
returns if the value is nilIsDuplicate(collection, value string) bool
used to deduplicate values