Documentation ¶
Index ¶
- type Cache
- func (c *Cache) AddDBRules(projectID string, dbRules config.DatabaseRules)
- func (c *Cache) ConnectionState(ctx context.Context) bool
- func (c *Cache) GetDatabaseKey(ctx context.Context, projectID, dbAlias, tableName string, ...) (*CacheResult, error)
- func (c *Cache) GetIngressRoute(ctx context.Context, routeID string, cacheOptions []interface{}) (string, bool, *model.CacheIngressRoute, error)
- func (c *Cache) GetRemoteService(ctx context.Context, projectID, serviceID, endpoint string, ...) (*CacheResult, error)
- func (c *Cache) InvalidateDatabaseCache(ctx context.Context, projectID, dbAlias, rootTable, opType string, ...) error
- func (c *Cache) PurgeCache(ctx context.Context, projectID string, req *model.CachePurgeRequest) error
- func (c *Cache) SetAdminModule(admin *admin.Manager)
- func (c *Cache) SetCachingConfig(ctx context.Context, cacheConfig *config.CacheConfig) error
- func (c *Cache) SetDatabaseKey(ctx context.Context, projectID, dbAlias, col string, ...) error
- func (c *Cache) SetIngressRouteKey(ctx context.Context, redisKey string, cache *config.ReadCacheOptions, ...) error
- func (c *Cache) SetRemoteServiceKey(ctx context.Context, redisKey string, remoteServiceCacheOptions *CacheResult, ...) error
- type CacheResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache holds module config
func (*Cache) AddDBRules ¶
func (c *Cache) AddDBRules(projectID string, dbRules config.DatabaseRules)
AddDBRules adds db rules
func (*Cache) ConnectionState ¶
ConnectionState gets the current connection state
func (*Cache) GetDatabaseKey ¶
func (c *Cache) GetDatabaseKey(ctx context.Context, projectID, dbAlias, tableName string, req *model.ReadRequest) (*CacheResult, error)
GetDatabaseKey gets database key
func (*Cache) GetIngressRoute ¶
func (c *Cache) GetIngressRoute(ctx context.Context, routeID string, cacheOptions []interface{}) (string, bool, *model.CacheIngressRoute, error)
GetIngressRoute get ingress route
func (*Cache) GetRemoteService ¶
func (c *Cache) GetRemoteService(ctx context.Context, projectID, serviceID, endpoint string, cache *config.ReadCacheOptions, cacheOptions []interface{}) (*CacheResult, error)
GetRemoteService get remote service
func (*Cache) InvalidateDatabaseCache ¶
func (c *Cache) InvalidateDatabaseCache(ctx context.Context, projectID, dbAlias, rootTable, opType string, doc map[string]interface{}) error
InvalidateDatabaseCache invalidates database cache
func (*Cache) PurgeCache ¶
func (c *Cache) PurgeCache(ctx context.Context, projectID string, req *model.CachePurgeRequest) error
PurgeCache purges cache
func (*Cache) SetAdminModule ¶
SetAdminModule sets admin module
func (*Cache) SetCachingConfig ¶
SetCachingConfig sets caching config
func (*Cache) SetDatabaseKey ¶
func (c *Cache) SetDatabaseKey(ctx context.Context, projectID, dbAlias, col string, result *model.CacheDatabaseResult, dbCacheOptions *CacheResult, cache *config.ReadCacheOptions, cacheJoinInfo map[string]map[string]string) error
SetDatabaseKey sets database key
func (*Cache) SetIngressRouteKey ¶
func (c *Cache) SetIngressRouteKey(ctx context.Context, redisKey string, cache *config.ReadCacheOptions, result *model.CacheIngressRoute) error
SetIngressRouteKey sets ingress route key
func (*Cache) SetRemoteServiceKey ¶
func (c *Cache) SetRemoteServiceKey(ctx context.Context, redisKey string, remoteServiceCacheOptions *CacheResult, cache *config.ReadCacheOptions, result interface{}) error
SetRemoteServiceKey set remote service key
type CacheResult ¶
type CacheResult struct {
// contains filtered or unexported fields
}
CacheResult store cache result
func (*CacheResult) GetDatabaseResult ¶
func (d *CacheResult) GetDatabaseResult() *model.CacheDatabaseResult
GetDatabaseResult get cached database result
func (*CacheResult) GetResult ¶
func (d *CacheResult) GetResult() interface{}
GetResult gets cache result
func (*CacheResult) IsCacheEnabled ¶
func (d *CacheResult) IsCacheEnabled() bool
IsCacheEnabled tells if the cache is enabled or not
func (*CacheResult) IsCacheHit ¶
func (d *CacheResult) IsCacheHit() bool
IsCacheHit tells if it's a cache hit or miss