Method
PEXPIREBYAT
(key string, timestamp int64, tag ...string)
Source from the content-addressed store, hash-verified
| 122 | } |
| 123 | |
| 124 | func (ek *ExpireStructure) PEXPIREBYAT(key string, timestamp int64, tag ...string) error { |
| 125 | if len(tag) == 0 { |
| 126 | return ek.setExpireToDB(key, timestamp) |
| 127 | } else if len(tag) == 1 && tag[0] == "ex" { |
| 128 | return ek.setExpireToDB(key, ek.getCurrentMiliUnixTimeStamp()+timestamp) |
| 129 | } else { |
| 130 | return ErrInvalidArgs |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func (ek *ExpireStructure) getCurrentMiliUnixTimeStamp() int64 { |
| 135 | now := time.Now() |