/
test-config.yaml
163 lines (144 loc) · 7.92 KB
/
test-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# test-config.yaml file.
# --- Includes ------------------------------------------------------------
# This optional section allows to include other configuration files to
# incorporate their property values into properties of this file.
# -------------------------------------------------------------------------
includes:
# --- Common properties ---------------------------------------------------
# path (required): Specifies the path to the external configuration file.
# as (required): Specifies how the file will be referenced in value
# substitutions (e.g., ${ti.myIncludedString}).
# -------------------------------------------------------------------------
- path: test-include.yaml
as: ti
# --- Languages -----------------------------------------------------------
# This optional section defines for which languages to generate files. It is
# optional because configuration files might just define properties, that
# are imported into other configuration files.
# -------------------------------------------------------------------------
languages:
# --- Common properties (valid for all languages) -------------------------
# type (required): Specifies the output language (java | javascript | typescript | python | c | go).
#
# file_naming (optional): Specifies the file naming convention (snake | screaming_snake | camel | pascal | kebap).
# Defaults to the file-name without the extension.
# property_naming (optional): Specifies the property naming convention (snake | screaming_snake | camel | pascal | kebap).
# type_naming (optional): Specifies the naming convention for the generated type (snake | screaming_snake | camel | pascal | kebap).
# The default value is language specific.
# indent (optional): Specifies the amount of spaces before each
# constant. Defaults to 4.
# transform (optional): Specifies a Python script to transform the
# currently processed property. To reflect
# changes to the outside of the script, the
# value variable must be modified. The script
# has access to the following variables:
#
# name: Property name.
# value: Property value.
# type: Property type.
# properties: List of all properties (must not be modified).
# -------------------------------------------------------------------------
# --- Java specific properties --------------------------------------------
# package (required): Specifies the Java package name.
# -------------------------------------------------------------------------
- type: java
file_naming: pascal
type_naming: pascal
package: my.test.package
# --- JavaScript/TypeScript specific properties ---------------------------
# export (optional): Specifies how to export the class (esm | common_js | none).
# Defaults to esm.
# -------------------------------------------------------------------------
- type: javascript
file_naming: screaming_snake
indent: 4
export: common_js
- type: typescript
indent: 4
export: esm
# --- File distribution ---------------------------------------------------
# Each language section can have a distributions section which specifies,
# to which locations to distribute the generated file to.
#
# IMPORTANT: The configs won't get distributed to the specified locations
# by default. To distribute them via commandline, use the
# -d/--distribute flag. To distribute them from within a
# Python script, use the Orchestrator's distribute() method.
#
# type (required): Specifies the distribution type (git).
# as (optional): Specifies an alias for the distribution. This alias might
# be necessary for specific distribution types (e.g. for git).
#
# The rest of the properties are distribution specific and described beside
# the property.
# -------------------------------------------------------------------------
distributions:
- type: git # Distribute file to a Git server. Minimum
# Git requirement is v2.29.0.
as: git-monstermichl # An alias is required if the password shall
# be provided via commandline in the form of
# -s/--secret <alias>=[<username>:]<password>.
url: https://github.com/monstermichl/confluent-test.git # URL of the Git repository.
path: generated # Target path within the Git repository.
user: monstermichl # Git user (optional).
password: password123 # Git password (optional).
# -------------------------------------------------------------------------
- type: python
file_naming: snake
property_naming: screaming_snake
# -------------------------------------------------------------------------
- type: c
file_naming: snake
property_naming: pascal
# --- Go specific properties ----------------------------------------------
# package (required): Specifies the Go package name.
# -------------------------------------------------------------------------
- type: go
file_naming: snake
package: myconfig
transform: | # If the property 'myString' is being processed, replace the value by 'Hello Mars'.
if name == 'myString':
value = 'Hello Mars'
# --- Properties ----------------------------------------------------------
# This mandatory section defines the actual properties.
# -------------------------------------------------------------------------
properties:
# -------------------------------------------------------------------------
# type (required): Specifies the constant data type (bool | int | float | double | string | regex).
# name (required): Specifies the constant's name.
# value (required): Specifies the constant's value.
#
# comment (optional): Adds an extra comment to the constant.
# hidden (optional): Constants serves as helper and will not be written to
# the final result.
# -------------------------------------------------------------------------
- type: bool
name: myBoolean
value: true
- type: int
name: myInteger
value: 142
- type: float
name: myFloat
value: 322f # Float with float specifier. However, an additional specifier (f) is not required and will be trimmed.
- type: float
name: myCombinedFloat
value: ${myInteger} * ${myFloat} # Number and boolean combinations get evaluated during the dump process.
- type: double
name: myDouble
value: 233.9
- type: string
name: myString
value: Hello World
hidden: true # If a property should act as a helper but should not be written to the generated file, it must be marked as 'hidden'.
- type: regex
name: myRegex
value: Test Reg(E|e)x
comment: Just another RegEx. # Variables can be described using the comment property.
- type: string
name: mySubstitutedString
value: Sometimes I just want to scream ${myString}! # To use the value of another property, simply use its name with ${}. E.g., ${myString}.
- type: string
name: myCombinedString
value: I am telling you that ${ti.myIncludedString}. # To use the value of another property from an included file, simply use the file's
# alias and the corresponding property name. E.g., ${ti.myIncludedString}.