Commit graph

4 commits

Author SHA1 Message Date
Andrey Odintsov
319b0fc627 Resolved merge conflicts in viper.go 2018-11-26 12:16:57 +03:00
Xavier Coulon
e0f7631cf3 WatchConfig and Kubernetes (#284)
Support override of symlink to config file
Include tests for WatchConfig of regular files, as well
as config file which links to a folder which is itself a
link to another folder in the same "watch dir" (the way
Kubernetes exposes config files from ConfigMaps mounted
on a volume in a Pod)

Also:
- Add synchronization with WaitGroup to ensure that the WatchConfig
is properly started before returning
- Remove the watcher when the Config file is removed.

Fixes #284

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
2018-01-03 10:37:18 +01:00
Bjørn Erik Pedersen
382f87b929 Remove expensive TRACE logging
Also avoid doing a strings.Split in the Get common case.

Any TRACE statements in these hot paths must be totally turned off when not testing.

```
benchmark                     old ns/op     new ns/op     delta
BenchmarkGetBool-4            4090          409           -90.00%
BenchmarkGetBoolFromMap-4     6.33          6.28          -0.79%

benchmark                     old allocs     new allocs     delta
BenchmarkGetBool-4            6              3              -50.00%
BenchmarkGetBoolFromMap-4     0              0              +0.00%

benchmark                     old bytes     new bytes     delta
BenchmarkGetBool-4            129           33            -74.42%
BenchmarkGetBoolFromMap-4     0             0             +0.00%
```

Fixes #242
2016-09-26 17:04:02 +02:00
Steve Francia
f98d9bf08b Initial commit 2014-04-02 07:33:33 -07:00