mirror of
https://github.com/TwiN/gatus.git
synced 2026-02-15 05:05:05 +00:00
feat: Support multiple configuration files (#396)
* Revert "Revert "feat: Support multiple configuration files" (#395)"
This reverts commit 87740e74a6.
* feat: Properly implement support for config directory
This commit is contained in:
59
vendor/github.com/TwiN/deepmerge/README.md
generated
vendored
Normal file
59
vendor/github.com/TwiN/deepmerge/README.md
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# deepmerge
|
||||

|
||||
|
||||
Go library for deep merging YAML files.
|
||||
|
||||
|
||||
## Usage
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/TwiN/deepmerge"
|
||||
)
|
||||
|
||||
func main() {
|
||||
dst := `
|
||||
debug: true
|
||||
client:
|
||||
insecure: true
|
||||
users:
|
||||
- id: 1
|
||||
firstName: John
|
||||
lastName: Doe
|
||||
- id: 2
|
||||
firstName: Jane
|
||||
lastName: Doe`
|
||||
src := `
|
||||
client:
|
||||
timeout: 5s
|
||||
users:
|
||||
- id: 3
|
||||
firstName: Bob
|
||||
lastName: Smith`
|
||||
|
||||
output, err := deepmerge.YAML([]byte(dst), []byte(src))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
println(string(output))
|
||||
}
|
||||
```
|
||||
|
||||
Output:
|
||||
```yaml
|
||||
client:
|
||||
insecure: true
|
||||
timeout: 5s
|
||||
debug: true
|
||||
users:
|
||||
- firstName: John
|
||||
id: 1
|
||||
lastName: Doe
|
||||
- firstName: Jane
|
||||
id: 2
|
||||
lastName: Doe
|
||||
- firstName: Bob
|
||||
id: 3
|
||||
lastName: Smith
|
||||
```
|
||||
Reference in New Issue
Block a user