pgsql

package
v0.0.0-...-d3bb3ff Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PGStorage

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

PGStorage implements Storage with Postgres database

func NewStorage

func NewStorage(ctx context.Context, host string) (*PGStorage, error)

NewStorage constructs new PGStorage

func (*PGStorage) AddTasks

func (s *PGStorage) AddTasks(ctx context.Context, tasks []*models.Task) ([]*models.Task, error)

AddTasks adds task to DB

func (*PGStorage) ArchivateTasks

func (s *PGStorage) ArchivateTasks(ctx context.Context, tasks []*models.Task) error

ArchivateTasks sets tasks as archived (soft delete)

func (*PGStorage) GetClosedTasks

func (s *PGStorage) GetClosedTasks(ctx context.Context) ([]*models.Task, error)

GetClosedTasks gets tasks by numeric term from table

func (*PGStorage) GetTaskByID

func (s *PGStorage) GetTaskByID(ctx context.Context, id int64) (*models.Task, error)

GetTaskByID gets task by id

func (*PGStorage) GetTasksByTerm

func (s *PGStorage) GetTasksByTerm(ctx context.Context, term *models.Term) ([]*models.Task, error)

GetTasksByTerm gets tasks by numeric term from table

func (*PGStorage) GetTasksByTermAndLimits

func (s *PGStorage) GetTasksByTermAndLimits(ctx context.Context, term *models.Term, limit uint64, offset uint64) ([]*models.Task, error)

GetTasksByTermAndLimits gets tasks with limit and offset

func (*PGStorage) UpdateTask

func (s *PGStorage) UpdateTask(ctx context.Context, task *models.Task) (*models.Task, error)

UpdateTask sets editable task fields

func (*PGStorage) UpdateTaskStatus

func (s *PGStorage) UpdateTaskStatus(ctx context.Context, id int64, closedAt *time.Time, reason string) (*models.Task, error)

UpdateTaskStatus changes task 'closed_at' fiels

Jump to

Keyboard shortcuts

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