aboutsummaryrefslogblamecommitdiffstats
path: root/config/config.go
blob: 2b4dc41ebcef83b15b4ba03065b1e1b9e7fd0c50 (plain) (tree)
1
2
3
4
5
6
7
8
9








                       
                                                




                                                 
                                                   






                                            
                                                          
         

                                         
                                                   

         
package config

import (
	"encoding/json"
	"io/ioutil"
	"log"
)

type Settings struct {
	DBDriver       string `json:"db_driver"`
	DBServer       string `json:"db"`
	WebServer      string `json:"web"`
	Username       string `json:"username"`
	DigestPassword string `json:"password"`
	StaticDir      string `json:"static_dir"`
	ProxyImages    bool   `json:"proxy_images"`
}

var Config Settings

func Read(filename string) {
	file, e := ioutil.ReadFile(filename)
	if e != nil {
		log.Fatal("Can not read config file\n", e)
	}
	e = json.Unmarshal(file, &Config)
	if e != nil {
		log.Fatal("Config read error\n", e)
	}
}