diff options
| author | lost+skunk <[email protected]> | 2024-06-13 23:56:03 +0300 |
|---|---|---|
| committer | lost+skunk <[email protected]> | 2024-06-13 23:56:03 +0300 |
| commit | 6f872fe2f7fa2ee5cae749bdde5ad002d380b556 (patch) | |
| tree | dfa3ccbb1dc495dc37c73ba2360054dfd50cb4b0 /app/config.go | |
| download | skunky-art-6f872fe2f7fa2ee5cae749bdde5ad002d380b556.tar.gz skunky-art-6f872fe2f7fa2ee5cae749bdde5ad002d380b556.tar.bz2 skunky-art-6f872fe2f7fa2ee5cae749bdde5ad002d380b556.zip | |
альфа: работают только посты и поиск
Diffstat (limited to 'app/config.go')
| -rw-r--r-- | app/config.go | 48 |
1 files changed, 48 insertions, 0 deletions
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`) + } + } +} |
