dynamodb

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAndPopulateRedis

func FetchAndPopulateRedis() error

Fetches data from dynamodb on cold restart and populates data to redis

func ListenForNewURL

func ListenForNewURL(redisClient *redis.Client)

ListenForNewURL listens for new URL added events from Redis and saves to DynamoDB

func ListenForNewUrl

func ListenForNewUrl(ctx *gin.Context, redisClient *redis.Client)

Listens to redis subscription for new push events

func RemoveUrl

func RemoveUrl(shortUrl string) (string, error)

func SaveUrlMapping

func SaveUrlMapping(shortUrl, originalUrl, userid string) error

save url mapping to dynamodb

Types

type DynamoDBEntry

type DynamoDBEntry struct {
	ShortURL    string
	OriginalURL string
	UserID      string
}

DynamoDBEntry represents the structure of data in DynamoDB

type DynamoDBService

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

DynamoDB wrapper

func InitializeDynamoDB

func InitializeDynamoDB() *DynamoDBService

Jump to

Keyboard shortcuts

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