Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 2.55 KB

overview.md

File metadata and controls

43 lines (28 loc) · 2.55 KB

Templates Architecture Overview

  • 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.

CLI

Templates functionality is implemented also in the CLI. See the commands:

API Entrypoint

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:

Endpoints Implementation

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.

Resources

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.