caches

package
v0.0.0-...-3534724 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvatarsMap = &SafeAvatarsMap{}

AvatarsMap 头像缓存对象

View Source
var ClustersMap = &SafeClustersMap{}

ClustersMap 群集缓存对象

View Source
var EdgesMap = &SafeEdgesMap{}

EdgesMap 关联缓存对象

View Source
var GlossariesMap = &SafeGlossariesMap{}

GlossariesMap 字典缓存对象

View Source
var OptionsMap = &SafeOptionsMap{}

OptionsMap 系统配置缓存对象

View Source
var RolesMap = &SafeRolesMap{M: make(map[string]*models.Role)}

RolesMap 角色缓存对象

View Source
var RulesMap = &SafeRulesMap{}

RulesMap 规则缓存对象

View Source
var StatisticsMap = &SafeStatisticsMap{}

StatisticsMap 规则缓存对象

View Source
var TemplatesMap = &SafeTemplatesMap{}

TemplatesMap 规则缓存对象

View Source
var UsersMap = &SafeUsersMap{}

UsersMap 用户缓存对象

Functions

func Init

func Init()

Init 初始化缓存

func LoopInit

func LoopInit()

LoopInit 定期刷新缓存

Types

type SafeAvatarsMap

type SafeAvatarsMap struct {
	sync.RWMutex
	M []*models.Avatar
}

SafeAvatarsMap 线程安全的数据缓存对象

func (*SafeAvatarsMap) All

func (c *SafeAvatarsMap) All() []*models.Avatar

All returns all of the slice.

func (*SafeAvatarsMap) Any

func (c *SafeAvatarsMap) Any(f func(*models.Avatar) bool) *models.Avatar

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeAvatarsMap) Count

func (c *SafeAvatarsMap) Count() int

Count 返回缓存条数

func (*SafeAvatarsMap) Filter

func (c *SafeAvatarsMap) Filter(f func(*models.Avatar) bool) (L []*models.Avatar)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeAvatarsMap) Include

func (c *SafeAvatarsMap) Include(f func(*models.Avatar) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeAvatarsMap) Init

func (c *SafeAvatarsMap) Init()

Init 缓存初始化

func (*SafeAvatarsMap) Map

func (c *SafeAvatarsMap) Map(f func(*models.Avatar) *models.Avatar) []*models.Avatar

Map returns a new slice containing the results of applying the function f to each string in the original slice.

type SafeClustersMap

type SafeClustersMap struct {
	sync.RWMutex
	M []*models.Cluster
}

SafeClustersMap 线程安全的数据缓存对象

func (*SafeClustersMap) All

func (c *SafeClustersMap) All() []*models.Cluster

All returns all of the slice.

func (*SafeClustersMap) Any

func (c *SafeClustersMap) Any(f func(*models.Cluster) bool) *models.Cluster

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeClustersMap) Append

func (c *SafeClustersMap) Append(item *models.Cluster)

Append 添加元素

func (*SafeClustersMap) Count

func (c *SafeClustersMap) Count() int

Count 返回缓存条数

func (*SafeClustersMap) Filter

func (c *SafeClustersMap) Filter(f func(*models.Cluster) bool) (L []*models.Cluster)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeClustersMap) GetPage

func (c *SafeClustersMap) GetPage(offset, limit int) (clusters []*models.Cluster)

GetPage 返回一页缓存数据

func (*SafeClustersMap) Include

func (c *SafeClustersMap) Include(f func(*models.Cluster) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeClustersMap) Init

func (c *SafeClustersMap) Init()

Init 缓存初始化

func (*SafeClustersMap) Map

func (c *SafeClustersMap) Map(f func(*models.Cluster) *models.Cluster) []*models.Cluster

Map returns a new slice containing the results of applying the function f to each string in the original slice.

func (*SafeClustersMap) Remove

func (c *SafeClustersMap) Remove(f func(*models.Cluster) bool)

Remove 删除元素,每次仅删除一个

type SafeEdgesMap

type SafeEdgesMap struct {
	sync.RWMutex
	M []*models.Edge
}

SafeEdgesMap 线程安全的数据缓存对象

func (*SafeEdgesMap) All

func (c *SafeEdgesMap) All() []*models.Edge

All returns all of the slice.

func (*SafeEdgesMap) Any

func (c *SafeEdgesMap) Any(f func(*models.Edge) bool) *models.Edge

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeEdgesMap) Count

func (c *SafeEdgesMap) Count() int

Count 返回缓存条数

func (*SafeEdgesMap) Filter

func (c *SafeEdgesMap) Filter(f func(*models.Edge) bool) (L []*models.Edge)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeEdgesMap) Include

func (c *SafeEdgesMap) Include(f func(*models.Edge) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeEdgesMap) Init

func (c *SafeEdgesMap) Init()

Init 缓存初始化

func (*SafeEdgesMap) Map

func (c *SafeEdgesMap) Map(f func(*models.Edge) *models.Edge) []*models.Edge

Map returns a new slice containing the results of applying the function f to each string in the original slice.

func (*SafeEdgesMap) Reload

func (c *SafeEdgesMap) Reload()

Reload 刷新缓存

type SafeGlossariesMap

type SafeGlossariesMap struct {
	sync.RWMutex
	M []*models.Glossary
}

SafeGlossariesMap 线程安全的数据缓存对象

func (*SafeGlossariesMap) All

func (c *SafeGlossariesMap) All() []*models.Glossary

All returns all of the slice.

func (*SafeGlossariesMap) Any

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeGlossariesMap) Count

func (c *SafeGlossariesMap) Count() int

Count 返回缓存条数

func (*SafeGlossariesMap) Filter

func (c *SafeGlossariesMap) Filter(f func(*models.Glossary) bool) (L []*models.Glossary)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeGlossariesMap) Include

func (c *SafeGlossariesMap) Include(f func(*models.Glossary) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeGlossariesMap) Init

func (c *SafeGlossariesMap) Init()

Init 缓存初始化

func (*SafeGlossariesMap) Map

Map returns a new slice containing the results of applying the function f to each string in the original slice.

type SafeOptionsMap

type SafeOptionsMap struct {
	sync.RWMutex
	M []*models.Option
}

SafeOptionsMap 线程安全的数据缓存对象

func (*SafeOptionsMap) All

func (c *SafeOptionsMap) All() []*models.Option

All returns all of the slice.

func (*SafeOptionsMap) Any

func (c *SafeOptionsMap) Any(f func(*models.Option) bool) *models.Option

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeOptionsMap) Count

func (c *SafeOptionsMap) Count() int

Count 返回缓存条数

func (*SafeOptionsMap) Filter

func (c *SafeOptionsMap) Filter(f func(*models.Option) bool) (L []*models.Option)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeOptionsMap) Include

func (c *SafeOptionsMap) Include(f func(*models.Option) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeOptionsMap) Init

func (c *SafeOptionsMap) Init()

Init 缓存初始化

func (*SafeOptionsMap) Map

func (c *SafeOptionsMap) Map(f func(*models.Option) *models.Option) []*models.Option

Map returns a new slice containing the results of applying the function f to each string in the original slice.

type SafeRolesMap

type SafeRolesMap struct {
	sync.RWMutex
	M map[string]*models.Role
}

SafeRolesMap 线程安全的数据缓存对象

func (*SafeRolesMap) All

func (c *SafeRolesMap) All() []*models.Role

All returns all of the slice.

func (*SafeRolesMap) Any

func (c *SafeRolesMap) Any(f func(*models.Role) bool) *models.Role

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeRolesMap) Count

func (c *SafeRolesMap) Count() int

Count 返回缓存条数

func (*SafeRolesMap) Filter

func (c *SafeRolesMap) Filter(f func(*models.Role) bool) (L []*models.Role)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeRolesMap) Include

func (c *SafeRolesMap) Include(f func(*models.Role) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeRolesMap) Init

func (c *SafeRolesMap) Init()

Init 缓存初始化

func (*SafeRolesMap) Map

func (c *SafeRolesMap) Map(f func(*models.Role) *models.Role) []*models.Role

Map returns a new slice containing the results of applying the function f to each string in the original slice.

type SafeRulesMap

type SafeRulesMap struct {
	sync.RWMutex
	M []*models.Rule
}

SafeRulesMap 线程安全的数据缓存对象

func (*SafeRulesMap) All

func (c *SafeRulesMap) All() []*models.Rule

All returns all of the slice.

func (*SafeRulesMap) Any

func (c *SafeRulesMap) Any(f func(*models.Rule) bool) *models.Rule

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeRulesMap) Count

func (c *SafeRulesMap) Count() int

Count 返回缓存条数

func (*SafeRulesMap) Filter

func (c *SafeRulesMap) Filter(f func(*models.Rule) bool) (L []*models.Rule)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeRulesMap) Include

func (c *SafeRulesMap) Include(f func(*models.Rule) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeRulesMap) Init

func (c *SafeRulesMap) Init()

Init 缓存初始化

func (*SafeRulesMap) Map

func (c *SafeRulesMap) Map(f func(*models.Rule) *models.Rule) []*models.Rule

Map returns a new slice containing the results of applying the function f to each string in the original slice.

type SafeStatisticsMap

type SafeStatisticsMap struct {
	sync.RWMutex
	M []*models.Statistic
}

SafeStatisticsMap 线程安全的数据缓存对象

func (*SafeStatisticsMap) All

func (c *SafeStatisticsMap) All() []*models.Statistic

All returns all of the slice.

func (*SafeStatisticsMap) Any

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeStatisticsMap) Count

func (c *SafeStatisticsMap) Count() int

Count 返回缓存条数

func (*SafeStatisticsMap) Filter

func (c *SafeStatisticsMap) Filter(f func(*models.Statistic) bool) (L []*models.Statistic)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeStatisticsMap) Include

func (c *SafeStatisticsMap) Include(f func(*models.Statistic) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeStatisticsMap) Init

func (c *SafeStatisticsMap) Init()

Init 缓存初始化

func (*SafeStatisticsMap) Map

Map returns a new slice containing the results of applying the function f to each string in the original slice.

type SafeTemplatesMap

type SafeTemplatesMap struct {
	sync.RWMutex
	M []*models.Template
}

SafeTemplatesMap 线程安全的数据缓存对象

func (*SafeTemplatesMap) All

func (c *SafeTemplatesMap) All() []*models.Template

All returns all of the slice.

func (*SafeTemplatesMap) Any

func (c *SafeTemplatesMap) Any(f func(*models.Template) bool) *models.Template

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeTemplatesMap) Count

func (c *SafeTemplatesMap) Count() int

Count 返回缓存条数

func (*SafeTemplatesMap) Filter

func (c *SafeTemplatesMap) Filter(f func(*models.Template) bool) (L []*models.Template)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeTemplatesMap) Include

func (c *SafeTemplatesMap) Include(f func(*models.Template) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeTemplatesMap) Init

func (c *SafeTemplatesMap) Init()

Init 缓存初始化

func (*SafeTemplatesMap) Map

Map returns a new slice containing the results of applying the function f to each string in the original slice.

type SafeUsersMap

type SafeUsersMap struct {
	sync.RWMutex
	M []*models.User
}

SafeUsersMap 线程安全的数据缓存对象

func (*SafeUsersMap) All

func (c *SafeUsersMap) All() []*models.User

All returns all of the slice.

func (*SafeUsersMap) Any

func (c *SafeUsersMap) Any(f func(*models.User) bool) *models.User

Any returns the element if one of the element in the sliece satisfies the predicate f.

func (*SafeUsersMap) Append

func (c *SafeUsersMap) Append(item *models.User)

Append 添加元素

func (*SafeUsersMap) Count

func (c *SafeUsersMap) Count() int

Count 返回缓存条数

func (*SafeUsersMap) Filter

func (c *SafeUsersMap) Filter(f func(*models.User) bool) (L []*models.User)

Filter returns a new slice containing all elements in the slice that satisfy the predicate f.

func (*SafeUsersMap) GetPage

func (c *SafeUsersMap) GetPage(offset, limit int) (users []*models.User)

GetPage 返回一页缓存数据

func (*SafeUsersMap) Include

func (c *SafeUsersMap) Include(f func(*models.User) bool) bool

Include returns true if one of the element in the sliece satisfies the predicate f.

func (*SafeUsersMap) Init

func (c *SafeUsersMap) Init()

Init 缓存初始化

func (*SafeUsersMap) Lookup

func (c *SafeUsersMap) Lookup(UUID string) *models.User

Lookup 根据UUID返回一个用户信息

func (*SafeUsersMap) Map

func (c *SafeUsersMap) Map(f func(*models.User) *models.User) []*models.User

Map returns a new slice containing the results of applying the function f to each string in the original slice.

Jump to

Keyboard shortcuts

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