https://github.com/aacfactory/configures
File configures for Golang
https://github.com/aacfactory/configures
config
Last synced: 5 months ago
JSON representation
File configures for Golang
- Host: GitHub
- URL: https://github.com/aacfactory/configures
- Owner: aacfactory
- License: apache-2.0
- Created: 2021-08-23T13:24:35.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-15T23:31:11.000Z (over 2 years ago)
- Last Synced: 2024-01-16T05:07:00.940Z (over 2 years ago)
- Topics: config
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Configures
Configures for Golang
## Features
* Open
* Multi environment support。
* Json
* Yaml
## Install
```go
go get github.com/aacfactory/configures
```
## Usage
```go
path, err := filepath.Abs("./_example/json")
if err != nil {
// handle error
return
}
store := configures.NewFileStore(path, "app", '.')
retriever, retrieverErr := configures.NewRetriever(configures.RetrieverOption{
Active: "dev",
Format: "JSON",
Store: store,
})
if retrieverErr != nil {
// handle error
return
}
config, configErr := retriever.Get()
if configErr != nil {
// handle error
return
}
```