Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codenoid/GoTral
Golang Centralized Configuration management (LIBRARY)
https://github.com/codenoid/GoTral
centralized-configuration configuration-management golang-library hacktoberfest hacktoberfest2019
Last synced: about 1 month ago
JSON representation
Golang Centralized Configuration management (LIBRARY)
- Host: GitHub
- URL: https://github.com/codenoid/GoTral
- Owner: codenoid
- License: mit
- Created: 2019-10-23T15:53:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T09:50:39.000Z (about 5 years ago)
- Last Synced: 2024-11-01T17:51:40.357Z (about 1 month ago)
- Topics: centralized-configuration, configuration-management, golang-library, hacktoberfest, hacktoberfest2019
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-indo-projects - GoTral - Go cenTralized config, for distributed software. (Go)
- awesome-indonesia-repo - GoTral - Go cenTralized config, for distributed software. (Go)
README
# GoTral [![Go Report Card](https://goreportcard.com/badge/github.com/codenoid/GoTral)](https://goreportcard.com/report/github.com/codenoid/GoTral)
Encrypted Golang Centralized Configuration management
## Feature
- E2E Encryption (via http/s)
- Basic auth support
- Multiple config file in single server
- Easy to use, simple API and return as map[string]string
- ....and more (/next update)## Setup & Install
Make sure you already have [GoTral server](https://github.com/codenoid/GoTral-Server) up
For the library just like usual way
```
go get -u github.com/codenoid/gotral
```## Example Usage
```
package mainimport (
"fmt""github.com/codenoid/gotral"
)func main() {
// super secret key
secret := "somehardpw" // or just put string in thereconfig, err := gotral.DirectLoad("http://localhost:6969/config?id=ecommerce.json", secret)
if err != nil { fmt.Println(err) }
if val, err := config.Get("mysql_username"); !err {
fmt.Println(val)
}// with basic auth support
withOpt := gotral.GoTral{
Url: "http://localhost:6969/config?id=ecommerce.json",
Passphrase: "somehardpw",
BasicAuth: true,
Username: "guest",
Password: "guest",
}config, err = withOpt.LoadConfig()
if err != nil { fmt.Println(err) }
if val, err := config.Get("mysql_username"); !err {
fmt.Println(val)
}
}
```