Documentation
¶
Index ¶
- type MemcacheConfig
- type MemcacheProvider
- func (m *MemcacheProvider) Connect(ctx context.Context) error
- func (m *MemcacheProvider) Delete(ctx context.Context, key string) error
- func (m *MemcacheProvider) DeleteMultiple(ctx context.Context, keys []string) error
- func (m *MemcacheProvider) Disconnect(ctx context.Context) error
- func (m *MemcacheProvider) Exists(ctx context.Context, key string) (bool, error)
- func (m *MemcacheProvider) Flush(ctx context.Context) error
- func (m *MemcacheProvider) Get(ctx context.Context, key string, dest interface{}) error
- func (m *MemcacheProvider) GetConnectionInfo() *types.ConnectionInfo
- func (m *MemcacheProvider) GetKeys(ctx context.Context, pattern string) ([]string, error)
- func (m *MemcacheProvider) GetMultiple(ctx context.Context, keys []string) (map[string]interface{}, error)
- func (m *MemcacheProvider) GetName() string
- func (m *MemcacheProvider) GetStats(ctx context.Context) (*types.CacheStats, error)
- func (m *MemcacheProvider) GetSupportedFeatures() []types.CacheFeature
- func (m *MemcacheProvider) GetTTL(ctx context.Context, key string) (time.Duration, error)
- func (m *MemcacheProvider) InvalidateByTag(ctx context.Context, tag string) error
- func (m *MemcacheProvider) IsConnected() bool
- func (m *MemcacheProvider) Ping(ctx context.Context) error
- func (m *MemcacheProvider) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
- func (m *MemcacheProvider) SetMultiple(ctx context.Context, items map[string]interface{}, ttl time.Duration) error
- func (m *MemcacheProvider) SetTTL(ctx context.Context, key string, ttl time.Duration) error
- func (m *MemcacheProvider) SetWithTags(ctx context.Context, key string, value interface{}, ttl time.Duration, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemcacheConfig ¶
type MemcacheConfig struct {
Servers []string `json:"servers"`
MaxIdleConns int `json:"max_idle_conns"`
Timeout time.Duration `json:"timeout"`
KeyPrefix string `json:"key_prefix"`
Namespace string `json:"namespace"`
MaxKeySize int `json:"max_key_size"`
MaxValueSize int `json:"max_value_size"`
}
MemcacheConfig holds Memcached-specific configuration
type MemcacheProvider ¶
type MemcacheProvider struct {
// contains filtered or unexported fields
}
MemcacheProvider implements the CacheProvider interface for Memcached
func NewMemcacheProvider ¶
func NewMemcacheProvider(config *MemcacheConfig, logger *logrus.Logger) *MemcacheProvider
NewMemcacheProvider creates a new Memcached cache provider
func (*MemcacheProvider) Connect ¶
func (m *MemcacheProvider) Connect(ctx context.Context) error
Connect establishes connection to Memcached
func (*MemcacheProvider) Delete ¶
func (m *MemcacheProvider) Delete(ctx context.Context, key string) error
Delete removes a value from Memcached
func (*MemcacheProvider) DeleteMultiple ¶
func (m *MemcacheProvider) DeleteMultiple(ctx context.Context, keys []string) error
DeleteMultiple removes multiple values from Memcached
func (*MemcacheProvider) Disconnect ¶
func (m *MemcacheProvider) Disconnect(ctx context.Context) error
Disconnect closes the Memcached connection
func (*MemcacheProvider) Flush ¶
func (m *MemcacheProvider) Flush(ctx context.Context) error
Flush clears all cache data
func (*MemcacheProvider) Get ¶
func (m *MemcacheProvider) Get(ctx context.Context, key string, dest interface{}) error
Get retrieves a value from Memcached
func (*MemcacheProvider) GetConnectionInfo ¶
func (m *MemcacheProvider) GetConnectionInfo() *types.ConnectionInfo
GetConnectionInfo returns connection information
func (*MemcacheProvider) GetKeys ¶
GetKeys returns keys matching a pattern (not supported by Memcached)
func (*MemcacheProvider) GetMultiple ¶
func (m *MemcacheProvider) GetMultiple(ctx context.Context, keys []string) (map[string]interface{}, error)
GetMultiple retrieves multiple values from Memcached
func (*MemcacheProvider) GetName ¶
func (m *MemcacheProvider) GetName() string
GetName returns the provider name
func (*MemcacheProvider) GetStats ¶
func (m *MemcacheProvider) GetStats(ctx context.Context) (*types.CacheStats, error)
GetStats returns Memcached cache statistics
func (*MemcacheProvider) GetSupportedFeatures ¶
func (m *MemcacheProvider) GetSupportedFeatures() []types.CacheFeature
GetSupportedFeatures returns the features supported by Memcached
func (*MemcacheProvider) GetTTL ¶
GetTTL returns the TTL of a key (not directly supported by Memcached)
func (*MemcacheProvider) InvalidateByTag ¶
func (m *MemcacheProvider) InvalidateByTag(ctx context.Context, tag string) error
InvalidateByTag invalidates all keys with a specific tag
func (*MemcacheProvider) IsConnected ¶
func (m *MemcacheProvider) IsConnected() bool
IsConnected returns the connection status
func (*MemcacheProvider) Ping ¶
func (m *MemcacheProvider) Ping(ctx context.Context) error
Ping tests the Memcached connection
func (*MemcacheProvider) Set ¶
func (m *MemcacheProvider) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
Set stores a value in Memcached
func (*MemcacheProvider) SetMultiple ¶
func (m *MemcacheProvider) SetMultiple(ctx context.Context, items map[string]interface{}, ttl time.Duration) error
SetMultiple stores multiple values in Memcached
func (*MemcacheProvider) SetWithTags ¶
func (m *MemcacheProvider) SetWithTags(ctx context.Context, key string, value interface{}, ttl time.Duration, tags []string) error
SetWithTags stores a value with tags (not supported by Memcached, but we can store tags as separate keys)