task

package
v0.0.0-...-2602c8a Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTaskParams

type CreateTaskParams struct {
	TaskID         uuid.UUID     `json:"taskID"`
	UserID         uuid.UUID     `json:"userID"`
	DataRange      interface{}   `json:"dataRange"`
	ReminderPeriod sql.NullInt64 `json:"reminderPeriod"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetPaginatedTasksByUserEmailParams

type GetPaginatedTasksByUserEmailParams struct {
	UserID uuid.UUID `json:"userID"`
	Limit  int32     `json:"limit"`
	Offset int32     `json:"offset"`
}

type GetPaginatedTasksByUserEmailRow

type GetPaginatedTasksByUserEmailRow struct {
	TableID        sql.NullInt64 `json:"tableID"`
	UserID         uuid.UUID     `json:"userID"`
	Email          string        `json:"email"`
	FirstName      string        `json:"firstName"`
	LastName       string        `json:"lastName"`
	CreatedAt      sql.NullTime  `json:"createdAt"`
	TableID_2      sql.NullInt64 `json:"tableID2"`
	TaskID         uuid.UUID     `json:"taskID"`
	UserID_2       uuid.UUID     `json:"userID2"`
	DataRange      interface{}   `json:"dataRange"`
	ReminderPeriod sql.NullInt64 `json:"reminderPeriod"`
	CreatedAt_2    sql.NullTime  `json:"createdAt2"`
}

type GetPaginatedTasksByUserIDParams

type GetPaginatedTasksByUserIDParams struct {
	UserID uuid.UUID `json:"userID"`
	Limit  int32     `json:"limit"`
	Offset int32     `json:"offset"`
}

type GetPaginatedTasksByUserIDRow

type GetPaginatedTasksByUserIDRow struct {
	TableID        sql.NullInt64 `json:"tableID"`
	UserID         uuid.UUID     `json:"userID"`
	Email          string        `json:"email"`
	FirstName      string        `json:"firstName"`
	LastName       string        `json:"lastName"`
	CreatedAt      sql.NullTime  `json:"createdAt"`
	TableID_2      sql.NullInt64 `json:"tableID2"`
	TaskID         uuid.UUID     `json:"taskID"`
	UserID_2       uuid.UUID     `json:"userID2"`
	DataRange      interface{}   `json:"dataRange"`
	ReminderPeriod sql.NullInt64 `json:"reminderPeriod"`
	CreatedAt_2    sql.NullTime  `json:"createdAt2"`
}

type GetTasksByUserEmailRow

type GetTasksByUserEmailRow struct {
	TableID        sql.NullInt64 `json:"tableID"`
	UserID         uuid.UUID     `json:"userID"`
	Email          string        `json:"email"`
	FirstName      string        `json:"firstName"`
	LastName       string        `json:"lastName"`
	CreatedAt      sql.NullTime  `json:"createdAt"`
	TableID_2      sql.NullInt64 `json:"tableID2"`
	TaskID         uuid.UUID     `json:"taskID"`
	UserID_2       uuid.UUID     `json:"userID2"`
	DataRange      interface{}   `json:"dataRange"`
	ReminderPeriod sql.NullInt64 `json:"reminderPeriod"`
	CreatedAt_2    sql.NullTime  `json:"createdAt2"`
}

type GetTasksByUserIDRow

type GetTasksByUserIDRow struct {
	TableID        sql.NullInt64 `json:"tableID"`
	UserID         uuid.UUID     `json:"userID"`
	Email          string        `json:"email"`
	FirstName      string        `json:"firstName"`
	LastName       string        `json:"lastName"`
	CreatedAt      sql.NullTime  `json:"createdAt"`
	TableID_2      sql.NullInt64 `json:"tableID2"`
	TaskID         uuid.UUID     `json:"taskID"`
	UserID_2       uuid.UUID     `json:"userID2"`
	DataRange      interface{}   `json:"dataRange"`
	ReminderPeriod sql.NullInt64 `json:"reminderPeriod"`
	CreatedAt_2    sql.NullTime  `json:"createdAt2"`
}

type ListPaginatedTasksParams

type ListPaginatedTasksParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Querier

type Querier interface {
	CreateTask(ctx context.Context, arg CreateTaskParams) (Tasks, error)
	DeleteTask(ctx context.Context, userID uuid.UUID) error
	GetPaginatedTasksByUserEmail(ctx context.Context, arg GetPaginatedTasksByUserEmailParams) ([]GetPaginatedTasksByUserEmailRow, error)
	GetPaginatedTasksByUserID(ctx context.Context, arg GetPaginatedTasksByUserIDParams) ([]GetPaginatedTasksByUserIDRow, error)
	GetTask(ctx context.Context, taskID uuid.UUID) (Tasks, error)
	GetTasksByUserEmail(ctx context.Context) ([]GetTasksByUserEmailRow, error)
	GetTasksByUserID(ctx context.Context) ([]GetTasksByUserIDRow, error)
	ListPaginatedTasks(ctx context.Context, arg ListPaginatedTasksParams) ([]Tasks, error)
	ListTasks(ctx context.Context) ([]Tasks, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) CreateTask

func (q *Queries) CreateTask(ctx context.Context, arg CreateTaskParams) (Tasks, error)

func (*Queries) DeleteTask

func (q *Queries) DeleteTask(ctx context.Context, userID uuid.UUID) error

func (*Queries) GetPaginatedTasksByUserID

func (q *Queries) GetPaginatedTasksByUserID(ctx context.Context, arg GetPaginatedTasksByUserIDParams) ([]GetPaginatedTasksByUserIDRow, error)

func (*Queries) GetTask

func (q *Queries) GetTask(ctx context.Context, taskID uuid.UUID) (Tasks, error)

func (*Queries) GetTasksByUserEmail

func (q *Queries) GetTasksByUserEmail(ctx context.Context) ([]GetTasksByUserEmailRow, error)

func (*Queries) GetTasksByUserID

func (q *Queries) GetTasksByUserID(ctx context.Context) ([]GetTasksByUserIDRow, error)

func (*Queries) ListPaginatedTasks

func (q *Queries) ListPaginatedTasks(ctx context.Context, arg ListPaginatedTasksParams) ([]Tasks, error)

func (*Queries) ListTasks

func (q *Queries) ListTasks(ctx context.Context) ([]Tasks, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Store

type Store interface {
	Querier
}

Store provides all functions to execute db queries

func NewStore

func NewStore(db *sql.DB) Store

NewStore instantiates a task store object returning the store interface.

type Tasks

type Tasks struct {
	TableID        sql.NullInt64 `json:"tableID"`
	TaskID         uuid.UUID     `json:"taskID"`
	UserID         uuid.UUID     `json:"userID"`
	DataRange      interface{}   `json:"dataRange"`
	ReminderPeriod sql.NullInt64 `json:"reminderPeriod"`
	CreatedAt      sql.NullTime  `json:"createdAt"`
}

type Users

type Users struct {
	TableID   sql.NullInt64 `json:"tableID"`
	UserID    uuid.UUID     `json:"userID"`
	Email     string        `json:"email"`
	FirstName string        `json:"firstName"`
	LastName  string        `json:"lastName"`
	CreatedAt sql.NullTime  `json:"createdAt"`
}

Directories

Path Synopsis
Package mockdbtask is a generated GoMock package.
Package mockdbtask is a generated GoMock package.

Jump to

Keyboard shortcuts

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