https://github.com/temporalio/temporal-aws-sdk-generator
AWS SDK Bindings Generator
https://github.com/temporalio/temporal-aws-sdk-generator
Last synced: 9 months ago
JSON representation
AWS SDK Bindings Generator
- Host: GitHub
- URL: https://github.com/temporalio/temporal-aws-sdk-generator
- Owner: temporalio
- License: mit
- Created: 2020-10-10T19:50:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-04T19:44:30.000Z (over 5 years ago)
- Last Synced: 2025-07-05T04:39:37.332Z (12 months ago)
- Language: Go
- Size: 3.8 MB
- Stars: 5
- Watchers: 12
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Temporal AWS SDK Generator
| :warning: **This code is an experiment**: Absolutely no guarantee of backwards compatibility |
| --- |
This repository contains generator that generates code from template files passing
to them a list of AWS Service definitions parsed from AWS Go SDK.
## Installation
```
go get go.temporal.io/aws-sdk-generator
```
## Usage
```
aws-sdk-generator --template-dir --output-dir
```
## Options
* `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.
## Template File Format
Templates must be in [Go template format](https://golang.org/pkg/text/template/).
The data structure passed to the templates is [AWSSDKDefinition](internal/definitions.go).
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.
### Template Functions
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 case
* `ToLower(s string) string` maps all string letters to lower case
* `HasPrefix(s, previx string) bool` returns true if string has prefix
* `CapitalizeFirstLetter(s string) string` capitalizes the first letter of the string
* `IsNil(value) boolean` returns if the value is nil
* `IsDuplicate(collection, value string) bool` used to deduplicate values