Documentation ¶
Index ¶
- Constants
- func GetCache(entryName string) *cache.Cache
- func RegisterCacheEntryYAML(raw []byte) map[string]rkentry.Entry
- type BootCache
- type BootCacheE
- type CacheEntry
- func (entry *CacheEntry) AddToCache(req *CacheReq) *CacheResp
- func (entry *CacheEntry) Bootstrap(ctx context.Context)
- func (entry *CacheEntry) GetCache() *cache.Cache
- func (entry *CacheEntry) GetDescription() string
- func (entry *CacheEntry) GetFromCache(req *CacheReq) *CacheResp
- func (entry *CacheEntry) GetName() string
- func (entry *CacheEntry) GetType() string
- func (entry *CacheEntry) Interrupt(ctx context.Context)
- func (entry *CacheEntry) IsLocalCacheEnabled() bool
- func (entry *CacheEntry) IsRedisCacheEnabled() bool
- func (entry *CacheEntry) String() string
- type CacheReq
- type CacheResp
- type Option
Constants ¶
View Source
const CacheRedisEntry = "CacheRedisEntry"
Variables ¶
This section is empty.
Functions ¶
func GetCache ¶
func GetCache(entryName string) *cache.Cache
GetCache get cache.Cache with entryName
func RegisterCacheEntryYAML ¶
RegisterCacheEntryYAML create entry from config file
Types ¶
type BootCache ¶
type BootCache struct {
Cache []*BootCacheE `yaml:"cache" json:"cache"`
}
BootCache bootstrap entry from config
type BootCacheE ¶ added in v1.1.0
type BootCacheE struct { Name string `yaml:"name" json:"name"` Domain string `yaml:"domain" json:"domain"` Description string `yaml:"description" json:"description"` Enabled bool `yaml:"enabled" json:"enabled"` Local struct { Enabled bool `yaml:"enabled" json:"enabled"` Size int `yaml:"size" json:"size"` TtlMin int `yaml:"ttlMin" json:"ttlMin"` } `yaml:"local" json:"local"` Redis rkredis.BootRedisE `yaml:"redis" json:"redis"` LoggerEntry string `yaml:"loggerEntry" json:"loggerEntry"` CertEntry string `yaml:"certEntry" json:"certEntry"` }
type CacheEntry ¶
type CacheEntry struct {
// contains filtered or unexported fields
}
CacheEntry implementation of rkentry.Entry
func GetCacheEntry ¶
func GetCacheEntry(entryName string) *CacheEntry
func RegisterCacheEntry ¶
func RegisterCacheEntry(opts ...Option) *CacheEntry
RegisterCacheEntry register with Option
func (*CacheEntry) AddToCache ¶
func (entry *CacheEntry) AddToCache(req *CacheReq) *CacheResp
func (*CacheEntry) Bootstrap ¶
func (entry *CacheEntry) Bootstrap(ctx context.Context)
Bootstrap entry
func (*CacheEntry) GetCache ¶
func (entry *CacheEntry) GetCache() *cache.Cache
GetCache returns cache instance
func (*CacheEntry) GetDescription ¶
func (entry *CacheEntry) GetDescription() string
GetDescription returns description of entry
func (*CacheEntry) GetFromCache ¶
func (entry *CacheEntry) GetFromCache(req *CacheReq) *CacheResp
func (*CacheEntry) GetName ¶
func (entry *CacheEntry) GetName() string
GetName returns name of entry
func (*CacheEntry) GetType ¶
func (entry *CacheEntry) GetType() string
GetType returns type of entry
func (*CacheEntry) Interrupt ¶
func (entry *CacheEntry) Interrupt(ctx context.Context)
Interrupt entry
func (*CacheEntry) IsLocalCacheEnabled ¶
func (entry *CacheEntry) IsLocalCacheEnabled() bool
IsLocalCacheEnabled is local cache enabled
func (*CacheEntry) IsRedisCacheEnabled ¶
func (entry *CacheEntry) IsRedisCacheEnabled() bool
IsRedisCacheEnabled is redis cache enabled
type Option ¶
type Option func(e *CacheEntry)
Option entry options
func WithDescription ¶
WithDescription provide name.
func WithLocalCache ¶
func WithLocalCache(in cache.LocalCache) Option
WithLocalCache provide LocalCache
func WithLoggerEntry ¶
func WithLoggerEntry(entry *rkentry.LoggerEntry) Option
WithLoggerEntry provide rkentry.LoggerEntry entry name
func WithRedisCache ¶
func WithRedisCache(in *rkredis.RedisEntry) Option
WithRedisCache provide RedisEntry
Click to show internal directories.
Click to hide internal directories.