shortener

package
v0.0.0-...-7c907d4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgRepository

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

func NewPgRepository

func NewPgRepository(db *sqlx.DB, timeout time.Duration) *PgRepository

func (*PgRepository) Add

func (r *PgRepository) Add(model *entities.ShortURL) error

func (*PgRepository) AddURLVisit

func (r *PgRepository) AddURLVisit(urlID int64, userIP string) error

func (*PgRepository) FindAll

func (r *PgRepository) FindAll(limit, offset int64) ([]dto.ShortURLReportDto, error)

func (*PgRepository) FindByToken

func (r *PgRepository) FindByToken(token string) (*entities.ShortURL, error)

func (*PgRepository) FindByURL

func (r *PgRepository) FindByURL(url string) (*entities.ShortURL, error)

type ShortURLRepository

type ShortURLRepository interface {
	FindAll(int64, int64) ([]dto.ShortURLReportDto, error)
	FindByURL(string) (*entities.ShortURL, error)
	Add(*entities.ShortURL) error
	FindByToken(string) (*entities.ShortURL, error)
	AddURLVisit(int64, string) error
}

Jump to

Keyboard shortcuts

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