Skip to content

Server for GoTral, Encrypted Golang Centralized Configuration management

License

Notifications You must be signed in to change notification settings

codenoid/GoTral-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoTral Server

Server for gotral library

Adding Your Config Data

  1. Read server.go and config folder

Usage

  1. clone and run the server !
$ git clone  https://github.com/codenoid/GoTral-Server.git
$ cd GoTral-Server
// edit some config / do what you want
$ go run server.go
starting to listen on :8080
  1. accessing the data
package main

import (
	"fmt"

	"github.com/codenoid/gotral"
)

func main() {

	// super secret key
	secret := "somehardpw" // or just put string in there

	config, err := gotral.DirectLoad("http://localhost:8080/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:8080/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)
 	}
}

About

Server for GoTral, Encrypted Golang Centralized Configuration management

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages