cache_drivers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileCacheDriver

type FileCacheDriver struct {
	// contains filtered or unexported fields
}

FileCacheDriver structure for file-based caching

func (*FileCacheDriver) Delete

func (f *FileCacheDriver) Delete(key string) error

Delete removes data from the file

func (*FileCacheDriver) Get

func (f *FileCacheDriver) Get(key string) (interface{}, error)

Get retrieves data from a file

func (*FileCacheDriver) Has

func (f *FileCacheDriver) Has(key string) (bool, error)

Has checks if a key exists in the filesystem

func (*FileCacheDriver) Init

func (f *FileCacheDriver) Init(config interface{}) error

Init initializes the FileCacheDriver with the given configuration

func (*FileCacheDriver) Name

func (f *FileCacheDriver) Name() string

Name implements cache.CacheDriver.

func (*FileCacheDriver) Set

func (f *FileCacheDriver) Set(key string, value interface{}, expiration time.Duration) error

Set stores data in a file

type MapCacheDriver

type MapCacheDriver struct {
	// contains filtered or unexported fields
}

MapCacheDriver is a structure for in-memory caching.

func (*MapCacheDriver) Delete

func (r *MapCacheDriver) Delete(key string) error

Delete removes data from the cache by key.

func (*MapCacheDriver) Get

func (r *MapCacheDriver) Get(key string) (interface{}, error)

Get retrieves data from the cache by key.

func (*MapCacheDriver) Has

func (r *MapCacheDriver) Has(key string) (bool, error)

Has checks if a key exists in the cache and has not expired.

func (*MapCacheDriver) Init

func (r *MapCacheDriver) Init(config interface{}) error

Init initializes the cache with the provided configuration.

func (*MapCacheDriver) Name

func (r *MapCacheDriver) Name() string

Name returns the name of the cache driver.

func (*MapCacheDriver) Set

func (r *MapCacheDriver) Set(key string, value interface{}, expiration time.Duration) error

Set stores data in the cache with an expiration time.

type RedisCacheDriver

type RedisCacheDriver struct {
	// contains filtered or unexported fields
}

RedisCacheDriver is a structure for managing caching using Redis.

func (*RedisCacheDriver) Delete

func (r *RedisCacheDriver) Delete(key string) error

Delete removes data from Redis by key.

func (*RedisCacheDriver) Get

func (r *RedisCacheDriver) Get(key string) (interface{}, error)

Get retrieves data from Redis by key.

func (*RedisCacheDriver) Has

func (r *RedisCacheDriver) Has(key string) (bool, error)

Has checks if a key exists in Redis.

func (*RedisCacheDriver) Init

func (r *RedisCacheDriver) Init(config interface{}) error

Init initializes the Redis cache driver with the provided configuration.

func (*RedisCacheDriver) Name

func (r *RedisCacheDriver) Name() string

Name returns the name of the cache driver.

func (*RedisCacheDriver) Set

func (r *RedisCacheDriver) Set(key string, value interface{}, expiration time.Duration) error

Set stores data in Redis with an expiration time.

Jump to

Keyboard shortcuts

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