repository

package
v0.0.0-...-59b6e81 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string
const (
	QuestionKind Kind = "question"
	AnswerKind   Kind = "answer"
)

type RateRepository

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

func NewRepository

func NewRepository(db *sql.DB) RateRepository

func (RateRepository) BuildRateFilter

func (rr RateRepository) BuildRateFilter(k Kind, userID, recordID string) []qm.QueryMod

func (RateRepository) Exists

func (rr RateRepository) Exists(ctx context.Context, k Kind, userID, recordID string) (bool, error)

func (RateRepository) GetCurrentValue

func (rr RateRepository) GetCurrentValue(ctx context.Context, k Kind, userID, recordID string) (int64, error)

func (RateRepository) IsOwner

func (rr RateRepository) IsOwner(ctx context.Context, k Kind, userID, id string) bool

func (RateRepository) Rating

func (rr RateRepository) Rating(ctx context.Context, k Kind, userID, id string) (int64, error)

func (RateRepository) Unrating

func (rr RateRepository) Unrating(ctx context.Context, k Kind, userID, id string) (int64, error)

Jump to

Keyboard shortcuts

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