Compare commits
421
Commits
6
...
e10448f1e3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e10448f1e3
|
||
|
|
f880e9f10c
|
||
|
|
b179541532
|
||
|
|
5098d27ae9
|
||
|
|
d8fb9ea2fd
|
||
|
|
5dbe7816cd
|
||
|
|
1657a10dec
|
||
|
|
7d22a32cb4
|
||
|
|
ed4941b403
|
||
|
|
c227c291c9
|
||
|
|
389922f22d
|
||
|
|
670290b60b
|
||
|
|
3345571bd8
|
||
|
|
d51e78a442
|
||
|
|
bd70ac4542
|
||
|
|
62f04f7d1c
|
||
|
|
8812bf2410
|
||
|
|
323c0b0ff9
|
||
|
|
e9c28efd47
|
||
|
|
e5f9eff54f
|
||
|
|
382a799038
|
||
|
|
f4f5c8b63a
|
||
|
|
c0dd30f08c
|
||
|
|
3eb914d640
|
||
|
|
ba7e02fa30
|
||
|
|
56e09dafb9
|
||
|
|
145ebd8346
|
||
|
|
13e9c88a8e
|
||
|
|
7d571ad46b
|
||
|
|
491d31e2e9
|
||
|
|
3f35d35016
|
||
|
|
aeeb7b3448
|
||
|
|
f9b471b59e
|
||
|
|
8f3faee573
|
||
|
|
6ff2ba702b
|
||
|
|
4ecefe8534
|
||
|
|
ab9295ee23
|
||
|
|
29d4e21656
|
||
|
|
490f24422b
|
||
|
|
67eb761a99
|
||
|
|
22978e5bbc
|
||
|
|
0dbd7311ab
|
||
|
|
cbda10e2a1
|
||
|
|
ee3c443216
|
||
|
|
bbe01cd231
|
||
|
|
10c68cfb37
|
||
|
|
c21076a049
|
||
|
|
fc774d5af3
|
||
|
|
dd0b60b2ba
|
||
|
|
6add09c7df
|
||
|
|
d064b51e1b
|
||
|
|
744f567b7c
|
||
|
|
7dbce9e870
|
||
|
|
72ed2495f6
|
||
|
|
05e0c63931
|
||
|
|
fcbcec85c5 | ||
|
|
b47b2f804f
|
||
|
|
5f4fc74cd9
|
||
|
|
300b8fd01a | ||
|
|
8b951dfb3f | ||
|
|
517e8a0819
|
||
|
|
3af4b521d3
|
||
|
|
dca2829323 | ||
|
|
57a84c256a | ||
|
|
b78534e1b0 | ||
|
|
9b85b54da5 | ||
|
|
4b5a86282d | ||
|
|
c9cb03ea95
|
||
|
|
c7f57548f3 | ||
|
|
8d00307170 | ||
|
|
5e92b9a48f | ||
|
|
01e1323555 | ||
|
|
f8465721cd | ||
|
|
4cea7cb32f | ||
|
|
72303b1105
|
||
|
|
451b7fbe05 | ||
|
|
2a3322612d
|
||
|
|
4b4d66ae78 | ||
|
|
c935950eb0 | ||
|
|
573b921197 | ||
|
|
274c13e358
|
||
|
|
ff0421da2f | ||
|
|
915baa6efa | ||
|
|
bac004d74e | ||
|
|
b7b7f6a0ae | ||
|
|
11efdebacf | ||
|
|
0f2d6f58d6 | ||
|
|
df8bd1133b | ||
|
|
22fb3edd78 | ||
|
|
ded610f114 | ||
|
|
a4c8dade23 | ||
|
|
b6fc069042 | ||
|
|
60cc343adf | ||
|
|
010f2046ad | ||
|
|
c18cb7f135 | ||
|
|
2e7c3e8a5b | ||
|
|
ac9be793bd | ||
|
|
c18fc4ec93 | ||
|
|
981bae4786 | ||
|
|
754d0ca58c | ||
|
|
fa26ed6012 | ||
|
|
cc4a2b4ab4 | ||
|
|
e97e209746 | ||
|
|
8f30d8933f | ||
|
|
f78037c0f1 | ||
|
|
3c02e13997 | ||
|
|
d8f3a6ed06 | ||
|
|
2ee4c06055 | ||
|
|
76418f65e1 | ||
|
|
a57e0909b9 | ||
|
|
a81db03ba3 | ||
|
|
7ae4750307 | ||
|
|
f623c0a7cd | ||
|
|
3fc612488d | ||
|
|
f220e70743 | ||
|
|
d3f7d1a6c9 | ||
|
|
82159bed53 | ||
|
|
479e28c46c | ||
|
|
e75f15142e | ||
|
|
cec893032d | ||
|
|
2278e4ad06 | ||
|
|
5a98688d60 | ||
|
|
63c7beb8b9 | ||
|
|
2a4cfdb2f8 | ||
|
|
a580841973 | ||
|
|
6b23dea477 | ||
|
|
e0add846bb | ||
|
|
1d12de7045 | ||
|
|
b43aeec0cf | ||
|
|
405bb20601 | ||
|
|
ac572f1ea3 | ||
|
|
7fea1ca78f | ||
|
|
64fce5bd01 | ||
|
|
5ba26c4cbf | ||
|
|
b82a32ae3e | ||
|
|
0af9b81b38 | ||
|
|
955e11846b | ||
|
|
d1577cd08d | ||
|
|
6767c3b2d1 | ||
|
|
2b2195727b | ||
|
|
3ca2237953 | ||
|
|
8d6ea4dbf9 | ||
|
|
8b71608792 | ||
|
|
f1084b59a7 | ||
|
|
c8dc998ecd | ||
|
|
3df3d26708 | ||
|
|
922e762aa2 | ||
|
|
c3beb3e103 | ||
|
|
457ea26cf8 | ||
|
|
c2d2b66f2f | ||
|
|
289a0d8671 | ||
|
|
ce3053c0ba | ||
|
|
6608456c68 | ||
|
|
1cbe5a1614 | ||
|
|
9584bfed8b | ||
|
|
0839ff6359 | ||
|
|
4739193709 | ||
|
|
0ade57536e | ||
|
|
d17108f4b9 | ||
|
|
3c42ca3042 | ||
|
|
073433f308 | ||
|
|
8bac1fadd6 | ||
|
|
a478081727 | ||
|
|
b1978e796f | ||
|
|
c51ec74d30 | ||
|
|
b8f0d1fa60 | ||
|
|
96886c74bc | ||
|
|
8d3cc34395 | ||
|
|
85519bc2e4 | ||
|
|
ed02306738 | ||
|
|
31a59500fa | ||
|
|
d01b4a0b99 | ||
|
|
d9919404b5 | ||
|
|
b180e04045 | ||
|
|
7f28525ec2 | ||
|
|
677bd86133 | ||
|
|
b612562d34 | ||
|
|
e9d3574599 | ||
|
|
9dd62cefa9 | ||
|
|
0797c678c8 | ||
|
|
5e4d6f44da | ||
|
|
885765ac71 | ||
|
|
03ed6d5bc1 | ||
|
|
4e1e124d0d | ||
|
|
19fbf50f6f | ||
|
|
21b5e048ed | ||
|
|
c012b4943d | ||
|
|
7c23dba493 | ||
|
|
ba566bcc33 | ||
|
|
a386c5bef8 | ||
|
|
1ca5d3ea07 | ||
|
|
fd8b7e56da | ||
|
|
55877de2aa | ||
|
|
d1a29c1cbb | ||
|
|
e6f7dd2be8 | ||
|
|
49590b897e | ||
|
|
a9019e4c67 | ||
|
|
cc6a53b258 | ||
|
|
e0db6f6a78 | ||
|
|
0fcfb30d5c | ||
|
|
c2909082a2 | ||
|
|
92c52401b3 | ||
|
|
7ca7266ea4 | ||
|
|
adf11ab1c3 | ||
|
|
db91661556 | ||
|
|
9d7d044384 | ||
|
|
95099c5fbd | ||
|
|
782861bd93 | ||
|
|
dcde424b77 | ||
|
|
b7c6c6e157 | ||
|
|
2d031dae03 | ||
|
|
729f2d7240 | ||
|
|
454309278e | ||
|
|
7be211f8b7 | ||
|
|
bdeadd274b | ||
|
|
e306cdb2c8 | ||
|
|
406add3d51 | ||
|
|
e74b9a4c9d | ||
|
|
449a96b302 | ||
|
|
703eaa0e9d | ||
|
|
b4dc1d2be7 | ||
|
|
cf0f5839ee | ||
|
|
29376a7782 | ||
|
|
08e858726c | ||
|
|
68a1b8f3e0 | ||
|
|
9697d53a15 | ||
|
|
d38923c4ad | ||
|
|
03c7d590d0 | ||
|
|
8a90f63b09 | ||
|
|
491cdb8d71 | ||
|
|
68572b194e | ||
|
|
1eb634fe11 | ||
|
|
dbccbf68f4 | ||
|
|
96204d809e | ||
|
|
7ac8edb5cf | ||
|
|
05561db5b8 | ||
|
|
149bf1849d | ||
|
|
b952ac4d72 | ||
|
|
5c075bce8b | ||
|
|
b77945a9e4 | ||
|
|
aefe5493b0 | ||
|
|
75b8b281b8 | ||
|
|
44f139aa01 | ||
|
|
a1b0a1918d | ||
|
|
467d8df6db | ||
|
|
fea0b1dc05 | ||
|
|
7122fe7dbe | ||
|
|
ff36b4871f | ||
|
|
03f63e3777 | ||
|
|
ecd02a1af7 | ||
|
|
b0d42939a6 | ||
|
|
502345782f | ||
|
|
9a7c1d64fd | ||
|
|
4b79b29ee6 | ||
|
|
edc846ab05 | ||
|
|
0d27916188 | ||
|
|
0894446085 | ||
|
|
4187a8e820 | ||
|
|
e1ec193a4f | ||
|
|
ad9a8a4fe0 | ||
|
|
6a14232889 | ||
|
|
b6296b8d97 | ||
|
|
bc4d16e6f8 | ||
|
|
e3a45a61ac | ||
|
|
7f58dd694b | ||
|
|
68f46a45b5 | ||
|
|
016f746c7c | ||
|
|
b77bb3ad9d | ||
|
|
b4ebae283b | ||
|
|
3bb322ede5 | ||
|
|
b92a6f7b2b | ||
|
|
d3a213ce33 | ||
|
|
8fc6c7176e | ||
|
|
929ac81515 | ||
|
|
75d2ac3c5f | ||
|
|
3e2b011d28 | ||
|
|
1c06689800 | ||
|
|
a35f8cfd3a | ||
|
|
27d1d69360 | ||
|
|
8072d0b194 | ||
|
|
a30600943d | ||
|
|
123cf8ad48 | ||
|
|
22b1e0097e | ||
|
|
7e507d4cc4 | ||
|
|
f7dfd6d0c3 | ||
|
|
cbff3074d1 | ||
|
|
9755e437c2 | ||
|
|
fe0f45ea92 | ||
|
|
b07c5a96f2 | ||
|
|
dba765cb01 | ||
|
|
8ca015ecf8 | ||
|
|
6ab3946c31 | ||
|
|
603a814ad4 | ||
|
|
7736ccdc0c | ||
|
|
d1b07f39fd | ||
|
|
8d4e7a16d1 | ||
|
|
4fca5afdfa | ||
|
|
ea8028dfd5 | ||
|
|
bc2b6fadd9 | ||
|
|
ee19efa0e6 | ||
|
|
f3de80af78 | ||
|
|
6a42fe37d0 | ||
|
|
84259d37d4 | ||
|
|
140fda11cc | ||
|
|
e92820e12f | ||
|
|
4773a5f18c | ||
|
|
06dedc0797 | ||
|
|
785544ca16 | ||
|
|
4f191dcb52 | ||
|
|
1ced0e3175 | ||
|
|
5e1252545b | ||
|
|
2d0b7ce79e | ||
|
|
1962499d18 | ||
|
|
1e67672ef0 | ||
|
|
e401d0ec72 | ||
|
|
42443af734 | ||
|
|
c07319b250 | ||
|
|
388d8a2dc6 | ||
|
|
ee8ba99cc7 | ||
|
|
47a05facb3 | ||
|
|
f755f4f9fb | ||
|
|
784d7c656f | ||
|
|
e345c36dd0 | ||
|
|
c617c40e9d | ||
|
|
a9e3360ee2 | ||
|
|
13776d1ecb | ||
|
|
f69e7779e4 | ||
|
|
8ec5de4877 | ||
|
|
7c3813b94d | ||
|
|
b4232e51e0 | ||
|
|
cd51e78282 | ||
|
|
f833ae222e | ||
|
|
4cd437b6af | ||
|
|
9be3e789a5 | ||
|
|
119102aef8 | ||
|
|
cf9cd298b6 | ||
|
|
05e471878f | ||
|
|
6f81566cb8 | ||
|
|
a596188c00 | ||
|
|
75eb925267 | ||
|
|
19697692bc | ||
|
|
4acf3e39ce | ||
|
|
3af76a53e3 | ||
|
|
d58453faf9 | ||
|
|
bd6ec6215d | ||
|
|
96d863bfc8 | ||
|
|
ba7cedd187 | ||
|
|
78205ee8c7 | ||
|
|
041c0ed6bb | ||
|
|
6121b1e3bf | ||
|
|
5afd26ea22 | ||
|
|
4585a83838 | ||
|
|
c07c6aeeab | ||
|
|
9a115e75b1 | ||
|
|
f4a34dd36b | ||
|
|
42d6c40d0c | ||
|
|
de432c4481 | ||
|
|
73915da203 | ||
|
|
15cd5f6579 | ||
|
|
95b882aced | ||
|
|
376087fe66 | ||
|
|
68e34a9054 | ||
|
|
465efe0300 | ||
|
|
782b41756d | ||
|
|
15f16415c0 | ||
|
|
82b5f9e86e | ||
|
|
b5e79e51ef | ||
|
|
8141269dd9 | ||
|
|
56b72275ac | ||
|
|
df94b1b750 | ||
|
|
15ff412d75 | ||
|
|
36396af50a | ||
|
|
4d45e0f80d | ||
|
|
6435c8a88e | ||
|
|
3fb8be22b7 | ||
|
|
7d5b5750ad | ||
|
|
64bd1ffc3a | ||
|
|
3ca38abe93 | ||
|
|
2c7b0254ec | ||
|
|
f726a6e699 | ||
|
|
a7d4001ad9 | ||
|
|
4617f2c5bd | ||
|
|
557cc26f28 | ||
|
|
8a30265fc6 | ||
|
|
9f3758de39 | ||
|
|
cfa65e83ca | ||
|
|
1d73e4ed9c | ||
|
|
1d1fa50327 | ||
|
|
d08bdfd961 | ||
|
|
aae4f507ea | ||
|
|
cb7325bbf9 | ||
|
|
e29c17a29a | ||
|
|
63f9523766 | ||
|
|
d291cf0d1b | ||
|
|
d493e74bf3 | ||
|
|
83c4bd62cb | ||
|
|
8f250f747a | ||
|
|
0c4e5a182c | ||
|
|
48d7cad9f3 | ||
|
|
185e66fb5b | ||
|
|
cbc421cd83 | ||
|
|
b9d4cc3619 | ||
|
|
1d62e7f14c | ||
|
|
4efb62921b | ||
|
|
c2d714116e | ||
|
|
cff70110fd | ||
|
|
814b564752 | ||
|
|
915ff92418 | ||
|
|
94e5e51f8d | ||
|
|
57afbd4b6c | ||
|
|
6539fd7855 | ||
|
|
9d62225478 | ||
|
|
b1747f6374 | ||
|
|
ae466b4d7e | ||
|
|
e1f03788db | ||
|
|
278c56386b | ||
|
|
66134c0e1e | ||
|
|
61c7dbff0b | ||
|
|
43bb728d0d | ||
|
|
d450ceac74 | ||
|
|
b0427a6d81 |
No files matched your search
@@ -0,0 +1,46 @@
|
|||||||
|
root = "."
|
||||||
|
testdata_dir = "testdata"
|
||||||
|
tmp_dir = "tmp"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
args_bin = []
|
||||||
|
bin = "tmp\\main.exe"
|
||||||
|
cmd = "go build -o ./tmp/main.exe ."
|
||||||
|
delay = 1000
|
||||||
|
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
|
||||||
|
exclude_file = []
|
||||||
|
exclude_regex = ["_test.go"]
|
||||||
|
exclude_unchanged = false
|
||||||
|
follow_symlink = false
|
||||||
|
full_bin = ""
|
||||||
|
include_dir = []
|
||||||
|
include_ext = ["go", "tpl", "tmpl", "html"]
|
||||||
|
include_file = []
|
||||||
|
kill_delay = "0s"
|
||||||
|
log = "build-errors.log"
|
||||||
|
poll = false
|
||||||
|
poll_interval = 0
|
||||||
|
post_cmd = []
|
||||||
|
pre_cmd = []
|
||||||
|
rerun = false
|
||||||
|
rerun_delay = 500
|
||||||
|
send_interrupt = false
|
||||||
|
stop_on_error = false
|
||||||
|
|
||||||
|
[color]
|
||||||
|
app = ""
|
||||||
|
build = "yellow"
|
||||||
|
main = "magenta"
|
||||||
|
runner = "green"
|
||||||
|
watcher = "cyan"
|
||||||
|
|
||||||
|
[log]
|
||||||
|
main_only = false
|
||||||
|
time = false
|
||||||
|
|
||||||
|
[misc]
|
||||||
|
clean_on_exit = false
|
||||||
|
|
||||||
|
[screen]
|
||||||
|
clear_on_rebuild = false
|
||||||
|
keep_scroll = true
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
tmp
|
||||||
|
docker-compose.yaml
|
||||||
|
.air.toml
|
||||||
+1
-129
@@ -1,129 +1 @@
|
|||||||
# ---> VisualStudioCode
|
tmp
|
||||||
.vscode/*
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
*.code-workspace
|
|
||||||
|
|
||||||
# Local History for Visual Studio Code
|
|
||||||
.history/
|
|
||||||
|
|
||||||
# ---> Node
|
|
||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
*.lcov
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# Snowpack dependency directory (https://snowpack.dev/)
|
|
||||||
web_modules/
|
|
||||||
|
|
||||||
# TypeScript cache
|
|
||||||
*.tsbuildinfo
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Microbundle cache
|
|
||||||
.rpt2_cache/
|
|
||||||
.rts2_cache_cjs/
|
|
||||||
.rts2_cache_es/
|
|
||||||
.rts2_cache_umd/
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|
||||||
# dotenv environment variables file
|
|
||||||
.env
|
|
||||||
.env.test
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
|
||||||
.cache
|
|
||||||
.parcel-cache
|
|
||||||
|
|
||||||
# Next.js build output
|
|
||||||
.next
|
|
||||||
out
|
|
||||||
|
|
||||||
# Nuxt.js build / generate output
|
|
||||||
.nuxt
|
|
||||||
dist
|
|
||||||
|
|
||||||
# Gatsby files
|
|
||||||
.cache/
|
|
||||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
||||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
||||||
# public
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
|
|
||||||
# TernJS port file
|
|
||||||
.tern-port
|
|
||||||
|
|
||||||
# Stores VSCode versions used for testing VSCode extensions
|
|
||||||
.vscode-test
|
|
||||||
|
|
||||||
# yarn v2
|
|
||||||
.yarn/cache
|
|
||||||
.yarn/unplugged
|
|
||||||
.yarn/build-state.yml
|
|
||||||
.yarn/install-state.gz
|
|
||||||
.pnp.*
|
|
||||||
|
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
FROM golang:1.23-alpine AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -o server
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=builder /app/server /server
|
||||||
|
ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/ca-certificates.crt
|
||||||
|
ENTRYPOINT [ "/server" ]
|
||||||
@@ -1,362 +0,0 @@
|
|||||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Creative
|
|
||||||
Commons Corporation ("Creative Commons") is not a law firm and does not provide
|
|
||||||
legal services or legal advice. Distribution of Creative Commons public licenses
|
|
||||||
does not create a lawyer-client or other relationship. Creative Commons makes
|
|
||||||
its licenses and related information available on an "as-is" basis. Creative
|
|
||||||
Commons gives no warranties regarding its licenses, any material licensed
|
|
||||||
under their terms and conditions, or any related information. Creative Commons
|
|
||||||
disclaims all liability for damages resulting from their use to the fullest
|
|
||||||
extent possible.
|
|
||||||
|
|
||||||
Using Creative Commons Public Licenses
|
|
||||||
|
|
||||||
Creative Commons public licenses provide a standard set of terms and conditions
|
|
||||||
that creators and other rights holders may use to share original works of
|
|
||||||
authorship and other material subject to copyright and certain other rights
|
|
||||||
specified in the public license below. The following considerations are for
|
|
||||||
informational purposes only, are not exhaustive, and do not form part of our
|
|
||||||
licenses.
|
|
||||||
|
|
||||||
Considerations for licensors: Our public licenses are intended for use by
|
|
||||||
those authorized to give the public permission to use material in ways otherwise
|
|
||||||
restricted by copyright and certain other rights. Our licenses are irrevocable.
|
|
||||||
Licensors should read and understand the terms and conditions of the license
|
|
||||||
they choose before applying it. Licensors should also secure all rights necessary
|
|
||||||
before applying our licenses so that the public can reuse the material as
|
|
||||||
expected. Licensors should clearly mark any material not subject to the license.
|
|
||||||
This includes other CC-licensed material, or material used under an exception
|
|
||||||
or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors
|
|
||||||
|
|
||||||
Considerations for the public: By using one of our public licenses, a licensor
|
|
||||||
grants the public permission to use the licensed material under specified
|
|
||||||
terms and conditions. If the licensor's permission is not necessary for any
|
|
||||||
reason–for example, because of any applicable exception or limitation to copyright–then
|
|
||||||
that use is not regulated by the license. Our licenses grant only permissions
|
|
||||||
under copyright and certain other rights that a licensor has authority to
|
|
||||||
grant. Use of the licensed material may still be restricted for other reasons,
|
|
||||||
including because others have copyright or other rights in the material. A
|
|
||||||
licensor may make special requests, such as asking that all changes be marked
|
|
||||||
or described. Although not required by our licenses, you are encouraged to
|
|
||||||
respect those requests where reasonable. More considerations for the public
|
|
||||||
: wiki.creativecommons.org/Considerations_for_licensees
|
|
||||||
|
|
||||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public
|
|
||||||
License
|
|
||||||
|
|
||||||
By exercising the Licensed Rights (defined below), You accept and agree to
|
|
||||||
be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike
|
|
||||||
4.0 International Public License ("Public License"). To the extent this Public
|
|
||||||
License may be interpreted as a contract, You are granted the Licensed Rights
|
|
||||||
in consideration of Your acceptance of these terms and conditions, and the
|
|
||||||
Licensor grants You such rights in consideration of benefits the Licensor
|
|
||||||
receives from making the Licensed Material available under these terms and
|
|
||||||
conditions.
|
|
||||||
|
|
||||||
Section 1 – Definitions.
|
|
||||||
|
|
||||||
a. Adapted Material means material subject to Copyright and Similar Rights
|
|
||||||
that is derived from or based upon the Licensed Material and in which the
|
|
||||||
Licensed Material is translated, altered, arranged, transformed, or otherwise
|
|
||||||
modified in a manner requiring permission under the Copyright and Similar
|
|
||||||
Rights held by the Licensor. For purposes of this Public License, where the
|
|
||||||
Licensed Material is a musical work, performance, or sound recording, Adapted
|
|
||||||
Material is always produced where the Licensed Material is synched in timed
|
|
||||||
relation with a moving image.
|
|
||||||
|
|
||||||
b. Adapter's License means the license You apply to Your Copyright and Similar
|
|
||||||
Rights in Your contributions to Adapted Material in accordance with the terms
|
|
||||||
and conditions of this Public License.
|
|
||||||
|
|
||||||
c. BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses,
|
|
||||||
approved by Creative Commons as essentially the equivalent of this Public
|
|
||||||
License.
|
|
||||||
|
|
||||||
d. Copyright and Similar Rights means copyright and/or similar rights closely
|
|
||||||
related to copyright including, without limitation, performance, broadcast,
|
|
||||||
sound recording, and Sui Generis Database Rights, without regard to how the
|
|
||||||
rights are labeled or categorized. For purposes of this Public License, the
|
|
||||||
rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
|
||||||
|
|
||||||
e. Effective Technological Measures means those measures that, in the absence
|
|
||||||
of proper authority, may not be circumvented under laws fulfilling obligations
|
|
||||||
under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996,
|
|
||||||
and/or similar international agreements.
|
|
||||||
|
|
||||||
f. Exceptions and Limitations means fair use, fair dealing, and/or any other
|
|
||||||
exception or limitation to Copyright and Similar Rights that applies to Your
|
|
||||||
use of the Licensed Material.
|
|
||||||
|
|
||||||
g. License Elements means the license attributes listed in the name of a Creative
|
|
||||||
Commons Public License. The License Elements of this Public License are Attribution,
|
|
||||||
NonCommercial, and ShareAlike.
|
|
||||||
|
|
||||||
h. Licensed Material means the artistic or literary work, database, or other
|
|
||||||
material to which the Licensor applied this Public License.
|
|
||||||
|
|
||||||
i. Licensed Rights means the rights granted to You subject to the terms and
|
|
||||||
conditions of this Public License, which are limited to all Copyright and
|
|
||||||
Similar Rights that apply to Your use of the Licensed Material and that the
|
|
||||||
Licensor has authority to license.
|
|
||||||
|
|
||||||
j. Licensor means the individual(s) or entity(ies) granting rights under this
|
|
||||||
Public License.
|
|
||||||
|
|
||||||
k. NonCommercial means not primarily intended for or directed towards commercial
|
|
||||||
advantage or monetary compensation. For purposes of this Public License, the
|
|
||||||
exchange of the Licensed Material for other material subject to Copyright
|
|
||||||
and Similar Rights by digital file-sharing or similar means is NonCommercial
|
|
||||||
provided there is no payment of monetary compensation in connection with the
|
|
||||||
exchange.
|
|
||||||
|
|
||||||
l. Share means to provide material to the public by any means or process that
|
|
||||||
requires permission under the Licensed Rights, such as reproduction, public
|
|
||||||
display, public performance, distribution, dissemination, communication, or
|
|
||||||
importation, and to make material available to the public including in ways
|
|
||||||
that members of the public may access the material from a place and at a time
|
|
||||||
individually chosen by them.
|
|
||||||
|
|
||||||
m. Sui Generis Database Rights means rights other than copyright resulting
|
|
||||||
from Directive 96/9/EC of the European Parliament and of the Council of 11
|
|
||||||
March 1996 on the legal protection of databases, as amended and/or succeeded,
|
|
||||||
as well as other essentially equivalent rights anywhere in the world.
|
|
||||||
|
|
||||||
n. You means the individual or entity exercising the Licensed Rights under
|
|
||||||
this Public License. Your has a corresponding meaning.
|
|
||||||
|
|
||||||
Section 2 – Scope.
|
|
||||||
|
|
||||||
a. License grant.
|
|
||||||
|
|
||||||
1. Subject to the terms and conditions of this Public License, the Licensor
|
|
||||||
hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive,
|
|
||||||
irrevocable license to exercise the Licensed Rights in the Licensed Material
|
|
||||||
to:
|
|
||||||
|
|
||||||
A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial
|
|
||||||
purposes only; and
|
|
||||||
|
|
||||||
B. produce, reproduce, and Share Adapted Material for NonCommercial purposes
|
|
||||||
only.
|
|
||||||
|
|
||||||
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions
|
|
||||||
and Limitations apply to Your use, this Public License does not apply, and
|
|
||||||
You do not need to comply with its terms and conditions.
|
|
||||||
|
|
||||||
3. Term. The term of this Public License is specified in Section 6(a).
|
|
||||||
|
|
||||||
4. Media and formats; technical modifications allowed. The Licensor authorizes
|
|
||||||
You to exercise the Licensed Rights in all media and formats whether now known
|
|
||||||
or hereafter created, and to make technical modifications necessary to do
|
|
||||||
so. The Licensor waives and/or agrees not to assert any right or authority
|
|
||||||
to forbid You from making technical modifications necessary to exercise the
|
|
||||||
Licensed Rights, including technical modifications necessary to circumvent
|
|
||||||
Effective Technological Measures. For purposes of this Public License, simply
|
|
||||||
making modifications authorized by this Section 2(a)(4) never produces Adapted
|
|
||||||
Material.
|
|
||||||
|
|
||||||
5. Downstream recipients.
|
|
||||||
|
|
||||||
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed
|
|
||||||
Material automatically receives an offer from the Licensor to exercise the
|
|
||||||
Licensed Rights under the terms and conditions of this Public License.
|
|
||||||
|
|
||||||
B. Additional offer from the Licensor – Adapted Material. Every recipient
|
|
||||||
of Adapted Material from You automatically receives an offer from the Licensor
|
|
||||||
to exercise the Licensed Rights in the Adapted Material under the conditions
|
|
||||||
of the Adapter's License You apply.
|
|
||||||
|
|
||||||
C. No downstream restrictions. You may not offer or impose any additional
|
|
||||||
or different terms or conditions on, or apply any Effective Technological
|
|
||||||
Measures to, the Licensed Material if doing so restricts exercise of the Licensed
|
|
||||||
Rights by any recipient of the Licensed Material.
|
|
||||||
|
|
||||||
6. No endorsement. Nothing in this Public License constitutes or may be construed
|
|
||||||
as permission to assert or imply that You are, or that Your use of the Licensed
|
|
||||||
Material is, connected with, or sponsored, endorsed, or granted official status
|
|
||||||
by, the Licensor or others designated to receive attribution as provided in
|
|
||||||
Section 3(a)(1)(A)(i).
|
|
||||||
|
|
||||||
b. Other rights.
|
|
||||||
|
|
||||||
1. Moral rights, such as the right of integrity, are not licensed under this
|
|
||||||
Public License, nor are publicity, privacy, and/or other similar personality
|
|
||||||
rights; however, to the extent possible, the Licensor waives and/or agrees
|
|
||||||
not to assert any such rights held by the Licensor to the limited extent necessary
|
|
||||||
to allow You to exercise the Licensed Rights, but not otherwise.
|
|
||||||
|
|
||||||
2. Patent and trademark rights are not licensed under this Public License.
|
|
||||||
|
|
||||||
3. To the extent possible, the Licensor waives any right to collect royalties
|
|
||||||
from You for the exercise of the Licensed Rights, whether directly or through
|
|
||||||
a collecting society under any voluntary or waivable statutory or compulsory
|
|
||||||
licensing scheme. In all other cases the Licensor expressly reserves any right
|
|
||||||
to collect such royalties, including when the Licensed Material is used other
|
|
||||||
than for NonCommercial purposes.
|
|
||||||
|
|
||||||
Section 3 – License Conditions.
|
|
||||||
|
|
||||||
Your exercise of the Licensed Rights is expressly made subject to the following
|
|
||||||
conditions.
|
|
||||||
|
|
||||||
a. Attribution.
|
|
||||||
|
|
||||||
1. If You Share the Licensed Material (including in modified form), You must:
|
|
||||||
|
|
||||||
A. retain the following if it is supplied by the Licensor with the Licensed
|
|
||||||
Material:
|
|
||||||
|
|
||||||
i. identification of the creator(s) of the Licensed Material and any others
|
|
||||||
designated to receive attribution, in any reasonable manner requested by the
|
|
||||||
Licensor (including by pseudonym if designated);
|
|
||||||
|
|
||||||
ii. a copyright notice;
|
|
||||||
|
|
||||||
iii. a notice that refers to this Public License;
|
|
||||||
|
|
||||||
iv. a notice that refers to the disclaimer of warranties;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
|
||||||
|
|
||||||
B. indicate if You modified the Licensed Material and retain an indication
|
|
||||||
of any previous modifications; and
|
|
||||||
|
|
||||||
C. indicate the Licensed Material is licensed under this Public License, and
|
|
||||||
include the text of, or the URI or hyperlink to, this Public License.
|
|
||||||
|
|
||||||
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner
|
|
||||||
based on the medium, means, and context in which You Share the Licensed Material.
|
|
||||||
For example, it may be reasonable to satisfy the conditions by providing a
|
|
||||||
URI or hyperlink to a resource that includes the required information.
|
|
||||||
|
|
||||||
3. If requested by the Licensor, You must remove any of the information required
|
|
||||||
by Section 3(a)(1)(A) to the extent reasonably practicable.
|
|
||||||
|
|
||||||
b. ShareAlike.In addition to the conditions in Section 3(a), if You Share
|
|
||||||
Adapted Material You produce, the following conditions also apply.
|
|
||||||
|
|
||||||
1. The Adapter's License You apply must be a Creative Commons license with
|
|
||||||
the same License Elements, this version or later, or a BY-NC-SA Compatible
|
|
||||||
License.
|
|
||||||
|
|
||||||
2. You must include the text of, or the URI or hyperlink to, the Adapter's
|
|
||||||
License You apply. You may satisfy this condition in any reasonable manner
|
|
||||||
based on the medium, means, and context in which You Share Adapted Material.
|
|
||||||
|
|
||||||
3. You may not offer or impose any additional or different terms or conditions
|
|
||||||
on, or apply any Effective Technological Measures to, Adapted Material that
|
|
||||||
restrict exercise of the rights granted under the Adapter's License You apply.
|
|
||||||
|
|
||||||
Section 4 – Sui Generis Database Rights.
|
|
||||||
|
|
||||||
Where the Licensed Rights include Sui Generis Database Rights that apply to
|
|
||||||
Your use of the Licensed Material:
|
|
||||||
|
|
||||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract,
|
|
||||||
reuse, reproduce, and Share all or a substantial portion of the contents of
|
|
||||||
the database for NonCommercial purposes only;
|
|
||||||
|
|
||||||
b. if You include all or a substantial portion of the database contents in
|
|
||||||
a database in which You have Sui Generis Database Rights, then the database
|
|
||||||
in which You have Sui Generis Database Rights (but not its individual contents)
|
|
||||||
is Adapted Material, including for purposes of Section 3(b); and
|
|
||||||
|
|
||||||
c. You must comply with the conditions in Section 3(a) if You Share all or
|
|
||||||
a substantial portion of the contents of the database.
|
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 4 supplements and does not replace
|
|
||||||
Your obligations under this Public License where the Licensed Rights include
|
|
||||||
other Copyright and Similar Rights.
|
|
||||||
|
|
||||||
Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
|
||||||
|
|
||||||
a. Unless otherwise separately undertaken by the Licensor, to the extent possible,
|
|
||||||
the Licensor offers the Licensed Material as-is and as-available, and makes
|
|
||||||
no representations or warranties of any kind concerning the Licensed Material,
|
|
||||||
whether express, implied, statutory, or other. This includes, without limitation,
|
|
||||||
warranties of title, merchantability, fitness for a particular purpose, non-infringement,
|
|
||||||
absence of latent or other defects, accuracy, or the presence or absence of
|
|
||||||
errors, whether or not known or discoverable. Where disclaimers of warranties
|
|
||||||
are not allowed in full or in part, this disclaimer may not apply to You.
|
|
||||||
|
|
||||||
b. To the extent possible, in no event will the Licensor be liable to You
|
|
||||||
on any legal theory (including, without limitation, negligence) or otherwise
|
|
||||||
for any direct, special, indirect, incidental, consequential, punitive, exemplary,
|
|
||||||
or other losses, costs, expenses, or damages arising out of this Public License
|
|
||||||
or use of the Licensed Material, even if the Licensor has been advised of
|
|
||||||
the possibility of such losses, costs, expenses, or damages. Where a limitation
|
|
||||||
of liability is not allowed in full or in part, this limitation may not apply
|
|
||||||
to You.
|
|
||||||
|
|
||||||
c. The disclaimer of warranties and limitation of liability provided above
|
|
||||||
shall be interpreted in a manner that, to the extent possible, most closely
|
|
||||||
approximates an absolute disclaimer and waiver of all liability.
|
|
||||||
|
|
||||||
Section 6 – Term and Termination.
|
|
||||||
|
|
||||||
a. This Public License applies for the term of the Copyright and Similar Rights
|
|
||||||
licensed here. However, if You fail to comply with this Public License, then
|
|
||||||
Your rights under this Public License terminate automatically.
|
|
||||||
|
|
||||||
b. Where Your right to use the Licensed Material has terminated under Section
|
|
||||||
6(a), it reinstates:
|
|
||||||
|
|
||||||
1. automatically as of the date the violation is cured, provided it is cured
|
|
||||||
within 30 days of Your discovery of the violation; or
|
|
||||||
|
|
||||||
2. upon express reinstatement by the Licensor.
|
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 6(b) does not affect any right the
|
|
||||||
Licensor may have to seek remedies for Your violations of this Public License.
|
|
||||||
|
|
||||||
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material
|
|
||||||
under separate terms or conditions or stop distributing the Licensed Material
|
|
||||||
at any time; however, doing so will not terminate this Public License.
|
|
||||||
|
|
||||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
|
||||||
|
|
||||||
Section 7 – Other Terms and Conditions.
|
|
||||||
|
|
||||||
a. The Licensor shall not be bound by any additional or different terms or
|
|
||||||
conditions communicated by You unless expressly agreed.
|
|
||||||
|
|
||||||
b. Any arrangements, understandings, or agreements regarding the Licensed
|
|
||||||
Material not stated herein are separate from and independent of the terms
|
|
||||||
and conditions of this Public License.
|
|
||||||
|
|
||||||
Section 8 – Interpretation.
|
|
||||||
|
|
||||||
a. For the avoidance of doubt, this Public License does not, and shall not
|
|
||||||
be interpreted to, reduce, limit, restrict, or impose conditions on any use
|
|
||||||
of the Licensed Material that could lawfully be made without permission under
|
|
||||||
this Public License.
|
|
||||||
|
|
||||||
b. To the extent possible, if any provision of this Public License is deemed
|
|
||||||
unenforceable, it shall be automatically reformed to the minimum extent necessary
|
|
||||||
to make it enforceable. If the provision cannot be reformed, it shall be severed
|
|
||||||
from this Public License without affecting the enforceability of the remaining
|
|
||||||
terms and conditions.
|
|
||||||
|
|
||||||
c. No term or condition of this Public License will be waived and no failure
|
|
||||||
to comply consented to unless expressly agreed to by the Licensor.
|
|
||||||
|
|
||||||
d. Nothing in this Public License constitutes or may be interpreted as a limitation
|
|
||||||
upon, or waiver of, any privileges and immunities that apply to the Licensor
|
|
||||||
or You, including from the legal processes of any jurisdiction or authority.
|
|
||||||
|
|
||||||
Creative Commons is not a party to its public licenses. Notwithstanding, Creative
|
|
||||||
Commons may elect to apply one of its public licenses to material it publishes
|
|
||||||
and in those instances will be considered the "Licensor." The text of the
|
|
||||||
Creative Commons public licenses is dedicated to the public domain under the
|
|
||||||
CC0 Public Domain Dedication. Except for the limited purpose of indicating
|
|
||||||
that material is shared under a Creative Commons public license or as otherwise
|
|
||||||
permitted by the Creative Commons policies published at creativecommons.org/policies,
|
|
||||||
Creative Commons does not authorize the use of the trademark "Creative Commons"
|
|
||||||
or any other trademark or logo of Creative Commons without its prior written
|
|
||||||
consent including, without limitation, in connection with any unauthorized
|
|
||||||
modifications to any of its public licenses or any other arrangements, understandings,
|
|
||||||
or agreements concerning use of licensed material. For the avoidance of doubt,
|
|
||||||
this paragraph does not form part of the public licenses.
|
|
||||||
|
|
||||||
Creative Commons may be contacted at creativecommons.org.
|
|
||||||
@@ -1,3 +1,31 @@
|
|||||||
# document-server
|
# ✒️ Document generation microservices
|
||||||
|
|
||||||
The document generation server responsible for creating pdfs for sponsoring contracts, certificates and more.
|
## Features
|
||||||
|
|
||||||
|
- 📝 HTML pdf templates
|
||||||
|
- 📚 OpenAPI/Swagger documentation
|
||||||
|
- ⚡ High-performance with go and gotenberg
|
||||||
|
|
||||||
|
## 🚀 Quick Start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies
|
||||||
|
go mod download
|
||||||
|
|
||||||
|
# Generate the swagger docs
|
||||||
|
swag init
|
||||||
|
|
||||||
|
# Run the server
|
||||||
|
air
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📖 API Documentation
|
||||||
|
|
||||||
|
Swagger UI is available at: `/swagger`
|
||||||
|
|
||||||
|
## 🛠️ Development
|
||||||
|
|
||||||
|
The project uses:
|
||||||
|
|
||||||
|
- 🏃♂️ go as the language and build tool
|
||||||
|
- 🌐 gofiber for the web framework
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
services:
|
||||||
|
gotenberg:
|
||||||
|
image: gotenberg/gotenberg:8
|
||||||
|
ports:
|
||||||
|
- "3001:3000"
|
||||||
+180
@@ -0,0 +1,180 @@
|
|||||||
|
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||||
|
package docs
|
||||||
|
|
||||||
|
import "github.com/swaggo/swag"
|
||||||
|
|
||||||
|
const docTemplate = `{
|
||||||
|
"schemes": {{ marshal .Schemes }},
|
||||||
|
"swagger": "2.0",
|
||||||
|
"info": {
|
||||||
|
"description": "{{escape .Description}}",
|
||||||
|
"title": "{{.Title}}",
|
||||||
|
"contact": {},
|
||||||
|
"version": "{{.Version}}"
|
||||||
|
},
|
||||||
|
"host": "{{.Host}}",
|
||||||
|
"basePath": "{{.BasePath}}",
|
||||||
|
"paths": {
|
||||||
|
"/cards": {
|
||||||
|
"post": {
|
||||||
|
"description": "Generate cards based on the provided data",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/pdf"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"cards"
|
||||||
|
],
|
||||||
|
"summary": "Generate runner cards",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Card data",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.CardRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/contracts": {
|
||||||
|
"post": {
|
||||||
|
"description": "Generate a contract based on the provided data",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/pdf"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"contracts"
|
||||||
|
],
|
||||||
|
"summary": "Generate a contract",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Contract data",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.ContractRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"definitions": {
|
||||||
|
"models.Card": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"code": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"runner": {
|
||||||
|
"$ref": "#/definitions/models.Runner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CardRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"cards": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/models.Card"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"locale": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"en",
|
||||||
|
"de"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.ContractRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"locale": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"en",
|
||||||
|
"de"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"runners": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/models.Runner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.Group": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parent_group": {
|
||||||
|
"$ref": "#/definitions/models.Group"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.Runner": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"first_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"$ref": "#/definitions/models.Group"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"last_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"middle_name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`
|
||||||
|
|
||||||
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||||
|
var SwaggerInfo = &swag.Spec{
|
||||||
|
Version: "",
|
||||||
|
Host: "",
|
||||||
|
BasePath: "",
|
||||||
|
Schemes: []string{},
|
||||||
|
Title: "LfK Document Server API",
|
||||||
|
Description: "This is the API documentation for the LfK Document Server - a tool for pdf generation.",
|
||||||
|
InfoInstanceName: "swagger",
|
||||||
|
SwaggerTemplate: docTemplate,
|
||||||
|
LeftDelim: "{{",
|
||||||
|
RightDelim: "}}",
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
||||||
|
}
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
{
|
||||||
|
"swagger": "2.0",
|
||||||
|
"info": {
|
||||||
|
"description": "This is the API documentation for the LfK Document Server - a tool for pdf generation.",
|
||||||
|
"title": "LfK Document Server API",
|
||||||
|
"contact": {}
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"/cards": {
|
||||||
|
"post": {
|
||||||
|
"description": "Generate cards based on the provided data",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/pdf"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"cards"
|
||||||
|
],
|
||||||
|
"summary": "Generate runner cards",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Card data",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.CardRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/contracts": {
|
||||||
|
"post": {
|
||||||
|
"description": "Generate a contract based on the provided data",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/pdf"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"contracts"
|
||||||
|
],
|
||||||
|
"summary": "Generate a contract",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Contract data",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.ContractRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"definitions": {
|
||||||
|
"models.Card": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"code": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"runner": {
|
||||||
|
"$ref": "#/definitions/models.Runner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CardRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"cards": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/models.Card"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"locale": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"en",
|
||||||
|
"de"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.ContractRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"locale": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"en",
|
||||||
|
"de"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"runners": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/models.Runner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.Group": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parent_group": {
|
||||||
|
"$ref": "#/definitions/models.Group"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.Runner": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"first_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"$ref": "#/definitions/models.Group"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"last_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"middle_name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
definitions:
|
||||||
|
models.Card:
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: string
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
runner:
|
||||||
|
$ref: '#/definitions/models.Runner'
|
||||||
|
type: object
|
||||||
|
models.CardRequest:
|
||||||
|
properties:
|
||||||
|
cards:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/models.Card'
|
||||||
|
type: array
|
||||||
|
locale:
|
||||||
|
enum:
|
||||||
|
- en
|
||||||
|
- de
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
models.ContractRequest:
|
||||||
|
properties:
|
||||||
|
locale:
|
||||||
|
enum:
|
||||||
|
- en
|
||||||
|
- de
|
||||||
|
type: string
|
||||||
|
runners:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/models.Runner'
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
models.Group:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
parent_group:
|
||||||
|
$ref: '#/definitions/models.Group'
|
||||||
|
type: object
|
||||||
|
models.Runner:
|
||||||
|
properties:
|
||||||
|
first_name:
|
||||||
|
type: string
|
||||||
|
group:
|
||||||
|
$ref: '#/definitions/models.Group'
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
last_name:
|
||||||
|
type: string
|
||||||
|
middle_name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
info:
|
||||||
|
contact: {}
|
||||||
|
description: This is the API documentation for the LfK Document Server - a tool
|
||||||
|
for pdf generation.
|
||||||
|
title: LfK Document Server API
|
||||||
|
paths:
|
||||||
|
/cards:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Generate cards based on the provided data
|
||||||
|
parameters:
|
||||||
|
- description: Card data
|
||||||
|
in: body
|
||||||
|
name: data
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/models.CardRequest'
|
||||||
|
produces:
|
||||||
|
- application/pdf
|
||||||
|
responses: {}
|
||||||
|
summary: Generate runner cards
|
||||||
|
tags:
|
||||||
|
- cards
|
||||||
|
/contracts:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Generate a contract based on the provided data
|
||||||
|
parameters:
|
||||||
|
- description: Contract data
|
||||||
|
in: body
|
||||||
|
name: data
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/models.ContractRequest'
|
||||||
|
produces:
|
||||||
|
- application/pdf
|
||||||
|
responses: {}
|
||||||
|
summary: Generate a contract
|
||||||
|
tags:
|
||||||
|
- contracts
|
||||||
|
swagger: "2.0"
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
module git.odit.services/lfk/document-server
|
||||||
|
|
||||||
|
go 1.23.2
|
||||||
|
|
||||||
|
toolchain go1.23.3
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/gofiber/fiber/v2 v2.52.5
|
||||||
|
github.com/gofiber/swagger v1.1.0
|
||||||
|
github.com/swaggo/swag v1.16.4
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||||
|
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||||
|
github.com/boombuler/barcode v1.0.2 // indirect
|
||||||
|
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||||
|
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||||
|
github.com/go-openapi/spec v0.21.0 // indirect
|
||||||
|
github.com/go-openapi/swag v0.23.0 // indirect
|
||||||
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
|
github.com/klauspost/compress v1.17.11 // indirect
|
||||||
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
|
github.com/makiuchi-d/gozxing v0.1.1 // indirect
|
||||||
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
|
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||||
|
github.com/oxplot/papersizes v0.0.0-20181201065918-90a3a5ae1915 // indirect
|
||||||
|
github.com/rivo/uniseg v0.4.7 // indirect
|
||||||
|
github.com/swaggo/files/v2 v2.0.1 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.57.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/sys v0.27.0 // indirect
|
||||||
|
golang.org/x/tools v0.27.0 // indirect
|
||||||
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
)
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
|
||||||
|
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
|
||||||
|
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
|
||||||
|
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
|
||||||
|
github.com/boombuler/barcode v1.0.2 h1:79yrbttoZrLGkL/oOI8hBrUKucwOL0oOjUgEguGMcJ4=
|
||||||
|
github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
|
||||||
|
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
|
||||||
|
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
|
||||||
|
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
|
||||||
|
github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
|
||||||
|
github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
|
||||||
|
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||||
|
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||||
|
github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo=
|
||||||
|
github.com/gofiber/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
|
||||||
|
github.com/gofiber/swagger v1.1.0 h1:ff3rg1fB+Rp5JN/N8jfxTiZtMKe/9tB9QDc79fPiJKQ=
|
||||||
|
github.com/gofiber/swagger v1.1.0/go.mod h1:pRZL0Np35sd+lTODTE5The0G+TMHfNY+oC4hM2/i5m8=
|
||||||
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
|
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||||
|
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||||
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||||
|
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
|
github.com/makiuchi-d/gozxing v0.1.1 h1:xxqijhoedi+/lZlhINteGbywIrewVdVv2wl9r5O9S1I=
|
||||||
|
github.com/makiuchi-d/gozxing v0.1.1/go.mod h1:eRIHbOjX7QWxLIDJoQuMLhuXg9LAuw6znsUtRkNw9DU=
|
||||||
|
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||||
|
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||||
|
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
|
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||||
|
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
|
github.com/oxplot/papersizes v0.0.0-20181201065918-90a3a5ae1915 h1:4WzMzgExTgBfuUQ/HegMf+jcHtH+c3fl7eySUQUbfzg=
|
||||||
|
github.com/oxplot/papersizes v0.0.0-20181201065918-90a3a5ae1915/go.mod h1:LJRTnhoARxQgMyT7T9L+ZzwR4OrmyHTy5LPxZEzE1CM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
|
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||||
|
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||||
|
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||||
|
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
|
github.com/swaggo/files/v2 v2.0.1 h1:XCVJO/i/VosCDsJu1YLpdejGsGnBE9deRMpjN4pJLHk=
|
||||||
|
github.com/swaggo/files/v2 v2.0.1/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0JQj66kyM=
|
||||||
|
github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A=
|
||||||
|
github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg=
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
|
github.com/valyala/fasthttp v1.57.0 h1:Xw8SjWGEP/+wAAgyy5XTvgrWlOD1+TxbbvNADYCm1Tg=
|
||||||
|
github.com/valyala/fasthttp v1.57.0/go.mod h1:h6ZBaPRlzpZ6O3H5t2gEk1Qi33+TmLvfwgLLp0t9CpE=
|
||||||
|
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
|
||||||
|
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||||
|
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
|
||||||
|
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
||||||
|
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||||
|
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||||
|
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||||
|
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||||
|
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
|
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
|
||||||
|
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
|
||||||
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||||
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"slices"
|
||||||
|
|
||||||
|
"git.odit.services/lfk/document-server/models"
|
||||||
|
"git.odit.services/lfk/document-server/services"
|
||||||
|
"git.odit.services/lfk/document-server/templates"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GenerateCard godoc
|
||||||
|
// @Summary Generate runner cards
|
||||||
|
// @Description Generate cards based on the provided data
|
||||||
|
// @Tags cards
|
||||||
|
// @Accept json
|
||||||
|
// @Param data body models.CardRequest true "Card data"
|
||||||
|
// @Produce application/pdf
|
||||||
|
// @Router /cards [post]
|
||||||
|
func GenerateCard(c *fiber.Ctx) error {
|
||||||
|
cardRequest := new(models.CardRequest)
|
||||||
|
if err := c.BodyParser(cardRequest); err != nil {
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if !slices.Contains([]string{"en", "de"}, cardRequest.Locale) {
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": "Invalid locale",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
generator := services.DefaultTemplater{}
|
||||||
|
templateString, err := templates.GetTemplate(cardRequest.Locale, "card")
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": "Template not found",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
template, err := generator.StringToTemplate(templateString)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
genConfig := &models.CardTemplateOptions{
|
||||||
|
CardSegments: splitCardSegments(cardRequest.Cards),
|
||||||
|
EventName: "Event name",
|
||||||
|
CardSubtitle: "Card subtitle",
|
||||||
|
BarcodeFormat: "ean13",
|
||||||
|
BarcodePrefix: "",
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := generator.Execute(template, genConfig)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
c.Set(fiber.HeaderContentType, "text/html")
|
||||||
|
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
||||||
|
pdf, err := converter.ToPdf(result, "a4", false)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Set(fiber.HeaderContentType, "application/pdf")
|
||||||
|
return c.Send(pdf)
|
||||||
|
}
|
||||||
|
|
||||||
|
func invertCardArrayItemPairs(cards []models.Card) []models.Card {
|
||||||
|
inverted := make([]models.Card, 0)
|
||||||
|
for i := 0; i < len(cards); i += 2 {
|
||||||
|
if i+1 < len(cards) {
|
||||||
|
inverted = append(inverted, cards[i+1])
|
||||||
|
}
|
||||||
|
inverted = append(inverted, cards[i])
|
||||||
|
}
|
||||||
|
return inverted
|
||||||
|
}
|
||||||
|
|
||||||
|
func splitCardSegments(cards []models.Card) []models.CardTemplateSegment {
|
||||||
|
cardSegments := make([]models.CardTemplateSegment, 0)
|
||||||
|
const currentCards = 0
|
||||||
|
for i := 0; i < len(cards); i += 10 {
|
||||||
|
segmentLength := 10
|
||||||
|
if len(cards)-i < 10 {
|
||||||
|
segmentLength = len(cards) - i
|
||||||
|
}
|
||||||
|
segment := cards[i : i+segmentLength]
|
||||||
|
if segmentLength%2 != 0 {
|
||||||
|
segment = append(segment, models.Card{
|
||||||
|
ID: 0,
|
||||||
|
Enabled: false,
|
||||||
|
Runner: models.Runner{},
|
||||||
|
Code: "",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
cardSegments = append(cardSegments, models.CardTemplateSegment{
|
||||||
|
Cards: segment,
|
||||||
|
CardsSwapped: invertCardArrayItemPairs(segment),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return cardSegments
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"slices"
|
||||||
|
|
||||||
|
"git.odit.services/lfk/document-server/models"
|
||||||
|
"git.odit.services/lfk/document-server/services"
|
||||||
|
"git.odit.services/lfk/document-server/templates"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GenerateContract godoc
|
||||||
|
// @Summary Generate a contract
|
||||||
|
// @Description Generate a contract based on the provided data
|
||||||
|
// @Tags contracts
|
||||||
|
// @Accept json
|
||||||
|
// @Param data body models.ContractRequest true "Contract data"
|
||||||
|
// @Produce application/pdf
|
||||||
|
// @Router /contracts [post]
|
||||||
|
func GenerateContract(c *fiber.Ctx) error {
|
||||||
|
contract := new(models.ContractRequest)
|
||||||
|
if err := c.BodyParser(contract); err != nil {
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if !slices.Contains([]string{"en", "de"}, contract.Locale) {
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": "Invalid locale",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
contract.Runners = repeatRunnerArrayItems(contract.Runners, 2)
|
||||||
|
|
||||||
|
generator := services.DefaultTemplater{}
|
||||||
|
templateString, err := templates.GetTemplate(contract.Locale, "contract")
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": "Template not found",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
template, err := generator.StringToTemplate(templateString)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
genConfig := &models.ContractTemplateOptions{
|
||||||
|
Runners: contract.Runners,
|
||||||
|
CurrencySymbol: "€",
|
||||||
|
Disclaimer: "This is a disclaimer",
|
||||||
|
ReceiptMinimumAmount: 10,
|
||||||
|
EventName: "Event name",
|
||||||
|
SponsoringHeader: templates.ImageSponsoringHeaderBase64,
|
||||||
|
BarcodeFormat: "ean13",
|
||||||
|
BarcodePrefix: "1",
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := generator.Execute(template, genConfig)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
||||||
|
pdf, err := converter.ToPdf(result, "a5", true)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Set(fiber.HeaderContentType, "application/pdf")
|
||||||
|
return c.Send(pdf)
|
||||||
|
}
|
||||||
|
|
||||||
|
func repeatRunnerArrayItems(runners []models.Runner, duplicates int) []models.Runner {
|
||||||
|
var duplicatedRunners []models.Runner
|
||||||
|
for _, runner := range runners {
|
||||||
|
for i := 0; i < duplicates; i++ {
|
||||||
|
duplicatedRunners = append(duplicatedRunners, runner)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return duplicatedRunners
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
|
func NotFoundHandler(c *fiber.Ctx) error {
|
||||||
|
return c.Status(404).SendString("Not Found")
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"git.odit.services/lfk/document-server/docs" // Correct import path for docs
|
||||||
|
"git.odit.services/lfk/document-server/handlers"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/gofiber/swagger"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
port = flag.String("port", ":3000", "Port to listen on")
|
||||||
|
prod = flag.Bool("prod", false, "Enable prefork in Production")
|
||||||
|
)
|
||||||
|
|
||||||
|
// @title LfK Document Server API
|
||||||
|
// @description This is the API documentation for the LfK Document Server - a tool for pdf generation.
|
||||||
|
func main() {
|
||||||
|
// Parse command-line flags
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
// Create a new Fiber instance
|
||||||
|
app := fiber.New(fiber.Config{
|
||||||
|
Prefork: *prod,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Swagger documentation route
|
||||||
|
app.Get("/swagger/*", swagger.HandlerDefault)
|
||||||
|
|
||||||
|
v1 := app.Group("/v1")
|
||||||
|
|
||||||
|
v1.Get("/", func(c *fiber.Ctx) error {
|
||||||
|
return c.SendString("Hello, World!")
|
||||||
|
})
|
||||||
|
v1.Post("/contracts", handlers.GenerateContract)
|
||||||
|
v1.Post("/cards", handlers.GenerateCard)
|
||||||
|
|
||||||
|
app.Use(handlers.NotFoundHandler)
|
||||||
|
docs.SwaggerInfo.BasePath = "/"
|
||||||
|
|
||||||
|
log.Fatal(app.Listen(*port))
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
type CardRequest struct {
|
||||||
|
Cards []Card `json:"cards"`
|
||||||
|
Locale string `json:"locale" enums:"en,de"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Card struct {
|
||||||
|
ID int `json:"id"`
|
||||||
|
Enabled bool `json:"enabled"`
|
||||||
|
Runner Runner `json:"runner"`
|
||||||
|
Code string `json:"code"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CardTemplateOptions struct {
|
||||||
|
CardSegments []CardTemplateSegment `json:"card_segments"`
|
||||||
|
EventName string `json:"event_name"`
|
||||||
|
CardSubtitle string `json:"card_subtitle"`
|
||||||
|
BarcodeFormat string `json:"barcode_format"`
|
||||||
|
BarcodePrefix string `json:"barcode_prefix"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CardTemplateSegment struct {
|
||||||
|
Cards []Card `json:"cards"`
|
||||||
|
CardsSwapped []Card `json:"cards_swapped"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
type ContractRequest struct {
|
||||||
|
Runners []Runner `json:"runners"`
|
||||||
|
Locale string `json:"locale" enums:"en,de"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Runner struct {
|
||||||
|
ID int `json:"id"`
|
||||||
|
FirstName string `json:"first_name"`
|
||||||
|
MiddleName string `json:"middle_name"`
|
||||||
|
LastName string `json:"last_name"`
|
||||||
|
Group Group `json:"group"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Group struct {
|
||||||
|
ID int `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
ParentGroup *Group `json:"parent_group"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ContractTemplateOptions struct {
|
||||||
|
Runners []Runner `json:"runners"`
|
||||||
|
CurrencySymbol string `json:"currency_symbol"`
|
||||||
|
Disclaimer string `json:"disclaimer"`
|
||||||
|
ReceiptMinimumAmount int `json:"receipt_minimum_amount"`
|
||||||
|
EventName string `json:"event_name"`
|
||||||
|
SponsoringHeader string `json:"base_url"`
|
||||||
|
BarcodeFormat string `json:"barcode_format"`
|
||||||
|
BarcodePrefix string `json:"barcode_prefix"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package services
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"mime/multipart"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/oxplot/papersizes"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Converter interface {
|
||||||
|
ToPdf(html string, pageSize string, landscape bool) ([]byte, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type GotenbergConverter struct {
|
||||||
|
BaseUrl string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *GotenbergConverter) ToPdf(html string, pageSize string, landscape bool) ([]byte, error) {
|
||||||
|
client := &http.Client{}
|
||||||
|
defer client.CloseIdleConnections()
|
||||||
|
|
||||||
|
body := &bytes.Buffer{}
|
||||||
|
writer := multipart.NewWriter(body)
|
||||||
|
|
||||||
|
part, err := writer.CreateFormFile("files", "index.html")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = part.Write([]byte(html))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
size := papersizes.FromName(pageSize)
|
||||||
|
if size == nil {
|
||||||
|
return nil, fmt.Errorf("invalid page size: %s", pageSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("paperWidth", strconv.Itoa(size.Width)+"mm")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("paperHeight", strconv.Itoa(size.Height)+"mm")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("landscape", strconv.FormatBool(landscape))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("marginTop", "0")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("marginBottom", "0")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("marginLeft", "0")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("marginRight", "0")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.WriteField("preferCssPageSize", "true")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = writer.Close()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequest("POST", g.BaseUrl+"/forms/chromium/convert/html", body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||||
|
|
||||||
|
resp, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
defer resp.Body.Close()
|
||||||
|
data := new(bytes.Buffer)
|
||||||
|
_, err = data.ReadFrom(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.Bytes(), nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package services
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/base64"
|
||||||
|
"errors"
|
||||||
|
"html/template"
|
||||||
|
"image/png"
|
||||||
|
|
||||||
|
"github.com/boombuler/barcode"
|
||||||
|
"github.com/boombuler/barcode/code128"
|
||||||
|
"github.com/boombuler/barcode/ean"
|
||||||
|
"github.com/boombuler/barcode/qr"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Templater interface {
|
||||||
|
Execute(template *template.Template, data interface{}) (string, error)
|
||||||
|
StringToTemplate(templateString string) (*template.Template, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DefaultTemplater struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func idToEan13(id string, prefix string) (string, error) {
|
||||||
|
if len(id) > 12 {
|
||||||
|
return "", errors.New("id too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
for len(id) < 11 {
|
||||||
|
id = "0" + id
|
||||||
|
}
|
||||||
|
id = prefix + id
|
||||||
|
|
||||||
|
return id, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *DefaultTemplater) GenerateBarcode(code string, format string, prefix string) (string, error) {
|
||||||
|
var generatedCode barcode.Barcode
|
||||||
|
var err error
|
||||||
|
|
||||||
|
switch format {
|
||||||
|
case "ean13":
|
||||||
|
encodedEan, err := idToEan13(code, prefix)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
generatedCode, err = ean.Encode(encodedEan)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case "code128":
|
||||||
|
generatedCode, err = code128.Encode(prefix + code)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case "qr":
|
||||||
|
generatedCode, err = qr.Encode(prefix+code, qr.M, qr.AlphaNumeric)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
return "", errors.New("unknown barcode format")
|
||||||
|
}
|
||||||
|
|
||||||
|
scaledCode, err := barcode.Scale(generatedCode, 1000, 500)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
var buf bytes.Buffer
|
||||||
|
err = png.Encode(&buf, scaledCode)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return base64.StdEncoding.EncodeToString(buf.Bytes()), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *DefaultTemplater) StringToTemplate(templateString string) (*template.Template, error) {
|
||||||
|
return template.New("template").Funcs(template.FuncMap{
|
||||||
|
"barcode": t.GenerateBarcode,
|
||||||
|
"sponsorLogo": func(id int) string { return "a" },
|
||||||
|
}).Parse(templateString)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *DefaultTemplater) Execute(baseTemplate *template.Template, data interface{}) (string, error) {
|
||||||
|
resultBuffer := new(bytes.Buffer)
|
||||||
|
|
||||||
|
err := baseTemplate.Execute(resultBuffer, data)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultBuffer.String(), nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf8">
|
||||||
|
<title>Sponsoring contract</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
|
||||||
|
<style>
|
||||||
|
.sheet {
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
page-break-after: always;
|
||||||
|
padding: 1.2cm 2cm 1.2cm 2cm
|
||||||
|
}
|
||||||
|
|
||||||
|
body.A4 .sheet {
|
||||||
|
width: 210mm;
|
||||||
|
height: 296mm
|
||||||
|
}
|
||||||
|
|
||||||
|
.runnercard {
|
||||||
|
border: 1px solid;
|
||||||
|
height: 5.5cm;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="A4 landscape">
|
||||||
|
{{ range .CardSegments }}
|
||||||
|
<div class="sheet">
|
||||||
|
<div class="columns is-multiline">
|
||||||
|
{{ range .Cards }}
|
||||||
|
<div class="column is-half runnercard">
|
||||||
|
{{ if ne .Code "" }}
|
||||||
|
<p class="title is-5" style="text-align: center; padding-bottom: 0; margin-top: -0.75rem;">{{ $.EventName }}</p>
|
||||||
|
<p style="text-align: center; margin-top: -1.5rem; font-size: small;">{{ $.CardSubtitle }}</p>
|
||||||
|
<p style="font-size: small;">Mit Unterstützung von:</p>
|
||||||
|
<div class="columns" style="height: 6rem; overflow: hidden;">
|
||||||
|
<div class="column is-half">
|
||||||
|
<!--SPONSOR LOGO HERE-->
|
||||||
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
||||||
|
src="data:image/png;base64,{{ sponsorLogo .ID }}" />
|
||||||
|
</div>
|
||||||
|
<div class="column is-half">
|
||||||
|
<!--BARCODE HERE-->
|
||||||
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 5rem;"
|
||||||
|
src="data:image/png;base64,{{ barcode .Code $.BarcodeFormat $.BarcodePrefix }}" />
|
||||||
|
<p style="font-size: 0.6rem; text-align: center; margin: 0; padding: 0;">{{ .Code }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>{{ .Runner.LastName }}, {{ .Runner.FirstName }} {{ .Runner.MiddleName }}</p>
|
||||||
|
<p>{{ .Runner.Group.Name }}</p>
|
||||||
|
{{ end}}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sheet">
|
||||||
|
<div class="columns is-multiline">
|
||||||
|
{{ range .CardsSwapped }}
|
||||||
|
<div class="column is-half runnercard" style="justify-content: center; align-items: center; text-align: center;">
|
||||||
|
{{ if ne .Code "" }}
|
||||||
|
<!--SPONSOR LOGO FIRST-->
|
||||||
|
<div style="height: 2cm; padding: 0 0 1cm 0">
|
||||||
|
<img style="object-fit: cover; max-height: 2cm;" src="data:image/png;base64,{{ sponsorLogo .ID }}" />
|
||||||
|
</div>
|
||||||
|
<img style="object-fit: cover; max-height: 6rem; position: relative;"
|
||||||
|
src="data:image/png;base64,{{ barcode .Code $.BarcodeFormat $.BarcodePrefix }}" />
|
||||||
|
<p style="font-size: 1rem; text-align: center; margin: 0; padding: 0;">{{ .Code }}</p>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end}}
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf8">
|
||||||
|
<title>Sponsoring contract</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
|
||||||
|
<style>
|
||||||
|
.sheet {
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
page-break-after: always;
|
||||||
|
padding: 1.2cm 2cm 1.2cm 2cm
|
||||||
|
}
|
||||||
|
|
||||||
|
body.A4 .sheet {
|
||||||
|
width: 210mm;
|
||||||
|
height: 296mm
|
||||||
|
}
|
||||||
|
|
||||||
|
.runnercard {
|
||||||
|
border: 1px solid;
|
||||||
|
height: 5.5cm;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="A4 landscape">
|
||||||
|
{{ range .CardSegments }}
|
||||||
|
<div class="sheet">
|
||||||
|
<div class="columns is-multiline">
|
||||||
|
{{ range .Cards }}
|
||||||
|
<div class="column is-half runnercard">
|
||||||
|
<p class="title is-5" style="text-align: center; padding-bottom: 0; margin-top: -0.75rem;">{{ $.EventName }}</p>
|
||||||
|
<p style="text-align: center; margin-top: -1.5rem; font-size: small;">{{ $.CardSubtitle }}</p>
|
||||||
|
<p style="font-size: small;">Supported by:</p>
|
||||||
|
<div class="columns" style="height: 6rem; overflow: hidden;">
|
||||||
|
<div class="column is-half">
|
||||||
|
<!--SPONSOR LOGO HERE-->
|
||||||
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
||||||
|
src="data:image/png;base64,{{ sponsorLogo .ID }}" />
|
||||||
|
</div>
|
||||||
|
<div class="column is-half">
|
||||||
|
<!--BARCODE HERE-->
|
||||||
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 5rem;"
|
||||||
|
src="data:image/png;base64,{{ barcode .Code $.BarcodeFormat $.BarcodePrefix }}" />
|
||||||
|
<p style="font-size: 0.6rem; text-align: center; margin: 0; padding: 0;">{{ .Code }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>{{ .Runner.LastName }}, {{ .Runner.FirstName }} {{ .Runner.MiddleName }}</p>
|
||||||
|
<p>{{ .Runner.Group.Name }}</p>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sheet">
|
||||||
|
<div class="columns is-multiline">
|
||||||
|
{{ range .CardsSwapped }}
|
||||||
|
<div class="column is-half runnercard" style="justify-content: center; align-items: center; text-align: center;">
|
||||||
|
<!--SPONSOR LOGO FIRST-->
|
||||||
|
<div style="height: 2cm; padding: 0 0 1cm 0">
|
||||||
|
<img style="object-fit: cover; max-height: 2cm;" src="data:image/png;base64,{{ sponsorLogo .ID }}" />
|
||||||
|
</div>
|
||||||
|
<img style="object-fit: cover; max-height: 6rem; position: relative;" src="data:image/png;base64,{{ barcode .Code $.BarcodeFormat $.BarcodePrefix }}" />
|
||||||
|
<p style="font-size: 1rem; text-align: center; margin: 0; padding: 0;">{{ .Code }}</p>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end}}
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf8">
|
||||||
|
<title>Sponsoring contract</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
|
||||||
|
<style>
|
||||||
|
.sheet {
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
page-break-after: always;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.A5.landscape .sheet {
|
||||||
|
width: 210mm;
|
||||||
|
height: 147mm
|
||||||
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
margin-bottom: -20;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="A5 landscape">
|
||||||
|
{{ range .Runners }}
|
||||||
|
<div class="sheet">
|
||||||
|
<img id="header_img" width="100%" src="data:image/png;base64,{{ $.SponsoringHeader}}" />
|
||||||
|
<div style=" padding: 0 1rem 0 1rem;">
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-10">
|
||||||
|
<div class="columns" style="padding-bottom: 0;">
|
||||||
|
<div class="column is-two-fifths">
|
||||||
|
<p style="font-size: large; font-weight: bold;">Sponsoringerklärung</p>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<p style="font-size: x-small; vertical-align: revert; margin-top: auto;">Bitte in DRUCKBUCHSTABEN
|
||||||
|
schreiben
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>Ich bin/ Wir sind bereit anlässlich des {{ $.EventName }}</p>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-9">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .FirstName }}
|
||||||
|
{{ .MiddleName }}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">Vorname</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-3">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .ID }}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">ID</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
||||||
|
src="data:image/png;base64,{{ barcode (printf "%d" .ID) $.BarcodeFormat $.BarcodePrefix }}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns" style="padding-top: 1rem;">
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .LastName }}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">Nachname</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .Group.Name }}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">Team/ Klasse</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style="margin-top: -0.5rem">mit einem Betrag von _____ {{ $.CurrencySymbol }} pro gelaufenem Kilometer zu
|
||||||
|
unterstützen.</p>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Nachname</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Vorname</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style="font-size: medium; margin-top: -0.5rem;">Adresse (Sponsor)</p>
|
||||||
|
<p style="font-size: x-small;">(Muss ausgefüllt werden, wenn Sie eine Spendenquittung benötigen -
|
||||||
|
Spendenquittungen können erst ab einem Gesamtbetrag von {{ $.ReceiptMinimumAmount }}{{ $.CurrencySymbol }}
|
||||||
|
ausgestellt werden)</p>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-8">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Straße</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-4">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Hausnummer</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-4">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Postleitzahl</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-8">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Stadt</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-7">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Ort, Datum</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-5">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Unterschrift</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style="font-size: xx-small; overflow: hidden; height: 4rem; text-align: center;"> {{ $.Disclaimer }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf8">
|
||||||
|
<title>Sponsoring contract</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
|
||||||
|
<style>
|
||||||
|
.sheet {
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
page-break-after: always;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.A5.landscape .sheet {
|
||||||
|
width: 210mm;
|
||||||
|
height: 147mm
|
||||||
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
margin-bottom: -20;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="A5 landscape">
|
||||||
|
{{ range .Runners }}
|
||||||
|
<div class="sheet">
|
||||||
|
<img id="header_img" width="100%" src="data:image/png;base64,{{ $.SponsoringHeader}}" />
|
||||||
|
<div style=" padding: 0 1rem 0 1rem;">
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-10">
|
||||||
|
<div class="columns" style="padding-bottom: 0;">
|
||||||
|
<div class="column is-two-fifths">
|
||||||
|
<p style="font-size: large; font-weight: bold;">Sponsoring contract</p>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<p style="font-size: x-small; vertical-align: revert; margin-top: auto;">Please write in BLOCK LETTERS.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p> On the occasion of the {{ $.EventName }} I/We want to support </p>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-9">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .FirstName }}
|
||||||
|
{{ .MiddleName }}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">First name</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-3">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .ID }}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">ID</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<img style="vertical-align: revert; margin-top: auto; object-fit: cover; max-height: 2cm;"
|
||||||
|
src="data:image/png;base64,{{ barcode (printf "%d" .ID) $.BarcodeFormat $.BarcodePrefix }}"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns" style="padding-top: 1rem;">
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .LastName }}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">Last Name</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;">{{ .Group.Name}}</span>
|
||||||
|
<p style="font-size: x-small; display: block;">Team/class</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style="margin-top: -0.5rem">with the amount of _____{{ $.CurrencySymbol }} per kilometer run.</p>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Last name</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-6">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">First name</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style="font-size: medium; margin-top: -0.5rem;">Address (Sponsor)</p>
|
||||||
|
<p style="font-size: x-small;">(You have to provide an address if you want a donation receipt - Donation receipts can't be issued for total donation amounts under {{ $.ReceiptMinimumAmount }}{{ $.CurrencySymbol }})</p>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-8">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Street</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-4">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">House number</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-4">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Postal code</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-8">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">City</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="columns" style="margin-top: -1rem;">
|
||||||
|
<div class="column is-7">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Location, Date</p>
|
||||||
|
</div>
|
||||||
|
<div class="column is-5">
|
||||||
|
<span style="border-bottom: 1px solid; width: 100%; display: block;"> </span>
|
||||||
|
<p style="font-size: x-small; display: block;">Signature</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style="font-size: xx-small; overflow: hidden; height: 4rem; text-align: center;">{{ $.Disclaimer }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
iVBORw0KGgoAAAANSUhEUgAAETAAAANICAYAAADu43e9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAADgrRJREFUeNrsvV+QFFW+75u6Z5vMll1THTM1Ylw8dBki+qDQYohsBVqIObPBa/jnRPggKDE+4IuI8oKbZhQd4cALivgC94YTChpn7xvhn8tVrzEBdgNzmSY2A+qJmHEwpiE2EeIu59DWbkdS77nc/GWt1WRX55+VWZnZVd2fT0RSTf+pzFy5cv3JqO9nWRYAAAAAAAAAtMzFixdL7mZTEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw1fgBRQAAAAAAAACQCSX55+LFi/7v1X1fO5dddplDMQEAQDsjQi76LAAAAAAAAAAAAAAAAAAAAAAAAAAAAABICgITAJj0HDjY3+u+9Kr/LvF9nZR+dxvQ/1m2tHczpQsAAAAAfr68fvbo11csWGBdcduCkv7/lWvXIjcBAIC2RslLtJCrRt8EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKZcRhEAwGRHCUw+yuGtn0NiAgAAAACaixcvzvQLTKJQcpPR/4vcpIlRuclll11Wp3QBAKCAfsx2Xyo//+0H3v8/vGO51x/RDwEAAAAAAAAAAAAAAAAAAAAAAAAAAACACQhMAGBScG72db0zTn3eH/bzAwf7L+aw2/5lS3vvovQ7H7XCtMPK0gAAANDimMJYYBLF9LVPjH79twtuGyM6kTGL1QiTM24BAICs+7HKoa/O2VpgsvgnM7TERObLNUoIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKJAYAIAHc252ddtdl+eVf99bsapzzcH/d6Bg/3+38uMZUt7Q9vRae+8Kvtc4m4DF+57dDNXqz3RK0yr/9YIAwMAAEAL44qZ3+zales+rly7Vl5EYFKPOg6rITrxxjVRvwsAAKD6DhF7lrZ8dnLcz/rmzLMsBFoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEMMPmr9x8neHZn78u8Mtvekj6zbqLyUk5WT5wXYVNJdNPlRv5R0OM0EFyEJD77J66fDwsH1++Ou2ufDV7lnykjp4oK6DXAM7z2vgW2283kroTh/vx4OH7Vbrd1bMmn2js2TF/S0FPyRc8vrOraUW79fAuivvfeirc6XDfzmX+D0X/XiGrNIbujqvvPd3xwZL3w8eS33cf/3n/7b+//v3f3/K/73Lpk37zyMvv/y/q3rTXGf6rRwEJv0Dh3f8p/90zQ65p9z9nQ34lV7Zpr3z6rM//Ju/Odr9d3//4n/5X6pHs9q/KuvQ+0Pan0+PHLc/+e3xTM/75jvmWzfdOT9qvzOtcy+Yv+H0xd4WUobeebh1xk5SZ3T7EfaePqSuW1LX++bMq7j7qrca8k18/p3AjE2N+yy+PMdcN1m9O007AgAAo/1887frqj0uVEihQs2Wnoe54wsr6/FFu7Nyw5pE/WBeuGMiPUeKZMtnJ725s9Qj3/UblZpkPVc3qDt6Lm+1y1weIG9MhEO+ZxaVodNn2v6c9POksPl+nvNQw3mqfJmZmFLOxRo5ZLtbXnOsqGcn9us7t1ay3u0j6zaOq5P6uVmQvET1KTIusd1xicyZEX9CknvIHnj/7dKZU3+wi9ifW78R7QAAAAAAAAAAAAAAAAAAAAAAAAAAAEwglzV/47WXtsx8befWRG8y9/ZF1rwFi7SQwck6TKcCT6NhJwk6SWjru8HBCS/Arn37JDwWGTZwXyoHPxpou4tfrXZnLjIZ2fVy5sd5xYIFXugnK5GJfGj+3X172kJkIvfOvavWtCQySXPP+jnw55HAMtV194fv/jrV+3577y8iA54iePjy+tlp3nq9uz0V8fNrpq99QurMuPvywMH+izlcxhfdbcctPXOtcrk8riynvfPqxai/a3XnEmr+8I7lUeKP0qdHjpc23PNYpie98uk1EuKNavsq1rkXbOuLX5m94ezfiMAksi4mrS+qfY5sM5rruS5PKyaQF9tnjRwqWad+NnlGCyKYkWuUIAio5SU//+0HjLYAABL064t/cnWzuGSihCW2bw7mzcPe2L6nIS45cnxKXp/3z/9r3Pg21ZglcbfcGOvGjXFmBo3jN93Q470GyHH0exUlNfHLTEaFjDLP18K6POaWAEUizzK69u4zEh/J2Hno9Bl7aOh0W59TV7ls9bhzX5O28Gl3DjoR/cXNd863tu3f7bVrGYgpG/KSPOZ2V//SE5hElWWrz3uCeOaVvU7v3Q/UgvoNkZS88McTRs8grAwlMTB5kfZg/UPLK0U8g5VnrDve/KBe9JgZAAAAAAAAAAAAAAAAAAAAAAAAAAAAxvKDtH+opSWyaqeVccipOSynQ0ztIi3RSBhFSzUifq1tV9CVYIxsS+9aoss68TVU170m1+zKtWtL7pa5yESuuWwq/FNS9SOV8MN/vO0gMpF9u5vt3k+V/vfeSiUyEXGQ5VvJPCmv79xaCqrDchxuOXnhlENfnUt9L0ecjzN97RN2grqy0N3+xeD31rvvuUPqYsDPnnO3ZzO+jCJT2XF++GsRmCT9O9laEpnoaxNW1hLc8K16nxlvbNsjApOoemdeLyW4NX1xVDC7JO1/mvbZILgyZoVpKU8J+354x3JbAlxWulBWyVjc0gmkk5d4YivkJQAA0bSTsMTXfjf6MhdPVvLb416/D0Z4c6G8EbljmrmbEBRMV/XQu+Z9c+ZJPRhTF/Ooj2pM4fj3I+NZd/xmqzm2rcfzfqlJuz0TADC4V2PvHf0MbPj8cNufk8hLZF4Qcy4TJi8RZL+y/237d5fUPDmtmDI/eYnMsWZsiizL/vfeqjz/+MOZ7lae5cpzp6BzlblwnLwEIAlSh9c/tLyQ564i5mlFDg0AAAAAAAAAAAAAAAAAAAAAAAAAAADZkUhgsnrdRk+WsGTF/V7YSD4UvPrJvkwOxCct8YJTOqTUzqsu6zBK2IejJQA4PDxstfMKutVqt/faaiCtKJGJrGYu0gv3/SvuvhwLkYml7sfUApOTg4ejRCN1CTOmEZiIFKJvzrwoMU6S4xZxycI07UpB4YWFw+eHj1rds4JkMHHSFC0yOWo1ZCZHcyhrbxXqPAJk0s6FtB+OF8gyEXnEBLesFGFgFXx1TPqdQ199Me5nIt7YdEOPlKu0NclX8BUpSx5Bt4mgIS9xEshLvL4ceQkAQDQijfjwjuW6v3ImSFgyRhyphSXe6wQFzyHRfCYTZKyvx/s6vO6Xmohgxye3GRWP5Cw1GTPeHJWaWJckhXp8iNQE2hGf8NbkXrXl2dH54fYWmNzSkJfEzQtK7dCHyP5XdN1qbd+/2/ZEJAmfHWkhY25iSpkvRpSl9M8ifsh6tzve/GBcOeixwJbPzOQlauyCKAIix5ev79yauYAnCJHyqHpdp+QBAAAAAAAAAAAAAAAAAAAAAAAAAADag0iBiXwIeN6CRdYj6zbmsgp48wrfEkDqlPCRDqPElElpaOhMW59HtXuWvNQMrpNReL0IkYm8l2xd+/bJ6tzp5AIBx9upIhM599de2lJ6befW1Pu0GqHVoP04sgp7mlV4RQrh/m2Q0GP0vUUCFFM3RFryLwl3LTKQHVLv1Krto+e1bGnv5gMH+5/N4dItPD88fFTdL83SlH4rWmDiP1fZ5H0eTHEMUeGm+k13zi9lHSJ7Y/sea+WGNaH3llsWjZWlRw6Fv0l8cKuUpl8wXO3c9gd2m5F6L/X4wzuWJ1q52/29s15IrsdprNYddf7tziV5idG56xXXRaqTRnwEADBVkPCvCCJkHFp0ALh5Dib9ufe6bQ8XBnxj+eAx0qYberyge5PUxD/ucrKu00FzPTXf9Ma/V1prS+cfXoXEBNoKLS8xvB/a/9lRtdsql8tW1LxA5kCfHjlub7jnsbY5bunjtt2524545hE+v85rHidz4OmLQ+dYSl5SyfrZ1DOv7A2TpVVEPmkyf9PiNWQREEb/e29VRL5TxLNVqdNJBNAAAAAAAAAAAAAAAAAAAAAAAAAAAABQDOMEJiIteWa29wFgvRK4s/rJvsx2OLqKqbtJKP37wWMduWJyXDheghvtvoJutdptWTGBGrVSra2+lt+rt4vI5PyqVZ5IRt5f1avMRCbPP/6wPZHXJqnIZNbsGx0rWmARyes7twaKRrSEQgK2SWUEcb+v31uuYcj9v95qyEjSsNBtV45KmDHgvPrdrTfjS+ZJU4ZOnxEp0Jhg1IX7Hu2f9s6riY7d3f7N3V6U9zT5AxFt9M2ZF3n9RTSSdTBZVta2NlhRkpq69fdLSpHBrxmbIttSl5K0HUmYvvaJ2LZNv3fcKtNSj3/47q8lqCUrd8+0DIPmEkbz2qXZvylZ516wclu5O09EXhIRrAsrUymzNNIjAICpgIyp+ub0yKvxuDqD+ZcObnub9N+f/Pa4149nLTeDyU9QH7/phh5r0Y9nlJSUx5tX5X0c6t5xVP1GXgJth6FQ0XtG1u7PjrrK5Vj5re5rtBSrHbj5zvnWtv279dww0bMiNZ+ruHOibKWUIviMmQPLM6ms5Q/yrFeeKwVct0qU1LN5DKPaeeQlENgGFPU8Verzjjc/qCPSAQAAAAAAAAAAAAAAAAAAAAAAAAAAaE/GCUzm3b74bB47UsFvS0tLshRZFI2E42U13bAPSuvgRjuvoOsLoERJWBpBRwlrCFf/0ramL66IyMQ00N4kMqlIiCdLkYkE1WQTCUbX3n0ldcypw6C+4y2J1OO1nVsn9Do1i0x6734gsNyVcCh1SODk4GHveoeUW33xT64uJRWYCPI3UpYRoYK6ey+VAgKH/2I1RB5pWei+51Fdj5vOa8DKXmDi7XP4/PBRq3tWVtKUp9RmJDKJKmv5npL8ZIoOPUfUHccLZ4XJO2Tl6QjRiBxzGsGVSVhQ3ts0qCXIitQSzu2bM0/aQKOgjCp3KYOKF1TTbWlHdHSLG1uCcJoKv9lSVgAAMB4J/X54x3LLine truncated
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 225 KiB |
@@ -0,0 +1,41 @@
|
|||||||
|
package templates
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "embed"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed card/en.html
|
||||||
|
var CardTemplateEn string
|
||||||
|
|
||||||
|
//go:embed card/de.html
|
||||||
|
var CardTemplateDe string
|
||||||
|
|
||||||
|
//go:embed contract/en.html
|
||||||
|
var ContractTemplateEn string
|
||||||
|
|
||||||
|
//go:embed contract/de.html
|
||||||
|
var ContractTemplateDe string
|
||||||
|
|
||||||
|
//go:embed images/sponsoringheader.base64
|
||||||
|
var ImageSponsoringHeaderBase64 string
|
||||||
|
|
||||||
|
func GetTemplate(locale, templateName string) (string, error) {
|
||||||
|
switch templateName {
|
||||||
|
case "card":
|
||||||
|
switch locale {
|
||||||
|
case "en":
|
||||||
|
return CardTemplateEn, nil
|
||||||
|
case "de":
|
||||||
|
return CardTemplateDe, nil
|
||||||
|
}
|
||||||
|
case "contract":
|
||||||
|
switch locale {
|
||||||
|
case "en":
|
||||||
|
return ContractTemplateEn, nil
|
||||||
|
case "de":
|
||||||
|
return ContractTemplateDe, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "", fmt.Errorf("template not found with name %s and locale %s", templateName, locale)
|
||||||
|
}
|
||||||
Reference in new issue
Block a user