Persist removes the expiration time of a key
(key string)
| 362 | |
| 363 | // Persist removes the expiration time of a key |
| 364 | func (s *StringStructure) Persist(key string) error { |
| 365 | // Get the value |
| 366 | value, err := s.Get(key) |
| 367 | if err != nil { |
| 368 | return err |
| 369 | } |
| 370 | |
| 371 | // Set the value |
| 372 | return s.Set(key, value, 0) |
| 373 | } |
| 374 | |
| 375 | // TTL returns the time to live of a key |
| 376 | func (s *StringStructure) TTL(key string) (int64, error) { |