From 6f872fe2f7fa2ee5cae749bdde5ad002d380b556 Mon Sep 17 00:00:00 2001 From: lost+skunk Date: Thu, 13 Jun 2024 23:56:03 +0300 Subject: альфа: работают только посты и поиск MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config.go | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 app/config.go (limited to 'app/config.go') diff --git a/app/config.go b/app/config.go new file mode 100644 index 0000000..9a5aef1 --- /dev/null +++ b/app/config.go @@ -0,0 +1,48 @@ +package app + +import ( + "os" +) + +type cache_config struct { + Enabled bool + Path string + Max_size, Lifetime int64 +} + +type config struct { + cfg string + Listen, Base_uri string + Cache cache_config + Proxy, Nsfw bool +} + +var CFG = config{ + cfg: "config.json", + Listen: "127.0.0.1:3003", + Base_uri: "/", + Cache: cache_config{ + Enabled: true, + Path: "cache", + }, + Proxy: true, + Nsfw: true, +} + +func execcfg() { + a := os.Args + for num, val := range a { + switch val { + case "-conf": + CFG.cfg = a[num] + case "-help": + println(`SkunkyArt v 1.3 [refactoring] +Usage: + - -conf - path to config + - -help this message +Example: + ./skunkyart -conf config.json +Copyright lost+skunk, X11. https://git.macaw.me/skunky/skunkyart/src/tag/v1.3`) + } + } +} -- cgit v1.2.3