database

package
v0.0.0-...-1cf632a Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package database provides CRUD operations with database.

Package database provides CRUD operations with database.

Package database provides CRUD operations with database.

Package database provides CRUD operations with database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedItemsRepository

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

FeedItemsRepository object capable of interacting with FeedItemsRepository

func NewFeedItemsRepository

func NewFeedItemsRepository(db *database.Database, log *logger.Zerolog) *FeedItemsRepository

NewFeedItemsRepository creates a new FeedItemsRepository

func (*FeedItemsRepository) Create

Create creates new feed item

func (*FeedItemsRepository) Delete

func (repo *FeedItemsRepository) Delete(ctx context.Context, feedID string, toDate time.Time) error

Delete deletes feed item

func (*FeedItemsRepository) GetByFeedID

func (repo *FeedItemsRepository) GetByFeedID(ctx context.Context, id string) ([]*entity.FeedItem, error)

GetByFeedID returns feed items by feed_id

type FeedsRepository

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

FeedsRepository object capable of interacting with FeedsRepository

func NewFeedsRepository

func NewFeedsRepository(db *database.Database, log *logger.Zerolog) *FeedsRepository

NewFeedsRepository creates a new FeedsRepository

func (*FeedsRepository) Create

func (repo *FeedsRepository) Create(ctx context.Context, in *entity.Feed) (*entity.Feed, error)

Create creates new feed

func (*FeedsRepository) Delete

func (repo *FeedsRepository) Delete(ctx context.Context, id string) error

Delete deletes feed item

func (*FeedsRepository) Get

func (repo *FeedsRepository) Get(ctx context.Context, filter *entity.FeedFilter) ([]*entity.Feed, error)

Get returns feeds

func (*FeedsRepository) GetByID

func (repo *FeedsRepository) GetByID(ctx context.Context, id string) (*entity.Feed, error)

GetByID returns feed by id

func (*FeedsRepository) GetForUpdate

func (repo *FeedsRepository) GetForUpdate(ctx context.Context, delay int64) ([]*entity.Feed, error)

GetForUpdate returns feeds that need to be updated

func (*FeedsRepository) Update

func (repo *FeedsRepository) Update(ctx context.Context, in *entity.Feed) (*entity.Feed, error)

Update updates feed item

type SubscriptionsRepository

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

SubscriptionsRepository object capable of interacting with SubscriptionsRepository

func NewSubscriptionsRepository

func NewSubscriptionsRepository(db *database.Database, log *logger.Zerolog) *SubscriptionsRepository

NewSubscriptionsRepository creates a new SubscriptionsRepository

func (*SubscriptionsRepository) Create

Create creates new subscription

func (*SubscriptionsRepository) Delete

func (repo *SubscriptionsRepository) Delete(ctx context.Context, id string) error

Delete deletes user subscription

func (*SubscriptionsRepository) GetByFeedID

func (repo *SubscriptionsRepository) GetByFeedID(ctx context.Context, id string) ([]*entity.Subscription, error)

GetByFeedID returns subscriptions by feed id

func (*SubscriptionsRepository) GetByID

GetByID returns subscriptions by id

func (*SubscriptionsRepository) GetByUserID

func (repo *SubscriptionsRepository) GetByUserID(ctx context.Context, id int64) ([]*entity.Subscription, error)

GetByUserID returns subscriptions by user id

type UsersRepository

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

UsersRepository object capable of interacting with UsersRepository

func NewUsersRepository

func NewUsersRepository(db *database.Database, log *logger.Zerolog) *UsersRepository

NewUsersRepository creates a new UsersRepository

func (*UsersRepository) Create

func (repo *UsersRepository) Create(ctx context.Context, in *entity.User) (*entity.User, error)

Create creates new user

func (*UsersRepository) Get

func (repo *UsersRepository) Get(ctx context.Context, filter *entity.UsersFilter) ([]*entity.User, error)

Get returns users

func (*UsersRepository) GetByID

func (repo *UsersRepository) GetByID(ctx context.Context, id int64) (*entity.User, error)

GetByID returns user by id

Jump to

Keyboard shortcuts

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