repositories

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRepo

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

type Car

type Car struct {
	BaseRepo
}

func NewCar

func NewCar(dbpool *pgxpool.Pool) *Car

func (*Car) Get

func (c *Car) Get(ctx context.Context) (models.CarList, error)

func (*Car) GetByID

func (c *Car) GetByID(ctx context.Context, id uuid.UUID) (*models.Car, error)

type Setup

type Setup struct {
	BaseRepo
	// contains filtered or unexported fields
}

func NewSetup

func NewSetup(dbpool *pgxpool.Pool) *Setup

func (*Setup) Create

func (s *Setup) Create(ctx context.Context, setup *models.Setup, opts ...postgresdb.ExecOption) error

func (*Setup) GetList

func (s *Setup) GetList(
	ctx context.Context,
	userID uuid.UUID,
	opts ...postgresdb.ExecOption,
) (models.SetupList, error)

func (*Setup) IncrementDownload

func (s *Setup) IncrementDownload(ctx context.Context, id uuid.UUID, opts ...postgresdb.ExecOption) error

func (*Setup) RecordVote

func (s *Setup) RecordVote(
	ctx context.Context,
	setupID, userID uuid.UUID,
	upvote bool,
	opts ...postgresdb.ExecOption,
) error

func (*Setup) Update

func (s *Setup) Update(
	ctx context.Context,
	setup *models.Setup,
	opts ...postgresdb.ExecOption,
) (int64, error)

func (*Setup) WithFilters

func (s *Setup) WithFilters(filters map[string]interface{}) *Setup

type Track

type Track struct {
	BaseRepo
}

func NewTrack

func NewTrack(dbpool *pgxpool.Pool) *Track

func (*Track) Get

func (t *Track) Get(ctx context.Context) (models.TrackList, error)

func (*Track) GetByID

func (t *Track) GetByID(ctx context.Context, id uuid.UUID) (*models.Track, error)

Jump to

Keyboard shortcuts

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