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
49
vendor/github.com/magiconair/properties/README.md
generated
vendored
49
vendor/github.com/magiconair/properties/README.md
generated
vendored
|
@ -1,16 +1,15 @@
|
|||
Overview [](https://travis-ci.org/magiconair/properties)
|
||||
========
|
||||
|
||||
#### Current version: 1.6.0
|
||||
#### Current version: 1.7.2
|
||||
|
||||
properties is a Go library for reading and writing properties files.
|
||||
|
||||
It supports reading from multiple files and Spring style recursive property
|
||||
expansion of expressions like `${key}` to their corresponding value.
|
||||
Value expressions can refer to other keys like in `${key}` or to
|
||||
environment variables like in `${USER}`.
|
||||
Filenames can also contain environment variables like in
|
||||
`/home/${USER}/myapp.properties`.
|
||||
It supports reading from multiple files or URLs and Spring style recursive
|
||||
property expansion of expressions like `${key}` to their corresponding value.
|
||||
Value expressions can refer to other keys like in `${key}` or to environment
|
||||
variables like in `${USER}`. Filenames can also contain environment variables
|
||||
like in `/home/${USER}/myapp.properties`.
|
||||
|
||||
Properties can be decoded into structs, maps, arrays and values through
|
||||
struct tags.
|
||||
|
@ -26,6 +25,8 @@ changed from `panic` to `log.Fatal` but this is configurable and custom
|
|||
error handling functions can be provided. See the package documentation for
|
||||
details.
|
||||
|
||||
Read the full documentation on [GoDoc](https://godoc.org/github.com/magiconair/properties) [](https://godoc.org/github.com/magiconair/properties)
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
|
||||
|
@ -36,13 +37,38 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
// init from a file
|
||||
p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8)
|
||||
|
||||
// via getters
|
||||
// or multiple files
|
||||
p = properties.MustLoadFiles([]string{
|
||||
"${HOME}/config.properties",
|
||||
"${HOME}/config-${USER}.properties",
|
||||
}, properties.UTF8, true)
|
||||
|
||||
// or from a map
|
||||
p = properties.LoadMap(map[string]string{"key": "value", "abc": "def"})
|
||||
|
||||
// or from a string
|
||||
p = properties.MustLoadString("key=value\nabc=def")
|
||||
|
||||
// or from a URL
|
||||
p = properties.MustLoadURL("http://host/path")
|
||||
|
||||
// or from multiple URLs
|
||||
p = properties.MustLoadURL([]string{
|
||||
"http://host/config",
|
||||
"http://host/config-${USER}",
|
||||
}, true)
|
||||
|
||||
// or from flags
|
||||
p.MustFlag(flag.CommandLine)
|
||||
|
||||
// get values through getters
|
||||
host := p.MustGetString("host")
|
||||
port := p.GetInt("port", 8080)
|
||||
|
||||
// or via decode
|
||||
// or through Decode
|
||||
type Config struct {
|
||||
Host string `properties:"host"`
|
||||
Port int `properties:"port,default=9000"`
|
||||
|
@ -53,15 +79,10 @@ func main() {
|
|||
if err := p.Decode(&cfg); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// or via flags
|
||||
p.MustFlag(flag.CommandLine)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Read the full documentation on [GoDoc](https://godoc.org/github.com/magiconair/properties) [](https://godoc.org/github.com/magiconair/properties)
|
||||
|
||||
Installation and Upgrade
|
||||
------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue