Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RetrieveSolution ¶
func RetrieveSolution(ctx context.Context, cache CacheService, measurement *models.NewMeasurement) (*models.Solution, error)
RetrieveSolution retrieves the serialized Solution from the cache and deserializes it.
func StoreSolution ¶
func StoreSolution(ctx context.Context, cache CacheService, measurement *models.NewMeasurement, solution *models.Solution, expiration time.Duration) error
StoreSolution stores the serialized Solution in the cache.
Types ¶
type CacheService ¶
type CacheService interface { // Get retrieves the value associated with the given key from the cache. Get(ctx context.Context, key string) (string, error) // Set sets the value associated with the given key in the cache. Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error }
CacheService defines the interface for a cache.
func NewRedisCache ¶
func NewRedisCache(ctx context.Context, host, port string) (CacheService, error)
NewRedisCache creates a new Redis cache instance.
Click to show internal directories.
Click to hide internal directories.