Upgrade server dependencies, manage them with govendor
This commit is contained in:
parent
ebee2746d6
commit
971278e7e5
1748 changed files with 196165 additions and 194500 deletions
35
vendor/github.com/spf13/viper/README.md
generated
vendored
35
vendor/github.com/spf13/viper/README.md
generated
vendored
|
@ -10,9 +10,9 @@ Many Go projects are built using Viper including:
|
|||
* [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack)
|
||||
* [Docker Notary](https://github.com/docker/Notary)
|
||||
* [BloomApi](https://www.bloomapi.com/)
|
||||
* [DOIt](https://github.com/bryanl/doit)
|
||||
* [doctl](https://github.com/digitalocean/doctl)
|
||||
|
||||
[](https://travis-ci.org/spf13/viper) [](https://gitter.im/spf13/viper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://travis-ci.org/spf13/viper) [](https://gitter.im/spf13/viper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://godoc.org/github.com/spf13/viper)
|
||||
|
||||
|
||||
## What is Viper?
|
||||
|
@ -110,7 +110,7 @@ Gone are the days of needing to restart a server to have a config take effect,
|
|||
viper powered applications can read an update to a config file while running and
|
||||
not miss a beat.
|
||||
|
||||
Simply tell the viper instance to watchConfig.
|
||||
Simply tell the viper instance to watchConfig.
|
||||
Optionally you can provide a function for Viper to run each time a change occurs.
|
||||
|
||||
**Make sure you add all of the configPaths prior to calling `WatchConfig()`**
|
||||
|
@ -277,10 +277,10 @@ Viper provides two Go interfaces to bind other flag systems if you don't use `Pf
|
|||
|
||||
```go
|
||||
type myFlag struct {}
|
||||
func (f myFlag) IsChanged() { return false }
|
||||
func (f myFlag) Name() { return "my-flag-name" }
|
||||
func (f myFlag) ValueString() { return "my-flag-value" }
|
||||
func (f myFlag) ValueType() { return "string" }
|
||||
func (f myFlag) HasChanged() bool { return false }
|
||||
func (f myFlag) Name() string { return "my-flag-name" }
|
||||
func (f myFlag) ValueString() string { return "my-flag-value" }
|
||||
func (f myFlag) ValueType() string { return "string" }
|
||||
```
|
||||
|
||||
Once your flag implements this interface, you can simply tell Viper to bind it:
|
||||
|
@ -298,7 +298,7 @@ type myFlagSet struct {
|
|||
|
||||
func (f myFlagSet) VisitAll(fn func(FlagValue)) {
|
||||
for _, flag := range flags {
|
||||
fn(flag)
|
||||
fn(flag)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -458,16 +458,17 @@ Viper can access a nested field by passing a `.` delimited path of keys:
|
|||
GetString("datastore.metric.host") // (returns "127.0.0.1")
|
||||
```
|
||||
|
||||
This obeys the precedence rules established above; the search for the root key
|
||||
(in this example, `datastore`) will cascade through the remaining configuration
|
||||
registries until found. The search for the sub-keys (`metric` and `host`),
|
||||
however, will not.
|
||||
This obeys the precedence rules established above; the search for the path
|
||||
will cascade through the remaining configuration registries until found.
|
||||
|
||||
For example, if the `metric` key was not defined in the configuration loaded
|
||||
from file, but was defined in the defaults, Viper would return the zero value.
|
||||
For example, given this configuration file, both `datastore.metric.host` and
|
||||
`datastore.metric.port` are already defined (and may be overridden). If in addition
|
||||
`datastore.metric.protocol` was defined in the defaults, Viper would also find it.
|
||||
|
||||
On the other hand, if the primary key was not defined, Viper would go through
|
||||
the remaining registries looking for it.
|
||||
However, if `datastore.metric` was overridden (by a flag, an environment variable,
|
||||
the `Set()` method, …) with an immediate value, then all sub-keys of
|
||||
`datastore.metric` become undefined, they are “shadowed” by the higher-priority
|
||||
configuration level.
|
||||
|
||||
Lastly, if there exists a key that matches the delimited key path, its value
|
||||
will be returned instead. E.g.
|
||||
|
@ -491,7 +492,7 @@ will be returned instead. E.g.
|
|||
}
|
||||
}
|
||||
|
||||
GetString("datastore.metric.host") //returns "0.0.0.0"
|
||||
GetString("datastore.metric.host") // returns "0.0.0.0"
|
||||
```
|
||||
|
||||
### Extract sub-tree
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue