dao

package
v0.0.0-...-6bc37de Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpiredat          = errors.New("id has already expired")
	ErrShortenURLNotFound = errors.New("shorten url not found")
	ErrShortenURLFail     = errors.New("fail to shorten url")
)

Functions

func NewPGShortenerDAO

func NewPGShortenerDAO(pgClient *pgkit.PGClient) *pgShortenerDAO

func NewRedisShortenerDAO

func NewRedisShortenerDAO(client *rediskit.RedisClient, baseDAO ShortenerDAO) *redisShortenerDAO

Types

type Shortener

type Shortener struct {
	ID         uuid.UUID
	URL        string
	ShortenURL string
	ExpiredAt  string
}

func NewFakeShortener

func NewFakeShortener(url string) *Shortener

type ShortenerDAO

type ShortenerDAO interface {
	Shorten(ctx context.Context, req *Shortener) (uuid.UUID, string, error)
	Get(ctx context.Context, req *Shortener) (*Shortener, error)
}

Jump to

Keyboard shortcuts

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