func ParseConfigParams(configPath string, section string, params *gwp_context.ModParams) (error) {
        c, err := goconf.ReadConfigFile(configPath)
        if err != nil {
                return err
        }
	haveSection := false
	if ok := c.HasSection(section); ok {
		haveSection = true
	}
	for _,p := range *params {
		if p == nil {
			continue
		}
		if !haveSection {
			if p.Must {
				return errors.New("Config file error, mandatory parameter " + p.Name +" is missing.")
			}
			p.Value = p.Default
			continue
		}
		var val interface{}
		switch p.Type {
		case gwp_context.TypeInt:
			val, err = c.GetInt(section, p.Name)
		case gwp_context.TypeStr:
			val, err = c.GetString(section, p.Name)
		case gwp_context.TypeBool:
			val, err = c.GetBool(section, p.Name)
		case gwp_context.TypeFloat64:
			val, err = c.GetFloat64(section, p.Name)
		default:
			return errors.New("Invalid parameter type")
		}
		if err != nil {
			if p.Must {
				return errors.New("Config file error, " + err.Error())
			}
			p.Value = p.Default
			continue
		}
		p.Value = val
	}
	return nil	
}
ParseConfigParams parses module specific config file parameters
package gwp_core
import (
	"errors"
	"os"
	"strings"
	"github.com/scyth/go-webproject/gwp/libs/goconf"
        "github.com/scyth/go-webproject/gwp/libs/inotify"
	"github.com/scyth/go-webproject/gwp/gwp_context"
)
const (
	dflt_conf_addr    = "127.0.0.1:8000"
	dflt_conf_mux     = true
	dflt_conf_tmpdir  = "/tmp/"
	dflt_conf_livetpl = false
)
func ParseConfig(configPath string) (*gwp_context.AppConfig, error) {
	ac := gwp_context.NewAppConfig()
	c, err := goconf.ReadConfigFile(configPath)
	if err != nil {
		return nil, err
	}
	conf_addr, err := c.GetString("default", "listen")
	if err != nil {
		conf_addr = dflt_conf_addr
	}
	conf_mux, err := c.GetBool("default", "gorilla-mux")
	if err != nil {
		conf_mux = dflt_conf_mux
	}
	conf_root, err := c.GetString("project", "root")
	if err != nil {
		return nil, err
	}
	if !strings.HasSuffix(conf_root, "/") {
		conf_root += "/"
	}
	conf_tmpdir, err := c.GetString("project", "tmpDir")
	if err != nil {
		conf_tmpdir = dflt_conf_tmpdir
	}
	if !strings.HasSuffix(conf_tmpdir, "/") {
		conf_tmpdir += "/"
	}
	conf_template_path, err := c.GetString("project", "templatePath")
	if err != nil {
		conf_template_path = conf_root + "templates/"
	}
	if !strings.HasSuffix(conf_template_path, "/") {
		conf_template_path += "/"
	}
	conf_livetpl, err := c.GetBool("project", "live-templates")
	if err != nil {
		conf_livetpl = dflt_conf_livetpl
	}
	testpath := conf_tmpdir + "go-webproject_tmptest"
	if err := os.Mkdir(testpath, 0755); err != nil {
		return nil, errors.New("Error with tmp dir configuration: " + err.Error())
	} else {
		os.Remove(testpath)
	}
	p := strings.TrimSpace(conf_template_path)
	if _, err := os.Stat(p); err != nil {
		return nil, errors.New("Configuration error, template directory does not exist: " + conf_template_path)
	}
	ac.ListenAddr = conf_addr
	if conf_mux {
		ac.Mux = "gorilla"
	} else {
		ac.Mux = "default"
	}
	ac.ProjectRoot = conf_root
	ac.TempDir = conf_tmpdir
	ac.TemplatePath = conf_template_path
	ac.LiveTemplates = conf_livetpl
	return ac, nil
}