Documentation ¶
Index ¶
- Constants
- Variables
- func AddSyncDataTask(params []byte)
- func Del(key []byte)
- func Get(key []byte) []byte
- func GetByHash(id *utils.Multihash) []byte
- func Hash(key []byte) *utils.Multihash
- func Init()
- func Register()
- func Save(cd *CacheData)
- func SyncCacheDataToQuarterLogicIds(cachedata *CacheData) error
- func SyncDataToQuarterLogicIds(khash *utils.Multihash) error
- func TimingSynchronization(hash []byte)
- func UpTime()
- type Cache
- func (c *Cache) Del(key []byte)
- func (c *Cache) Get(key []byte) []byte
- func (c *Cache) GetByHash(id *utils.Multihash) []byte
- func (c *Cache) GetCacheData(key []byte) *CacheData
- func (c *Cache) GetCacheDataByHash(id *utils.Multihash) *CacheData
- func (c *Cache) Save(d *CacheData)
- func (c *Cache) UpTime()
- type CacheData
Constants ¶
View Source
const ( MSGID_syncData = 2001 //数据同步 MSGID_syncData_recv = 2002 //数据同步 返回 )
View Source
const ()
Variables ¶
View Source
var ( TimeInterval = 20 //数据同步时间间隔,单位秒 TimeIntervalClearCache = 30 * time.Second //节点没有收到数据,清理Cache的时间间隔,1/4节点最近节点重新上线,则本节点将收不到数据,则清理。 TimeIntervalClearCacheData = 15 * time.Second //节点没有收到数据,清理CachedData的时间间隔,即删除数据清理 )
View Source
var (
Version = uint64(0x00)
)
Functions ¶
func SyncCacheDataToQuarterLogicIds ¶
同步数据(主要删除用)
Types ¶
type Cache ¶
存储结构
var (
Caches *Cache
)
func (*Cache) GetCacheDataByHash ¶
根据hash id 获取cachedata
Click to show internal directories.
Click to hide internal directories.