Documentation ¶
Index ¶
- func GetCache(entryName string) *cache.Cache
- func RegisterCacheEntryFromConfig(configFilePath string) map[string]rkentry.Entry
- type BootConfig
- type CacheEntry
- func (entry *CacheEntry) AddToCacheEncoded(req *CacheReq) *CacheResp
- func (entry *CacheEntry) Bootstrap(ctx context.Context)
- func (entry *CacheEntry) GetCache() *cache.Cache
- func (entry *CacheEntry) GetDescription() string
- func (entry *CacheEntry) GetFromCacheEncoded(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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCache ¶
func GetCache(entryName string) *cache.Cache
GetCache get cache.Cache with entryName
func RegisterCacheEntryFromConfig ¶
RegisterCacheEntryFromConfig create entry from config file
Types ¶
type BootConfig ¶
type BootConfig struct { Cache []struct { Name string `yaml:"name" json:"name"` 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.BootConfigRedis `yaml:"redis" json:"redis"` Logger struct { ZapLogger string `yaml:"zapLogger" json:"zapLogger"` } `yaml:"logger" json:"logger"` Cert struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"cert" json:"cert"` } `yaml:"cache" json:"cache"` }
BootConfig bootstrap entry from config
type CacheEntry ¶
type CacheEntry struct { EntryName string EntryType string EntryDescription string // 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) AddToCacheEncoded ¶
func (entry *CacheEntry) AddToCacheEncoded(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) GetFromCacheEncoded ¶
func (entry *CacheEntry) GetFromCacheEncoded(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 WithRedisCache ¶
func WithRedisCache(in *rkredis.RedisEntry) Option
WithRedisCache provide RedisEntry
func WithZapLoggerEntry ¶
func WithZapLoggerEntry(entry *rkentry.ZapLoggerEntry) Option
WithZapLoggerEntry provide rkentry.ZapLoggerEntry entry name