From 01e74276577b46dcebb8917f6d23ec150a70ad70 Mon Sep 17 00:00:00 2001 From: SayaAndy Date: Wed, 3 Sep 2025 22:22:44 +0700 Subject: feat: new draft and prod mode --- config/config.go | 14 +++++++++++--- config/config.json | 8 +++++++- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'config') 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": { -- cgit v1.3.1+13