services

package
v0.0.0-...-609656b Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateShortUrl

func CreateShortUrl(originalLink string, userId string) string

CreateShortUrl creates a short ID by hashing the original link then encoding it with base58

func GetAppApiAddr

func GetAppApiAddr() string

func GetUrlMapping

func GetUrlMapping(shortUrl string) string

GetUrlMapping loads up the original url to redirect from short url

func SaveUrlMapping

func SaveUrlMapping(shortUrl string, originalUrl string)

SaveUrlMapping persists the url shortening record to the redis

Types

type StorageService

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

func NewStorageService

func NewStorageService(redisAddr string, redisPassword string, redisDB int) *StorageService

Jump to

Keyboard shortcuts

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