pgrepo

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

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidIdErr = "invalid task id"
	DateErr      = "bad date"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	DB *pgxpool.Pool
	// contains filtered or unexported fields
}

func NewTasksRepo

func NewTasksRepo(ctx context.Context, cfg config.PostgresCfg) (Repo, error)

func (Repo) CreateTask

func (db Repo) CreateTask(taskReq tasktodo.Request) (tasktodo.Task, error)

func (Repo) DeleteTask

func (db Repo) DeleteTask(taskID string) error

func (Repo) GetTask

func (db Repo) GetTask(taskID string) (tasktodo.Task, error)

func (Repo) ListTasks

func (db Repo) ListTasks(page uint, date string, status string) ([]tasktodo.Task, error)

func (Repo) NewTable

func (db Repo) NewTable(ctx context.Context, cfg config.PostgresCfg) error

func (Repo) UpdateTask

func (db Repo) UpdateTask(newData tasktodo.Request, taskID string) (tasktodo.Task, error)

Jump to

Keyboard shortcuts

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