summaryrefslogtreecommitdiff
path: root/config
diff options
from:
to:
context:
space:
mode:
authorGravatar SayaAndy <saya.andy@posteo.com> 2025-09-03 22:22:44 +0700
committerGravatar SayaAndy <saya.andy@posteo.com> 2025-09-03 22:22:44 +0700
commit01e74276577b46dcebb8917f6d23ec150a70ad70 (patch)
treed56610b8d6dd99fac17122c463a7b663039db38b /config
parent007368ef290d935312a5cd2883b07cc53c38cea3 (diff)
downloadarticlator-01e74276577b46dcebb8917f6d23ec150a70ad70.tar.gz
articlator-01e74276577b46dcebb8917f6d23ec150a70ad70.zip
feat: new draft and prod mode
Diffstat (limited to 'config')
-rw-r--r--config/config.go14
-rw-r--r--config/config.json8
2 files changed, 18 insertions, 4 deletions
diff --git a/config/config.go b/config/config.go
index 515047e..b41be13 100644
--- a/config/config.go
+++ b/config/config.go
@@ -10,9 +10,17 @@ import (
)
type Config struct {
- LogLevel slog.Level `json:"LogLevel" validate:"required"`
- Storage StorageConfig `json:"Storage" validate:"required"`
- MaxConcurrentJobs int `json:"MaxConcurrentJobs" validate:"required,min=1"`
+ LogLevel slog.Level `json:"LogLevel" validate:"required"`
+ MaxConcurrentJobs int `json:"MaxConcurrentJobs" validate:"required,min=1"`
+ DraftMode DraftModeConfig `json:"DraftMode"`
+ Storage StorageConfig `json:"Storage" validate:"required"`
+}
+
+type DraftModeConfig struct {
+ Enabled bool `json:"Enabled" validate:"required"`
+ DraftSuffix string `json:"DraftSuffix" validate:"required_if=Enabled true"`
+ ProdSuffix string `json:"ProdSuffix" validate:"required_if=Enabled true"`
+ UpdateAlways bool `json:"UpdateAlways"`
}
type StorageConfig struct {
diff --git a/config/config.json b/config/config.json
index a48f0ff..985dd55 100644
--- a/config/config.json
+++ b/config/config.json
@@ -1,6 +1,12 @@
{
"LogLevel": "debug",
- "MaxConcurrentJobs": 8,
+ "MaxConcurrentJobs": 10,
+ "DraftMode": {
+ "Enabled": true,
+ "DraftSuffix": ".draft.md",
+ "ProdSuffix": ".md",
+ "UpdateAlways": false
+ },
"Storage": {
"Type": "b2",
"Config": {