func (r redisRepo) FetchByHash(h string, v interface{}) (interface{}, error) {
	// v needs to be a pointer
	rv := reflect.ValueOf(v)
	if rv.Kind() != reflect.Ptr {
		return nil, errNeedsPointerValue
	}

	items, err := r.client.SMembers(r.context, r.createRedisKey(h))
	if err != nil {
		return nil, errKeyNotFound
	}

	var keys []interface{}

	ve := reflect.TypeOf(v).Elem()
	for _, item := range items {
		// Create a new item based on the structure of v
		newItem := reflect.New(ve).Interface()

		err := r.Fetch(item, &newItem)
		if err != nil {
			continue
		}

		keys = append(keys, newItem)
	}

	return keys, nil
}
// FetchByHash will retrieve all keys for the given account
FetchByHash will retrieve all keys for the given account
// FetchByHash will retrieve all keys for the given account
func (r redisRepo) FetchByHash(h string, v interface{}) (interface{}, error) {
	rv := reflect.ValueOf(v)
	if rv.Kind() != reflect.Ptr {
		return nil, errNeedsPointerValue
	}
	items, err := r.client.SMembers(r.context, r.createRedisKey(h))
	if err != nil {
		return nil, errKeyNotFound
	}
	var keys []interface{}
	ve := reflect.TypeOf(v).Elem()
	for _, item := range items {
		newItem := reflect.New(ve).Interface()
		err := r.Fetch(item, &newItem)
		if err != nil {
			continue
		}
		keys = append(keys, newItem)
	}
	return keys, nil
}
func ( r redisRepo ) FetchByHash ( h string , v interface { } ) ( interface { } , error ) { rv := reflect . ValueOf ( v ) if rv . Kind ( ) != reflect . Ptr { return nil , errNeedsPointerValue } items , err := r . client . SMembers ( r . context , r . createRedisKey ( h ) ) if err != nil { return nil , errKeyNotFound } var keys [ ] interface { } ve := reflect . TypeOf ( v ) . Elem ( ) for _ , item := range items { newItem := reflect . New ( ve ) . Interface ( ) err := r . Fetch ( item , & newItem ) if err != nil { continue } keys = append ( keys , newItem ) } return keys , nil }
FetchByHash will retrieve all keys for the given account
FetchByHash will retrieve all keys for the given account
// v needs to be a pointer // Create a new item based on the structure of v