urlRepo

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UrlReadRepo added in v1.2.0

type UrlReadRepo struct {
	UrlRepo
	// contains filtered or unexported fields
}

func NewUrlReadRepo added in v1.2.0

func NewUrlReadRepo(dbClient *mongo.Collection, ctx context.Context) *UrlReadRepo

func (*UrlReadRepo) GetById added in v1.2.0

func (r *UrlReadRepo) GetById(id string) (entities.URL, error)

func (*UrlReadRepo) GetByKeyword added in v1.2.0

func (r *UrlReadRepo) GetByKeyword(keyword string) ([]entities.URL, error)

func (*UrlReadRepo) GetByKeywords added in v1.2.0

func (r *UrlReadRepo) GetByKeywords(keywords []string) ([]entities.URL, error)

func (*UrlReadRepo) GetByOriginalUrl added in v1.2.0

func (r *UrlReadRepo) GetByOriginalUrl(originalUrl string) (entities.URL, error)

func (*UrlReadRepo) GetByOwner added in v1.2.0

func (r *UrlReadRepo) GetByOwner(owner string) ([]entities.URL, error)

func (*UrlReadRepo) GetByShortCode added in v1.2.0

func (r *UrlReadRepo) GetByShortCode(shortCode string) (entities.URL, error)

type UrlRepo

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

func NewUrlRepo

func NewUrlRepo(dbClient *mongo.Collection, ctx context.Context) *UrlRepo

type UrlWriteRepo added in v1.2.0

type UrlWriteRepo struct {
	UrlRepo
	// contains filtered or unexported fields
}

func NewUrlWriteRepo added in v1.2.0

func NewUrlWriteRepo(dbClient *mongo.Collection, ctx context.Context) *UrlWriteRepo

func (*UrlWriteRepo) Delete added in v1.2.0

func (r *UrlWriteRepo) Delete(id string) error

Delete deletes a url given its ID

func (*UrlWriteRepo) IncrementHits added in v1.2.0

func (r *UrlWriteRepo) IncrementHits(shortCode string) error

func (*UrlWriteRepo) Save added in v1.2.0

func (r *UrlWriteRepo) Save(url entities.URL) (entities.URL, error)

func (*UrlWriteRepo) Update added in v1.3.0

func (r *UrlWriteRepo) Update(urlID, customAlias string, keywords []entities.Keyword, expiresOn *time.Time) (entities.URL, error)

Update performs an update on an existing shortened URL given urlID, customAlias, keywords & expiresOn

Jump to

Keyboard shortcuts

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