예제 #1
0
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
}
예제 #2
0
func (hash *Hash) HIncrByFloat(field string, increment float64) {
	if _, ok := hash.values[field]; !ok {
		tmp := basetype.NewString("0")
		hash.values[field] = &tmp
	}

}
예제 #3
0
// 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)
}
예제 #4
0
func (s *String) Set(str string) {
	s.value = basetype.NewString(str)
}
예제 #5
0
func NewString(value string) *String {
	val := basetype.NewString(value)
	new_string := String{value: val}
	return &new_string
}