github.com/zhongdalu/gf@v1.0.0/g/os/gcache/gcache_mem_cache_item.go (about)

     1  // Copyright 2018 gf Author(https://github.com/zhongdalu/gf). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/zhongdalu/gf.
     6  
     7  package gcache
     8  
     9  import "github.com/zhongdalu/gf/g/os/gtime"
    10  
    11  // IsExpired checks whether <item> is expired.
    12  func (item *memCacheItem) IsExpired() bool {
    13  	// Note that it should use greater than or equal judgement here
    14  	// imagining that the cache time is only 1 millisecond.
    15  	if item.e >= gtime.Millisecond() {
    16  		return false
    17  	}
    18  	return true
    19  }