db

package
v0.0.0-...-8a3e9f0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCategoriesToTaskParams

type AddCategoriesToTaskParams struct {
	TaskID     string
	CategoryID string
}

type Auth

type Auth struct {
	ID        string
	UserID    string
	Token     string
	UserAgent sql.NullString
	ExpiresAt time.Time
	CreatedAt time.Time
}

type Category

type Category struct {
	ID    string
	Name  string
	Color string
}

type CreateAuthTokenParams

type CreateAuthTokenParams struct {
	ID        string
	UserID    string
	Token     string
	UserAgent sql.NullString
	ExpiresAt time.Time
}

type CreateTaskParams

type CreateTaskParams struct {
	ID          string
	UserID      string
	Title       string
	Description string
	Status      string
	PriorityID  sql.NullString
	DueDate     sql.NullTime
}

type CreateUserParams

type CreateUserParams struct {
	ID         string
	Username   string
	Password   string
	Email      string
	PrivateKey string
}

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 DeleteAuthTokenParams

type DeleteAuthTokenParams struct {
	ID     string
	UserID string
	Token  string
}

type DeleteTaskParams

type DeleteTaskParams struct {
	ID     string
	UserID string
}

type DeleteUserParams

type DeleteUserParams struct {
	ID       string
	Username string
	Email    string
}

type GetTaskParams

type GetTaskParams struct {
	ID     string
	UserID string
}

type GetTasksByDueDateParams

type GetTasksByDueDateParams struct {
	UserID  string
	DueDate sql.NullTime
}

type GetTasksByPriorityParams

type GetTasksByPriorityParams struct {
	UserID     string
	PriorityID sql.NullString
}

type GetTasksByStatusParams

type GetTasksByStatusParams struct {
	UserID string
	Status string
}

type GetTasksLimitParams

type GetTasksLimitParams struct {
	UserID string
	Limit  int64
}

type GetUserParams

type GetUserParams struct {
	ID       string
	Username string
	Email    string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddCategoriesToTask

func (q *Queries) AddCategoriesToTask(ctx context.Context, arg AddCategoriesToTaskParams) error

func (*Queries) CreateAuthToken

func (q *Queries) CreateAuthToken(ctx context.Context, arg CreateAuthTokenParams) (Auth, error)

func (*Queries) CreateTask

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

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteAuthToken

func (q *Queries) DeleteAuthToken(ctx context.Context, arg DeleteAuthTokenParams) error

func (*Queries) DeleteCategory

func (q *Queries) DeleteCategory(ctx context.Context, id string) error

func (*Queries) DeleteTask

func (q *Queries) DeleteTask(ctx context.Context, arg DeleteTaskParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, arg DeleteUserParams) error

func (*Queries) GetAuthToken

func (q *Queries) GetAuthToken(ctx context.Context, token string) (Auth, error)

func (*Queries) GetCategories

func (q *Queries) GetCategories(ctx context.Context) ([]Category, error)

func (*Queries) GetPriorityForTask

func (q *Queries) GetPriorityForTask(ctx context.Context, id string) (TaskPriority, error)

func (*Queries) GetTask

func (q *Queries) GetTask(ctx context.Context, arg GetTaskParams) (Task, error)

func (*Queries) GetTaskCategories

func (q *Queries) GetTaskCategories(ctx context.Context, taskID string) ([]string, error)

func (*Queries) GetTaskPriorities

func (q *Queries) GetTaskPriorities(ctx context.Context) ([]TaskPriority, error)

func (*Queries) GetTasks

func (q *Queries) GetTasks(ctx context.Context, userID string) ([]Task, error)

func (*Queries) GetTasksByDueDate

func (q *Queries) GetTasksByDueDate(ctx context.Context, arg GetTasksByDueDateParams) ([]Task, error)

func (*Queries) GetTasksByPriority

func (q *Queries) GetTasksByPriority(ctx context.Context, arg GetTasksByPriorityParams) ([]Task, error)

func (*Queries) GetTasksByStatus

func (q *Queries) GetTasksByStatus(ctx context.Context, arg GetTasksByStatusParams) ([]Task, error)

func (*Queries) GetTasksLimit

func (q *Queries) GetTasksLimit(ctx context.Context, arg GetTasksLimitParams) ([]Task, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, arg GetUserParams) (User, error)

func (*Queries) GetUsers

func (q *Queries) GetUsers(ctx context.Context) ([]User, error)

func (*Queries) RemoveCategoriesFromTask

func (q *Queries) RemoveCategoriesFromTask(ctx context.Context, arg RemoveCategoriesFromTaskParams) error

func (*Queries) SearchTasks

func (q *Queries) SearchTasks(ctx context.Context, arg SearchTasksParams) ([]Task, error)

func (*Queries) UpdateTask

func (q *Queries) UpdateTask(ctx context.Context, arg UpdateTaskParams) (Task, error)

func (*Queries) UpdateTaskTimestamp

func (q *Queries) UpdateTaskTimestamp(ctx context.Context, id string) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)

func (*Queries) ValidateAuthToken

func (q *Queries) ValidateAuthToken(ctx context.Context, arg ValidateAuthTokenParams) (Auth, error)

func (*Queries) WithTx

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

type RemoveCategoriesFromTaskParams

type RemoveCategoriesFromTaskParams struct {
	TaskID     string
	CategoryID string
}

type SearchTasksParams

type SearchTasksParams struct {
	UserID      string
	Title       string
	Description string
}

type Task

type Task struct {
	ID          string
	Title       string
	Description string
	Status      string
	PriorityID  sql.NullString
	DueDate     sql.NullTime
	CreatedAt   time.Time
	UpdatedAt   time.Time
	UserID      string
}

type TaskCategory

type TaskCategory struct {
	TaskID     string
	CategoryID string
}

type TaskPriority

type TaskPriority struct {
	ID        string
	Name      string
	Level     string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type UpdateTaskParams

type UpdateTaskParams struct {
	Title       string
	Description string
	Status      string
	PriorityID  sql.NullString
	DueDate     sql.NullTime
	ID          string
	UserID      string
}

type UpdateUserParams

type UpdateUserParams struct {
	Username   string
	Password   string
	Email      string
	PrivateKey string
	ID         string
	Username_2 string
	Email_2    string
}

type User

type User struct {
	ID         string
	Username   string
	Password   string
	Email      string
	PrivateKey string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type ValidateAuthTokenParams

type ValidateAuthTokenParams struct {
	Token  string
	UserID string
}

Jump to

Keyboard shortcuts

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