func (hash *Hash) HSet(field string, value string) { if _, ok := hash.values[field]; !ok { hash.size += 1 } tmp := basetype.NewString(value) hash.values[field] = &tmp }
func (hash *Hash) HIncrByFloat(field string, increment float64) { if _, ok := hash.values[field]; !ok { tmp := basetype.NewString("0") hash.values[field] = &tmp } }
// increments value in a hash. attempts to coerce the value to an int func (hash *Hash) HIncrBy(field string, increment int64) (string, error) { if _, ok := hash.values[field]; !ok { tmp := basetype.NewString("0") hash.values[field] = &tmp } return hash.values[field].IncrBy(increment) }
func (s *String) Set(str string) { s.value = basetype.NewString(str) }
func NewString(value string) *String { val := basetype.NewString(value) new_string := String{value: val} return &new_string }