internal

package
v0.0.0-...-a6ef0dd Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShortenerCacheRepo

type ShortenerCacheRepo interface {
	GetAllURL(userID string) ([]entity.URL, error)
	GetURL(shortURL string) (string, error)
	SetURL(url entity.URL) error
	DeleteURL(shortURL string) (int64, error)
	IsSingleURLExist(shortURL string) (bool, error)
	HasShortURLExpired(shortURL string) (bool, error)
	IsCollectionURLExist(userID string) (bool, error)
}

ShortenerCacheRepo contains repo for all URL Shortener Cache

type ShortenerDBRepo

type ShortenerDBRepo interface {
	GetAllURL(userID string) ([]entity.URL, error)
	GetURL(shortURL string) (entity.URL, error)
	CreateNewShortURL(url entity.URL) error
	UpdateShortURL(shortURL string, longURL string) error
	DeleteURL(shortURL string) error

	IsShortURLExist(shortURL string) bool
	HasShortURLExpired(shortURL string) bool
}

ShortenerDBRepo contains repo for all URL Shortener DB

type ShortenerUC

type ShortenerUC interface {
	GetAllURL(userID string) ([]entity.URL, error)
	CreateNewShortURL(longURL string) (entity.URL, error)
	CreateNewCustomShortURL(shortURL string, longURL string) (entity.URL, error)
	UpdateShortURL(shortURL string, longURL string) error
	GetLongURL(shortURL string) (string, error)
	DeleteURL(shortURL string) error

	GenerateShortURL(length int) string
	IsValidURL(url string) (string, error)
}

ShortenerUC contains logic for all URL Shortener Usecase

Directories

Path Synopsis
app
delivery
repo
cache/redis
Package redis is a generated GoMock package.
Package redis is a generated GoMock package.
db/postgres
Package postgres is a generated GoMock package.
Package postgres is a generated GoMock package.
Package usecase is a generated GoMock package.
Package usecase is a generated GoMock package.

Jump to

Keyboard shortcuts

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