repository

package
v0.0.0-...-e928be9 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemUrlEntryRepository

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

MemUrlEntryRepository is a in memory repository that will repository the url entries

func NewMemUrlEntryRepository

func NewMemUrlEntryRepository() *MemUrlEntryRepository

NewMemUrlEntryRepository will create a new in memory repository

func (*MemUrlEntryRepository) GetFromToken

func (s *MemUrlEntryRepository) GetFromToken(ctx context.Context, token entity.UrlToken) (*entity.UrlEntry, error)

GetFromToken will return the url entry for the given token

func (*MemUrlEntryRepository) GetFromUrl

func (s *MemUrlEntryRepository) GetFromUrl(ctx context.Context, url entity.Url) (*entity.UrlEntry, error)

GetFromUrl will return the url entry for the given url

func (*MemUrlEntryRepository) SaveUrl

Save will save the url entry to the repository

func (*MemUrlEntryRepository) SaveVisit

func (s *MemUrlEntryRepository) SaveVisit(ctx context.Context, token entity.UrlToken) error

SaveVisit will increment the number of times the url has been visited

type PGXUrlEntryRepository

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

func NewPGXUrlEntryRepository

func NewPGXUrlEntryRepository(db *pgxpool.Pool) *PGXUrlEntryRepository

func (*PGXUrlEntryRepository) GetFromToken

func (s *PGXUrlEntryRepository) GetFromToken(ctx context.Context, token entity.UrlToken) (*entity.UrlEntry, error)

func (*PGXUrlEntryRepository) GetFromUrl

func (s *PGXUrlEntryRepository) GetFromUrl(ctx context.Context, url entity.Url) (*entity.UrlEntry, error)

func (*PGXUrlEntryRepository) SaveUrl

func (*PGXUrlEntryRepository) SaveVisit

func (s *PGXUrlEntryRepository) SaveVisit(ctx context.Context, token entity.UrlToken) error

Jump to

Keyboard shortcuts

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