Albert Vaca Cintora
42406af567
Make AllSettings include set-but-empty keys
2022-04-20 12:38:20 +02:00
Olivier Vielpeau
1cc3fa065c
Merge pull request #19 from ganeshkumarsv/master
...
Setting up codescanning for viper
2022-02-17 18:16:57 +01:00
ganeshkumarsv
b1a41be4ef
Create codeql-analysis.yml
2022-01-04 12:32:44 -05:00
Dustin J. Mitchell
8e7459bcf3
Merge pull request #17 from DataDog/dustin.mitchell/add-ci
...
Copy CI workflows from `spf13/viper` repo
2021-07-20 11:29:30 -04:00
Dustin Mitchell
e39974a917
remove unused .travis.yml
2021-07-20 11:00:54 -04:00
Dustin Mitchell
de261e11d0
Copy CI workflows from spf13/viper
repo
...
This imports the `ci` workflow from
ab4b05adc6
with one modification noted in the file.
This omits the feedback workflows, as those are not required here. It
also omits the wasm workflow, as this old snapshot of the code does not
work in that context.
2021-07-20 09:41:35 -04:00
Kyle Nusbaum
af23aee54e
viper: support building on AIX ( #15 )
...
This commit removes the config watch feature of the library when building
on AIX. The fsnotify dependency required for this feature does not
currently compile on AIX, and we no not currently need this feature on AIX.
2020-11-12 17:14:41 -06:00
Kyle Nusbaum
7622869718
fix formatting
2020-11-11 12:28:51 -06:00
Kyle Nusbaum
943b9e6a36
viper: support building on AIX
...
This commit removes the config watch feature of the library when building
on AIX. The fsnotify dependency required for this feature does not
currently compile on AIX, and we no not currently need this feature on AIX.
2020-11-11 11:26:47 -06:00
Gabriel Aszalos
4ee0750c91
Allow setting multiple environment variables for the same key. ( #14 )
...
* Allow setting more than one env. variable into BindEnv.
* Allow setting value transformers which permit the modification of
an environment variable before being assigned to a key.
2020-09-14 11:27:04 +03:00
Cody Lee
fa4e03eaf5
Merge pull request #13 from DataDog/define-custom-install
...
define custom install to make go modules work
2020-02-27 10:44:43 -06:00
Cody Lee
bf41424e1c
add back go.sum
2020-02-27 10:38:11 -06:00
MRHwick
940e2f6b82
move travis diff call to before vendoring
2020-02-27 11:28:17 -05:00
Matthew Hardwick
8a855103ac
try excluding vendor from gofmt
2020-02-27 11:18:38 -05:00
Matthew Hardwick
7d500a2af3
bump patch for etcd
...
https://github.com/etcd-io/etcd/issues/11475
2020-02-27 10:51:42 -05:00
Matthew Hardwick
2922e4434f
Try fixing go.mod problem from ugorji/go/codec
...
https://github.com/ugorji/go/issues/299
https://github.com/ugorji/go/issues/318
https://github.com/ugorji/go/pull/319
2020-02-27 10:30:37 -05:00
Matthew Hardwick
31f45ebfd6
try build with -mod=readonly for test command
2020-02-27 09:59:02 -05:00
Cody Lee
146f689044
start the script by vendoring first
2020-02-26 17:07:36 -06:00
Cody Lee
713af2cac4
hacks from other travis users
2020-02-26 17:01:06 -06:00
Cody Lee
cfa0e76c89
define custom install to make go modules work
2020-02-26 16:56:56 -06:00
Cody Lee
6163a31d56
Merge pull request #12 from DataDog/go-mod-fix
...
Go modules fix
2020-02-26 16:45:49 -06:00
Cody Lee
69031d4075
bump to 1.14
2020-02-26 16:44:40 -06:00
Cody Lee
a4cbd30fbd
fix travis.yml so build actually works
2020-02-26 16:36:08 -06:00
Cody Lee
5b85211713
fix go.mod module definition to use the correct path
...
run `go mod tidy`
2020-02-26 16:23:04 -06:00
Albert Vaca
0d6ea091c7
Merge pull request #7 from DataDog/albertvaka/poc-config-schema
...
Enable storing a set of known valid config keys
2019-04-23 17:53:20 +02:00
Albert Vaca
e528ca4ad4
Merge pull request #8 from DataDog/albertvaka/tests-avoid-globals
...
Make tests independent from each other
2019-04-23 15:25:53 +02:00
Albert Vaca
e98778d4ec
Make tests independent from each other
...
By creating a new Viper for each test instead of using the global one
2019-04-23 13:24:20 +02:00
Albert Vaca
e8b3270767
Added test for known keys
2019-04-23 12:40:40 +02:00
Albert Vaca
ead7a65a23
Added missing global versions of SetKnown/GetKnown
...
For consistency
2019-04-23 12:40:19 +02:00
Albert Vaca
73fad7c9db
Enable storing a set of known valid config keys
...
This can be used to enforce a config schema
2019-03-29 19:08:07 +01:00
Albert Vaca
991b92b30e
Merge pull request #5 from DataDog/albertvaka/warn-duplicate-keys-no-rebased
...
Warn when a yaml file has duplicated keys
2019-03-29 18:05:23 +01:00
Albert Vaca
42a499d7ac
Warn when a yaml file has duplicated keys
...
Try using `UnmarshalStrict`, if it fails, print the errors as a warning and try again with plain `Unmarshal`.
Errors look this way:
```
2019/03/26 15:11:33 warning reading config file: yaml: unmarshal errors:
line 6: key "api_key" already set in map
```
2019-03-29 15:13:52 +01:00
Albert Vaca
10edc96e10
Merge pull request #6 from spf13/master
...
Merge changes from original repo
2019-03-29 15:12:04 +01:00
Bjørn Erik Pedersen
9e56dacc08
Remove superflous insensitiviseMaps in Unmarshal methods
...
Fixes #482
2019-03-13 10:29:51 +01:00
Xavier Lucas
59d5cbf4d7
Allow using error getters without disabling type inference ( #4 )
2019-03-05 13:27:36 +01:00
Xavier Lucas
eadb687b05
Merge pull request #3 from DataDog/xavier.lucas/get-with-errors
...
Expose type casting errors
2019-03-01 16:47:21 +01:00
Xavier Lucas
07a0f11324
Expose type casting errors
2019-02-26 15:07:04 +01:00
Olivier Vielpeau
23ced3bc6b
Merge pull request #2 from olivielpeau/allow-keydelim-mapkey
...
Fix AllSettings when some map keys contain the key delimiter
2019-02-14 18:26:07 +01:00
Olivier Vielpeau
e89dd07ee4
Fix AllSettings when some map keys contain the key delimiter
2019-02-14 14:08:51 +01:00
maxime mouial
e9c8d7a439
Merge pull request #1 from DataDog/maxime/merge-override
...
Adding a method to merge config in the override section
2019-02-13 10:36:55 -07:00
Maxime Mouial
e8d119fbb0
Adding a method to merge config in the override section
...
This allows users to set configuration that would have precedence on env
variable. This is very useful when some post-processing is done on the
configuration.
2019-02-12 14:20:58 -07:00
Mark Sagi-Kazar
d104d259b3
Update go.sum with go1.11.4
...
In Go 1.11.4 a bug was fixed related to checksum calculation.
As a result, some packages might end up with a different checksum
from this version. The solution is upgrading, cleaning the mod cache
and recalculating the go.sum file.
See https://github.com/golang/go/issues/27093
2019-01-27 10:44:59 +01:00
Bjørn Erik Pedersen
6d33b5a963
Make the map in MergeConfigMap case insensitive
2018-12-07 11:03:36 +01:00
Bjørn Erik Pedersen
41cd1c3aa3
Restrict Travis to >= Go 1.11, use Go Modules, and get the test to pass
2018-12-05 17:13:47 +01:00
Bjørn Erik Pedersen
3535c75fa8
Add MergeConfigMap
...
Fixes #605
2018-12-05 17:13:47 +01:00
Bjørn Erik Pedersen
06c7c0d9b3
Use assert.EqualValues for slice checking
2018-11-19 10:38:40 +01:00
Benoit Masson
ae103d7e59
Moved shared resources out of the loops in TestBindPFlagsStringSlice()
...
Common code and resources put out of the loops, to improve
efficiency and readability.
2018-11-07 12:08:59 +01:00
Benoit Masson
69647fb422
Fixed TestBindPFlagsStringSlice()
...
Replaced Visit() by VisitAll(), so that the Changed attribute of
the updated flag is correctly set.
2018-11-07 12:08:59 +01:00
Benoit Masson
cc7e906d88
Updated TestBindPFlagsStringSlice() to highlight a failure
...
When pflag marked as changed, the value is not detected
(and lower priority value used)
2018-11-07 12:08:59 +01:00
Márk Sági-Kazár
b7a3b95476
Lookup environment variables instead of checking if the value is empty
...
This commit adds an `AllowEmptyEnv` option that, default off, that when set will allow set, but empty, environment variables
Fixes #317
2018-11-06 22:53:21 +01:00