postgres

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

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package postgres - Postgres implementation of service.Repo and repo.EventRepo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

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

Repo - Postgres implementation of service.Repo and repo.EventRepo

func NewPostgresRepo

func NewPostgresRepo(dbpool *pgxpool.Pool) *Repo

NewPostgresRepo returns Postgres implementation of service.Repo and repo.EventRepo

func (*Repo) Create

func (r *Repo) Create(ctx context.Context, pkg model.Package) (*uint64, error)

Create - create new package in database

func (*Repo) Delete

func (r *Repo) Delete(ctx context.Context, id uint64) error

Delete - delete package by id in database

func (*Repo) Get

func (r *Repo) Get(ctx context.Context, id uint64) (*model.Package, error)

Get - get package by id from database

func (*Repo) List

func (r *Repo) List(ctx context.Context, offset uint64, limit uint64) ([]model.Package, error)

List - Get packages from database. start index - offset, count - limit

func (*Repo) Lock

func (r *Repo) Lock(ctx context.Context, n uint64) ([]model.PackageEvent, error)

Lock заблокировать в БД n записей событий

func (*Repo) Remove

func (r *Repo) Remove(ctx context.Context, eventIDs []uint64) error

Remove удалить из БД n записей событий

func (*Repo) Unlock

func (r *Repo) Unlock(ctx context.Context, eventID []uint64) error

Unlock разблокировать в БД n записей событий

func (*Repo) Update

func (r *Repo) Update(ctx context.Context, pkg model.Package) error

Update - update package by id in database

Jump to

Keyboard shortcuts

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