Documentation
¶
Index ¶
- func NewRepository(dsn string) (domain.Repository, error)
- type Repository
- func (r *Repository) CreatePoll(ctx context.Context, poll *domain.Poll, options []string, tags []string) error
- func (r *Repository) CreateSkip(ctx context.Context, pollID, userID uuid.UUID) error
- func (r *Repository) CreateUser(ctx context.Context, user *domain.User) error
- func (r *Repository) CreateVote(ctx context.Context, pollID, userID, optionID uuid.UUID) error
- func (r *Repository) DeleteUser(ctx context.Context, id uuid.UUID) error
- func (r *Repository) DeleteVote(ctx context.Context, voteID, userID uuid.UUID) error
- func (r *Repository) GetCachedPoll(ctx context.Context, id uuid.UUID) (*domain.Poll, error)
- func (r *Repository) GetCachedPollStats(ctx context.Context, pollID uuid.UUID) (*domain.PollStats, error)
- func (r *Repository) GetPollByID(ctx context.Context, id uuid.UUID) (*domain.Poll, error)
- func (r *Repository) GetPollStats(ctx context.Context, pollID uuid.UUID) (*domain.PollStats, error)
- func (r *Repository) GetPollsForFeed(ctx context.Context, userID uuid.UUID, tag string, page, limit int) ([]domain.Poll, int, error)
- func (r *Repository) GetUserByEmail(ctx context.Context, email string) (*domain.User, error)
- func (r *Repository) GetUserByID(ctx context.Context, id uuid.UUID) (*domain.User, error)
- func (r *Repository) GetUserDailyVoteCount(ctx context.Context, userID uuid.UUID, date time.Time) (int, error)
- func (r *Repository) GetUserVotes(ctx context.Context, userID uuid.UUID, page, limit int) ([]domain.Vote, int, error)
- func (r *Repository) GetVoteByID(ctx context.Context, voteID uuid.UUID) (*domain.Vote, error)
- func (r *Repository) HasSkipped(ctx context.Context, pollID, userID uuid.UUID) (bool, error)
- func (r *Repository) HasVoted(ctx context.Context, pollID, userID uuid.UUID) (bool, error)
- func (r *Repository) IncrementUserDailyVoteCount(ctx context.Context, userID uuid.UUID, date time.Time) error
- func (r *Repository) InvalidatePollStatsCache(ctx context.Context, pollID uuid.UUID) error
- func (r *Repository) SetCachedPoll(ctx context.Context, poll *domain.Poll) error
- func (r *Repository) SetCachedPollStats(ctx context.Context, pollID uuid.UUID, stats *domain.PollStats) error
- func (r *Repository) UpdateUser(ctx context.Context, user *domain.User) error
- func (r *Repository) UpdateVote(ctx context.Context, voteID, userID, optionID uuid.UUID) error
- func (r *Repository) WithTransaction(ctx context.Context, fn func(ctx context.Context) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRepository ¶
func NewRepository(dsn string) (domain.Repository, error)
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (*Repository) CreatePoll ¶
func (*Repository) CreateSkip ¶
func (*Repository) CreateUser ¶
func (*Repository) CreateVote ¶
func (*Repository) DeleteUser ¶
func (*Repository) DeleteVote ¶
func (*Repository) GetCachedPoll ¶
func (*Repository) GetCachedPollStats ¶
func (*Repository) GetPollByID ¶
func (*Repository) GetPollStats ¶
func (*Repository) GetPollsForFeed ¶
func (*Repository) GetUserByEmail ¶
func (*Repository) GetUserByID ¶
func (*Repository) GetUserDailyVoteCount ¶
func (*Repository) GetUserVotes ¶
func (*Repository) GetVoteByID ¶
func (*Repository) HasSkipped ¶
func (*Repository) IncrementUserDailyVoteCount ¶
func (*Repository) InvalidatePollStatsCache ¶
func (*Repository) SetCachedPoll ¶
func (*Repository) SetCachedPollStats ¶
func (*Repository) UpdateUser ¶
func (*Repository) UpdateVote ¶
func (*Repository) WithTransaction ¶
Click to show internal directories.
Click to hide internal directories.