https://github.com/pablotrianda/config
🪚 Mini tool to handle configurations saved on a yaml file an a easy way
https://github.com/pablotrianda/config
golang package yaml
Last synced: about 2 months ago
JSON representation
🪚 Mini tool to handle configurations saved on a yaml file an a easy way
- Host: GitHub
- URL: https://github.com/pablotrianda/config
- Owner: pablotrianda
- Created: 2022-08-06T00:04:12.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-11T14:00:46.000Z (about 2 years ago)
- Last Synced: 2024-11-16T14:36:07.066Z (over 1 year ago)
- Topics: golang, package, yaml
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Config 🪚
[](https://go.dev/)
[](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)
[](https://github.com/ellerbrock/open-source-badges/)
This package allow to read configurations an a easy and fast way from a `yaml` file
This mini tool have the follow actions:
* [x] Read a config file
## Installation
To install config package, you need to install Go and set your Go workspace first.
1.The first need Go installed(version 1.14+ is required), then you can use the below Go command to install config.
```
go get -u github.com/pablotrianda/config
```
2.Import it in your code:
```golang
import "github.com/pablotrianda/config"
```
## Usage example
Having a `yaml` file with this data:
```yaml
some: thing
here: goes
```
```golang
import "github.com/pablotrianda/config"
func main(){
// Load the configuration file
cfg := config.Load("to/yaml/file/conf.yaml")
// Get values
cfg.Get("some")
}
```
## Contact
You can reach me on [Twitter @pablotrianda](https://www.twitter.com/pablotrianda)