https://github.com/ultirequiem/configo
⚙️ Dead Simple Config Management, load and persist config without having to think about where and how.
https://github.com/ultirequiem/configo
configuration go golang persistent-storage
Last synced: about 1 year ago
JSON representation
⚙️ Dead Simple Config Management, load and persist config without having to think about where and how.
- Host: GitHub
- URL: https://github.com/ultirequiem/configo
- Owner: UltiRequiem
- License: mit
- Created: 2021-10-25T15:26:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-07T02:43:22.000Z (about 4 years ago)
- Last Synced: 2025-05-07T20:08:23.301Z (about 1 year ago)
- Topics: configuration, go, golang, persistent-storage
- Language: Go
- Homepage: https://pkg.go.dev/github.com/UltiRequiem/configo
- Size: 12.7 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Configo
[](https://pkg.go.dev/github.com/UltiRequiem/configo)
Dead Simple Config Management, load and persist config without having to think
about where and how.
## Install
```sh
go get github.com/UltiRequiem/configo
```
## Usage
```go
package main
import (
"fmt"
"log"
"github.com/UltiRequiem/configo"
)
func main() {
config, err := configo.NewConfig("example")
if err != nil {
log.Fatal(err)
}
// Only if you want to persist values
defer config.Save()
config.Set("awesome", 777)
fmt.Println(config.Get("awesome")) //=> 777
fmt.Println(config.Has("awesome")) //=> true
config.Delete("awesome")
fmt.Println(config.Get("awesome")) //=> nil
fmt.Println(config.Size()) //=> 0
config.Set("foo", "bar")
fmt.Println(config.Size()) //=> 1
}
```
If you already ran the code snippet from before, then this will work 👇
```go
package main
import (
"fmt"
"log"
"github.com/UltiRequiem/configo"
)
func main() {
config, err := configo.NewConfig("example")
if err != nil {
log.Fatal(err)
}
fmt.Println(config.Get("foo")) // "bar"
}
```
## Documentation
Is hosted on [pkg.go.dev](https://pkg.go.dev/github.com/UltiRequiem/configo).
## Support
Open an Issue, I will check it a soon as possible 👀
If you want to hurry me up a bit
[send me a tweet](https://twitter.com/UltiRequiem) 😆
Consider [supporting me on Patreon](https://patreon.com/UltiRequiem) if you like
my work 🙏
Don't forget to start the repo ⭐
## Licence
Licensed under the MIT License 📄