https://github.com/atrox/store
Simple, painless, zero-config configuration storage
https://github.com/atrox/store
configuration configuration-management golang simple
Last synced: 10 months ago
JSON representation
Simple, painless, zero-config configuration storage
- Host: GitHub
- URL: https://github.com/atrox/store
- Owner: Atrox
- License: mit
- Created: 2017-10-10T12:42:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-11T10:27:00.000Z (over 8 years ago)
- Last Synced: 2025-02-01T05:14:02.286Z (11 months ago)
- Topics: configuration, configuration-management, golang, simple
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Store
[](https://travis-ci.org/Atrox/store)
[](https://coveralls.io/r/Atrox/store)
[](https://goreportcard.com/report/github.com/Atrox/store)
[](https://godoc.org/github.com/Atrox/store)
> Simple, painless, zero-config configuration storage
## Installation
```sh
go get -u github.com/atrox/store
# or with dep
dep ensure -add github.com/atrox/store
```
## Example
```go
package main
import (
"fmt"
"github.com/atrox/store"
)
type Config struct {
Name string `yaml:"name"`
Age int `yaml:"age"`
}
func main() {
storage, err := store.New("testapp")
if err != nil {
panic(err)
}
config := &Config{
Name: "Dr. Robert Ford",
Age: 70,
}
err = storage.Save(config)
if err != nil {
panic(err)
}
fmt.Printf("config is now saved at %s\n", storage.Path(config))
// ~/.config/testapp/config.yaml
config = &Config{}
err = storage.Get(config)
if err != nil {
panic(err)
}
fmt.Printf("Config retrieved:\n%+v\n", config)
// &{Name:Dr. Robert Ford Age:70}
}
```
## Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- [Report bugs](https://github.com/atrox/store/issues)
- Fix bugs and [submit pull requests](https://github.com/atrox/store/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features