- CLI commands and API to create a template from an existing Keboola project and to apply a template to some other Keboola Connection project.
- The Jsonnet language is used to define JSON configurations in the templates.
The user documentation describes how to create and use the templates.
Templates functionality is implemented also in the CLI. See the commands:
local/template
- Commands to apply and manage a template in the local folder.template
- Commands to create a template in the project.template/repository
- Commands to manage a template repository folder.template/test
- Commands to create and run template tests.
- Entrypoint: cmd/templates-api/main.go
- The server utilizes code generated from the API design.
The API design can be found in api/templates/design.go and is implemented using Goa framework.
There is generate-templates-api
make command available to generate the code from the design specs. (The command is
also run before other commands to run the API locally, build API image, release the API, etc.)
The command generates:
- Code to internal/pkg/service/templates/api/gen.
- OpenAPI specifications to internal/pkg/service/templates/api/openapi.
Endpoints behavior is implemented in internal/pkg/service/templates/api/service/service.go.
Endpoints code performs validation of user inputs and typically runs one or more operations. See internal/pkg/service/common/dependencies/dependencies.go for a detailed explanation of dependency injection and the command design pattern implementation.
The Service uses an etcd database for shared locks mechanism to ensure atomicity of write operations through the API. etcd availability is not critical as the API can work without it but then it does not ensure the atomicity.