예제 #1
0
func (p provider) FetchConfig() (config.Config, error) {
	data, err := rpcvmx.NewConfig().String("coreos.config.data", "")
	if err != nil {
		p.logger.Debug("failed to fetch config: %v", err)
		return config.Config{}, err
	}

	p.logger.Debug("config successfully fetched")
	return config.Parse([]byte(data))
}
예제 #2
0
func main() {
	if !vmcheck.IsVirtualWorld() {
		fmt.Println("not in a virtual world... :(")
		return
	}

	config := rpcvmx.NewConfig()

	fmt.Println(config.SetString("foo", "bar"))
	fmt.Println(config.String("foo", "foo"))

	fmt.Println(config.SetInt("foo", 3))
	fmt.Println(config.Int("foo", 0))

	fmt.Println(config.SetBool("foo", false))
	fmt.Println(config.Bool("foo", true))

}