Documentation ¶
Index ¶
- Variables
- type BaseCacheProxy
- type Cache
- type CacheProxy
- type DatabaseGetFunc
- type MutexProxy
- type Option
- type Options
- type RedisCache
- type SyncCondProxy
- func (proxy *SyncCondProxy[TCache, TQry]) AwaitIdle(ctx context.Context, qryOption TQry, readModelType *TCache) (readModel TCache, err error)
- func (proxy *SyncCondProxy[TCache, TQry]) Execute(ctx context.Context, qryOption TQry, readModelType *TCache) (readModel TCache, err error)
- func (proxy *SyncCondProxy[TCache, TQry]) SetBusy(b bool)
- type SyncMapProxy
- type TransformQryOptionToCacheKey
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTimeout = 10 * time.Second
Functions ¶
This section is empty.
Types ¶
type BaseCacheProxy ¶
type BaseCacheProxy[TCache, TQry any] struct { Transform TransformQryOptionToCacheKey Cache Cache[TCache] GetDB DatabaseGetFunc[TCache, TQry] KeepTime time.Duration }
type Cache ¶
type Cache[TCache any] interface { GetValue(ctx context.Context, key string, value TCache) (err error) SetValue(ctx context.Context, key string, val TCache, keepTime time.Duration) error }
Cache infrastructure interface
type CacheProxy ¶
type CacheProxy[TCache, TQry any] interface { Execute(ctx context.Context, qryOption TQry, readModelType *TCache) (readModel TCache, err error) }
CacheProxy Proxy interface
func UseMutex ¶
func UseMutex[TCache, TQry any](baseProxy *BaseCacheProxy[TCache, TQry]) CacheProxy[TCache, TQry]
func UseSyncCond ¶
func UseSyncCond[TCache, TQry any](baseProxy *BaseCacheProxy[TCache, TQry]) CacheProxy[TCache, TQry]
func UseSyncMap ¶
func UseSyncMap[TCache, TQry any](baseProxy *BaseCacheProxy[TCache, TQry]) CacheProxy[TCache, TQry]
type DatabaseGetFunc ¶
type MutexProxy ¶
type MutexProxy[TCache, TQry any] struct { BaseCacheProxy[TCache, TQry] // contains filtered or unexported fields }
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options setting
func (*Options) GetKeepTime ¶
type RedisCache ¶
type RedisCache[TCache any] struct { // contains filtered or unexported fields }
func NewRedisCache ¶
func NewRedisCache[TCache any](client *redis.Client) *RedisCache[TCache]
type SyncCondProxy ¶
type SyncCondProxy[TCache, TQry any] struct { BaseCacheProxy[TCache, TQry] // contains filtered or unexported fields }
func (*SyncCondProxy[TCache, TQry]) AwaitIdle ¶
func (proxy *SyncCondProxy[TCache, TQry]) AwaitIdle(ctx context.Context, qryOption TQry, readModelType *TCache) (readModel TCache, err error)
func (*SyncCondProxy[TCache, TQry]) Execute ¶
func (proxy *SyncCondProxy[TCache, TQry]) Execute(ctx context.Context, qryOption TQry, readModelType *TCache) (readModel TCache, err error)
func (*SyncCondProxy[TCache, TQry]) SetBusy ¶
func (proxy *SyncCondProxy[TCache, TQry]) SetBusy(b bool)
type SyncMapProxy ¶
type SyncMapProxy[TCache, TQry any] struct { BaseCacheProxy[TCache, TQry] // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.