caching

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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 Init

func Init(clusterID, nodeID string) *Cache

Init creates a new instance of the cache module

func (*Cache) AddDBRules

func (c *Cache) AddDBRules(projectID string, dbRules config.DatabaseRules)

AddDBRules adds db rules

func (*Cache) ConnectionState

func (c *Cache) ConnectionState(ctx context.Context) bool

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

func (c *Cache) SetAdminModule(admin *admin.Manager)

SetAdminModule sets admin module

func (*Cache) SetCachingConfig

func (c *Cache) SetCachingConfig(ctx context.Context, cacheConfig *config.CacheConfig) error

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

func (*CacheResult) Key

func (d *CacheResult) Key() string

Key gets cache key

Jump to

Keyboard shortcuts

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