func ReadConf(filePath string) (conf *Config, err error) {
	var data []byte
	if data, err = ioutil.ReadFile(filePath); err == nil {
		conf, err = unmarshal(data)
	}
	return
}
ReadConf reads and decodes JSON from file
package goworld
import (
	"encoding/json"
	"io/ioutil"
)
type WorkMode int
const (
	Version = "0.9"
	UnknownMode WorkMode = iota
	NormalMode
	TestMode
)
var modes = map[WorkMode]string{NormalMode: "normal", TestMode: "test"}
func (w WorkMode) String() string {
	return modes[w]
}
func WorkModeFromString(mode string) WorkMode {
	for val, m := range modes {
		if m == mode {
			return val
		}
	}
	return UnknownMode
}
type ServerConf struct {
	Port      int
	Protocols []*ProtocolConf
}
type WorkerConf struct {
	Host string
	Name string
	Port int
}
type ParameterConf struct {
	Name string
	Type string
}
type ProtocolConf struct {
	Name    string
	Enabled bool
	Params  []*ParameterConf
	Results []*ParameterConf
}
type Config struct {
	Server  ServerConf
	Workers []*WorkerConf
}
func (c Config) GetProtocolDef(name string) *ProtocolConf {
	for _, prot := range c.Server.Protocols {
		if prot.Name == name {
			return prot
		}
	}
	return nil
}
func (c Config) GetWorkerDef(name string) *WorkerConf {
	for _, worker := range c.Workers {
		if worker.Name == name {
			return worker
		}
	}
	return nil
}