Beispiel #1
0
func readConfig(key string) (string, error) {
	data, err := rpcvmx.NewConfig().GetString(key, "")
	if err == nil {
		log.Printf("Read from %q: %q\n", key, data)
	} else {
		log.Printf("Failed to read from %q: %v\n", key, err)
	}
	return data, err
}
Beispiel #2
0
func main() {
	if !vmcheck.IsVirtualWorld() {
		fmt.Println("not in a virtual world... :(")
		return
	}

	version, typ := vmcheck.GetVersion()
	fmt.Println(version, typ)

	config := rpcvmx.NewConfig()
	fmt.Println(config.GetString("foo", "foo"))
	fmt.Println(config.GetString("bar", "foo"))
}
Beispiel #3
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))

}