database

package
v0.0.0-...-32bcda9 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackgroundContext

func BackgroundContext() context.Context

func RedisContext

func RedisContext() (context.Context, context.CancelFunc)

Types

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) Delete

func (c *Cache) Delete(key string)

func (*Cache) Get

func (c *Cache) Get(key string) (image.Image, bool)

func (*Cache) Set

func (c *Cache) Set(key string, value image.Image)

type Database

type Database struct {
	Client     *redis.Client
	ImageCache *Cache
}

func NewDatabase

func NewDatabase(address string, db int) (*Database, error)

func (*Database) GetAvatar

func (db *Database) GetAvatar(avatarURL string, size int) (image.Image, error)

func (*Database) GetCachedProfileImage

func (db *Database) GetCachedProfileImage(userId, profileString string) (string, error)

func (*Database) SetAvatar

func (db *Database) SetAvatar(avatarURL string, size int, image image.Image) error

func (*Database) SetCachedProfileImage

func (db *Database) SetCachedProfileImage(userId, profileString, image string) error

Jump to

Keyboard shortcuts

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