rediscache

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

README





保存所有配置信息 及
多语言提示信息 注:不包含多语言 字段,按钮信息,但菜单可以包含进去

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCache

func CheckCache(userid string) error

func CheckCacheSQL

func CheckCacheSQL(session *xorm.Session, userid string, v *Result) (err error)

检查缓存SQL ,避免刷新后造成缓存异常, 例如:发布后,但数据库未更新表结构,刷新缓存! 造成部门缓存全部失效! 造成生成快捷付款单据生成时付款单异常,数据混乱 且恢复困难 !

func CheckIsCanClearHistorCache

func CheckIsCanClearHistorCache(enterpriseID string, dbIndex int) bool

根据时间检查是否可以清除历史缓存

func ClearHistoryVerCache

func ClearHistoryVerCache(enterpriseID string, beginClearCacheVer int) bool

清除历史版本失效缓存 异步清除某企业1小时以前的历史缓存 beginClearCacheVer 表示开始清除的版本号 需要用当前版本减1

func DelCache

func DelCache(key string) bool

DelCache 删除缓存

func GetCacheVerID

func GetCacheVerID(enterpriseID string) (dbIndex int, cacheVer int)

版本ID,DB库索引

func GetHashMap

func GetHashMap(key string) map[string]string

获取HashMap对象

func GetLanguageText

func GetLanguageText(sourceObjID string, languageCode string, sourceDetailID string) (result string)

func GetList

func GetList(key string) []string

获取String对象

func GetListMap

func GetListMap(key string) []map[string]string

获取listMap对象

func GetString

func GetString(key string) string

获取String对象

func LoadRedisCache

func LoadRedisCache(userid string) (err error)

加载xml中SQL语句查询数据到redis缓存

func SetString

func SetString(key, val string) bool

SetString 设置String对象

func SetStringExpire

func SetStringExpire(key, val string, timeout int) (b bool)

SetStringExpire 设置String对象 timeout :time.Second 秒

func UpdateFlagTheRuning

func UpdateFlagTheRuning()

Types

type Result

type Result struct {
	XMLName xml.Name `xml:"CacheInfo"`
	Cache   []StrCache
}

type StrCache

type StrCache struct {
	DBname string `xml:"DBname,attr"`
	Name   string `xml:"Name,attr"`
	Type   string `xml:"Type,attr"`

	KeyField       string `xml:"KeyField,attr"`
	GroupField     string `xml:"GroupField,attr"`
	HashKeyPreName string `xml:"HashKeyPreName,attr"`
	Memo           string `xml:"Memo,attr"`
	QuerySql       string `xml:"QuerySql"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL