Documentation ¶
Index ¶
- type UrlReadRepo
- func (r *UrlReadRepo) GetById(id string) (entities.URL, error)
- func (r *UrlReadRepo) GetByKeyword(keyword string) ([]entities.URL, error)
- func (r *UrlReadRepo) GetByKeywords(keywords []string) ([]entities.URL, error)
- func (r *UrlReadRepo) GetByOriginalUrl(originalUrl string) (entities.URL, error)
- func (r *UrlReadRepo) GetByOwner(owner string) ([]entities.URL, error)
- func (r *UrlReadRepo) GetByShortCode(shortCode string) (entities.URL, error)
- type UrlRepo
- type UrlWriteRepo
- func (r *UrlWriteRepo) Delete(id string) error
- func (r *UrlWriteRepo) IncrementHits(shortCode string) error
- func (r *UrlWriteRepo) Save(url entities.URL) (entities.URL, error)
- func (r *UrlWriteRepo) Update(urlID, customAlias string, keywords []entities.Keyword, expiresOn *time.Time) (entities.URL, error)
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
Click to show internal directories.
Click to hide internal directories.