func (m *Map) Hit(key string, ttlsec int32) (count uint64, remttl int32, err error) {
	m.m.Lock()
	defer m.m.Unlock()
	v, ok := m.s[key]
	if !ok {
		m.s[key] = &rldata{
			Count:  1,
			Expire: time.Now().Add(time.Duration(ttlsec) * time.Second),
		}
		return 1, ttlsec, nil
	}
	v.Count++
	rttl := v.Expire.Sub(time.Now()).Seconds()
	if rttl < 1 {
		return v.Count, 0, nil
	}
	return v.Count, int32(rttl), nil
}
// Hit implements the httprl.Backend interface.
Hit implements the httprl.Backend interface.
// Hit implements the httprl . Backend interface .
func (m *Map) Hit(key string, ttlsec int32) (count uint64, remttl int32, err error) {
	m.m.Lock()
	defer m.m.Unlock()
	v, ok := m.s[key]
	if !ok {
		m.s[key] = &rldata{
			Count:  1,
			Expire: time.Now().Add(time.Duration(ttlsec) * time.Second),
		}
		return 1, ttlsec, nil
	}
	v.Count++
	rttl := v.Expire.Sub(time.Now()).Seconds()
	if rttl < 1 {
		return v.Count, 0, nil
	}
	return v.Count, int32(rttl), nil
}
func ( m * Map ) Hit ( key string , ttlsec int32 ) ( count uint64 , remttl int32 , err error ) { m . m . Lock ( ) defer m . m . Unlock ( ) v , ok := m . s [ key ] if ! ok { m . s [ key ] = & rldata { Count : 1 , Expire : time . Now ( ) . Add ( time . Duration ( ttlsec ) * time . Second ) , } return 1 , ttlsec , nil } v . Count ++ rttl := v . Expire . Sub ( time . Now ( ) ) . Seconds ( ) if rttl < 1 { return v . Count , 0 , nil } return v . Count , int32 ( rttl ) , nil }
Hit implements the httprl.Backend interface.
Hit implements the httprl . Backend interface .