예제 #1
0
// SetString sets the guestinfo.KEY with the string VALUE
func (c *Config) SetString(key string, value string) error {
	_, _, err := rpcout.SendOne("info-set guestinfo.%s %s", key, value)
	if err != nil {
		return err
	}
	return nil
}
예제 #2
0
// GetString returns the config string in the guestinfo.* namespace
func (c *Config) GetString(key string, defaultValue string) (string, error) {
	out, ok, err := rpcout.SendOne("info-get guestinfo.%s", key)
	if err != nil {
		return "", err
	} else if !ok {
		return defaultValue, nil
	}
	return string(out), nil
}