Documentation
¶
Index ¶
- type FileSystemBackend
- func (fs *FileSystemBackend) Close() error
- func (fs *FileSystemBackend) Delete(ctx context.Context, key string) error
- func (fs *FileSystemBackend) Exists(ctx context.Context, key string) (bool, error)
- func (fs *FileSystemBackend) Init(config map[string]interface{}) error
- func (fs *FileSystemBackend) List(ctx context.Context, prefix string) ([]string, error)
- func (fs *FileSystemBackend) Load(ctx context.Context, key string) (io.ReadCloser, error)
- func (fs *FileSystemBackend) Save(ctx context.Context, key string, data io.Reader) error
- type MemoryBackend
- func (m *MemoryBackend) BatchDelete(ctx context.Context, keys []string) error
- func (m *MemoryBackend) BatchSave(ctx context.Context, items map[string]io.Reader) error
- func (m *MemoryBackend) Clear()
- func (m *MemoryBackend) Clone() *MemoryBackend
- func (m *MemoryBackend) Close() error
- func (m *MemoryBackend) Delete(ctx context.Context, key string) error
- func (m *MemoryBackend) Exists(ctx context.Context, key string) (bool, error)
- func (m *MemoryBackend) GetSize(ctx context.Context, key string) (int64, error)
- func (m *MemoryBackend) Init(config map[string]interface{}) error
- func (m *MemoryBackend) Keys() []string
- func (m *MemoryBackend) List(ctx context.Context, prefix string) ([]string, error)
- func (m *MemoryBackend) Load(ctx context.Context, key string) (io.ReadCloser, error)
- func (m *MemoryBackend) MemoryUsage() int64
- func (m *MemoryBackend) Save(ctx context.Context, key string, data io.Reader) error
- func (m *MemoryBackend) Size() int
- type RedisBackend
- func (r *RedisBackend) AddToSet(ctx context.Context, key string, member interface{}) error
- func (r *RedisBackend) Close() error
- func (r *RedisBackend) Delete(ctx context.Context, key string) error
- func (r *RedisBackend) Exists(ctx context.Context, key string) (bool, error)
- func (r *RedisBackend) GetMetadata(ctx context.Context, key string) (map[string]interface{}, error)
- func (r *RedisBackend) GetSetMembers(ctx context.Context, key string) ([]string, error)
- func (r *RedisBackend) GetTTL(ctx context.Context, key string) (int64, error)
- func (r *RedisBackend) Increment(ctx context.Context, key string) (int64, error)
- func (r *RedisBackend) Init(config map[string]interface{}) error
- func (r *RedisBackend) List(ctx context.Context, prefix string) ([]string, error)
- func (r *RedisBackend) Load(ctx context.Context, key string) (io.ReadCloser, error)
- func (r *RedisBackend) Save(ctx context.Context, key string, data io.Reader) error
- func (r *RedisBackend) SetExpiration(ctx context.Context, key string, seconds int) error
- func (r *RedisBackend) SetMetadata(ctx context.Context, key string, metadata map[string]interface{}) error
- type S3Backend
- func (s3b *S3Backend) Close() error
- func (s3b *S3Backend) Delete(ctx context.Context, key string) error
- func (s3b *S3Backend) Exists(ctx context.Context, key string) (bool, error)
- func (s3b *S3Backend) GetObjectMetadata(ctx context.Context, key string) (map[string]interface{}, error)
- func (s3b *S3Backend) GetObjectSize(ctx context.Context, key string) (int64, error)
- func (s3b *S3Backend) Init(config map[string]interface{}) error
- func (s3b *S3Backend) List(ctx context.Context, prefix string) ([]string, error)
- func (s3b *S3Backend) Load(ctx context.Context, key string) (io.ReadCloser, error)
- func (s3b *S3Backend) Save(ctx context.Context, key string, data io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystemBackend ¶
type FileSystemBackend struct {
// contains filtered or unexported fields
}
FileSystemBackend implements storage using the local file system
func NewFileSystemBackend ¶
func NewFileSystemBackend() *FileSystemBackend
NewFileSystemBackend creates a new file system storage backend
func (*FileSystemBackend) Close ¶
func (fs *FileSystemBackend) Close() error
Close cleans up resources (no-op for file system)
func (*FileSystemBackend) Delete ¶
func (fs *FileSystemBackend) Delete(ctx context.Context, key string) error
Delete removes data from the file system for the given key/path
func (*FileSystemBackend) Init ¶
func (fs *FileSystemBackend) Init(config map[string]interface{}) error
Init initializes the file system backend with configuration
func (*FileSystemBackend) Load ¶
func (fs *FileSystemBackend) Load(ctx context.Context, key string) (io.ReadCloser, error)
Load retrieves data from the file system for the given key/path
type MemoryBackend ¶
type MemoryBackend struct {
// contains filtered or unexported fields
}
MemoryBackend implements in-memory storage for testing and temporary use
func NewMemoryBackend ¶
func NewMemoryBackend() *MemoryBackend
NewMemoryBackend creates a new in-memory storage backend
func (*MemoryBackend) BatchDelete ¶
func (m *MemoryBackend) BatchDelete(ctx context.Context, keys []string) error
BatchDelete removes multiple keys in a single operation
func (*MemoryBackend) Clear ¶
func (m *MemoryBackend) Clear()
Clear removes all data from the backend
func (*MemoryBackend) Clone ¶
func (m *MemoryBackend) Clone() *MemoryBackend
Clone creates a deep copy of the memory backend
func (*MemoryBackend) Close ¶
func (m *MemoryBackend) Close() error
Close cleans up resources (clears memory)
func (*MemoryBackend) Delete ¶
func (m *MemoryBackend) Delete(ctx context.Context, key string) error
Delete removes data from memory for the given key
func (*MemoryBackend) Init ¶
func (m *MemoryBackend) Init(config map[string]interface{}) error
Init initializes the memory backend (no-op, but maintains interface compatibility)
func (*MemoryBackend) Keys ¶
func (m *MemoryBackend) Keys() []string
Keys returns all keys currently stored
func (*MemoryBackend) Load ¶
func (m *MemoryBackend) Load(ctx context.Context, key string) (io.ReadCloser, error)
Load retrieves data from memory for the given key
func (*MemoryBackend) MemoryUsage ¶
func (m *MemoryBackend) MemoryUsage() int64
MemoryUsage returns the approximate memory usage in bytes
func (*MemoryBackend) Size ¶
func (m *MemoryBackend) Size() int
Size returns the number of items stored
type RedisBackend ¶
type RedisBackend struct {
// contains filtered or unexported fields
}
RedisBackend implements storage using Redis for metadata and small objects Note: Redis is better suited for metadata storage rather than large binary objects
func NewRedisBackend ¶
func NewRedisBackend() *RedisBackend
NewRedisBackend creates a new Redis storage backend
func (*RedisBackend) AddToSet ¶
func (r *RedisBackend) AddToSet(ctx context.Context, key string, member interface{}) error
AddToSet adds a member to a set
func (*RedisBackend) Delete ¶
func (r *RedisBackend) Delete(ctx context.Context, key string) error
Delete removes data from Redis for the given key
func (*RedisBackend) GetMetadata ¶
GetMetadata retrieves metadata for a key
func (*RedisBackend) GetSetMembers ¶
GetSetMembers returns all members of a set
func (*RedisBackend) Init ¶
func (r *RedisBackend) Init(config map[string]interface{}) error
Init initializes the Redis backend with configuration
func (*RedisBackend) Load ¶
func (r *RedisBackend) Load(ctx context.Context, key string) (io.ReadCloser, error)
Load retrieves data from Redis for the given key
func (*RedisBackend) SetExpiration ¶
SetExpiration sets an expiration time for a key
func (*RedisBackend) SetMetadata ¶
func (r *RedisBackend) SetMetadata(ctx context.Context, key string, metadata map[string]interface{}) error
SetMetadata stores metadata for a key (using hash)
type S3Backend ¶
type S3Backend struct {
// contains filtered or unexported fields
}
S3Backend implements storage using AWS S3 or S3-compatible services
func (*S3Backend) GetObjectMetadata ¶
func (s3b *S3Backend) GetObjectMetadata(ctx context.Context, key string) (map[string]interface{}, error)
GetObjectMetadata returns metadata for an S3 object
func (*S3Backend) GetObjectSize ¶
GetObjectSize returns the size of an object in S3