store

package
v0.0.0-...-27b2e48 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchMetadata

func FetchMetadata(key string) (userid string, url string)

func RemoveKey

func RemoveKey(key string) (int64, error)

Removes the key from cache

func RetreiveAllKeys

func RetreiveAllKeys() ([]string, error)

Returns all the keys in the cache.

func RetreiveKeyCount

func RetreiveKeyCount() (int64, error)

Returns total number of keys in the redis.

func RetreiveUserId

func RetreiveUserId(shortUrl string) string

func RetrieveInitialUrl

func RetrieveInitialUrl(shortUrl string) string

func SaveUrlMapping

func SaveUrlMapping(shortUrl string, originalUrl string, userid string)

Save URL mapping by taking the shortened url, original url and user id

Types

type StorageService

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

Raw wrapper

func InitializeStore

func InitializeStore() *StorageService

Store service with pointer return

func (*StorageService) GetRedisClient

func (s *StorageService) GetRedisClient() *redis.Client

Returns the Redis client

Jump to

Keyboard shortcuts

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