Added processor template

This commit is contained in:
Lorenzo Venerandi
2025-01-29 14:46:28 +01:00
parent c9505daa67
commit a5286ec32a
148 changed files with 8863 additions and 3 deletions

View File

@@ -41,7 +41,21 @@ def __generate_producer(task, output_dir):
def __generate_processor(task, output_dir):
pass
# Copy the template folder to the output folder
__copytree("src/code_generator/templates/processor_nats", f"{output_dir}/{task['component_name']}")
# Replace each file of the output dir with the template
for filename in os.listdir(f"{output_dir}/{task['component_name']}"):
# Skip the following files
if filename in ['Dockerfile', 'go.mod', 'go.sum', 'tools.go', 'bindings.wadge.go']:
continue
# Skip if it's a directory
if os.path.isdir(f"{output_dir}/{task['component_name']}/{filename}"):
continue
__replace_file_with_template(filename, f"{output_dir}/{task['component_name']}", task)
def __generate_dbsync(task, output_dir):
pass