dashboard/dao/dadis/unisd/datacenter.go

18 lines
387 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package unisd
import (
"dashboard/pkg/dadis"
"time"
)
// 保留作为共享数据库比如controller和service公共数据或者全局数据
var unisDataCenter = dadis.NewDadis()
func UnisDataSet(key string, value interface{}, expire time.Duration) {
unisDataCenter.Set(key, value, expire)
}
func UnisDataGet(key string) (interface{}, bool) {
return unisDataCenter.Get(key)
}