示例#1
0
// NewService returns a new instance of Service.
func NewService(c *meta.Config, d *Config) *Service {
	s := &Service{
		err:     make(chan error),
		Meta:    c,
		Deployd: d,
	}
	s.Handler = NewHandler(s.Deployd)
	c.MkGlobal() //a setter for global meta config
	return s
}
示例#2
0
func (s *S) SetUpSuite(c *check.C) {
	b, e := ioutil.ReadFile("fixtures/one.json")
	c.Assert(e, check.IsNil)
	s.testjson = b
	c.Assert(s.testjson, check.NotNil)

	var cm meta.Config
	if _, err := toml.Decode(`
	riak = ["localhost:8087"]
	`, &cm); err != nil {
		c.Fatal(err)
	}
	cm.MkGlobal()
	s.cm = cm
}