repository

package
v0.0.0-...-a78857b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	SetupDatabase() error
	InsertNewEntry(url *model.Url) error
	RetrieveLongUrl(alias string) (*model.Url, error)
	UpdateUrl(url *model.Url)
	MostVisited(n int) ([]model.Url, error)
}

type UrlRepository

type UrlRepository struct {
	Db *gorm.DB
}

func (*UrlRepository) InsertNewEntry

func (repo *UrlRepository) InsertNewEntry(url *model.Url) error

func (*UrlRepository) MostVisited

func (repo *UrlRepository) MostVisited(n int) ([]model.Url, error)

func (*UrlRepository) RetrieveLongUrl

func (repo *UrlRepository) RetrieveLongUrl(alias string) (*model.Url, error)

func (*UrlRepository) SetupDatabase

func (repo *UrlRepository) SetupDatabase() error

func (*UrlRepository) UpdateUrl

func (repo *UrlRepository) UpdateUrl(url *model.Url)

Jump to

Keyboard shortcuts

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