blob: 8529fb09b1f5f015cf6dd6ad9410c437fc68f61e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
* Theory of config
* Make the defaults the same everywhere
* There are two types of config files:
1) A super simple ENV key:value file (config.proto defined in this package)
2) A application defined <appname>.proto (.proto wherever you want to put it)
* 1) Basic application config.proto information
the application config.proto is loaded from, in order:
/usr/share/doc/appname/config.text
/etc/default/appname
~/.config/appname/config.text
These files ONLY HAVE ENV LIKE KEY/VALUE Pairs
* 2) application specific protobuf files
Application config files are always located in the same place
with the same name by default.
For the application "forge" using forge.proto
~/.config/forge/forge.text
To override these defaults, set the values in the 1) protobuf
* notes from the code
```
// Because you followed autogenpb's advice (you did follow it right?) you now
// win the automation lottery.
//
// for this .proto file, GetProtobufName(pb) returns "repos"
// Then, ConfigLoad(), ConfigSave(), CacheLoad() and CacheSave()
// all do exactly what is expected:
//
// Automatically work with the files:
// ~/.config/<appname>/repos.pb
// or
// ~/.cache/<appname/repos.pb
//
// message Repos {
// string uuid = 1;
// string version = 2;
// repeated Repo repos = 3;
```
|