db

package
v0.0.0-...-c427842 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID          int32
	Color       string
	Name        string
	Description string
}

type Config

type Config struct {
	Host     string
	Port     int
	Username string
	Password string
	Database string
}

type ErrNotFound

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

func (*ErrNotFound) Error

func (c *ErrNotFound) Error() string

type Manager

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

func New

func New(c Config) (*Manager, error)

func (*Manager) CreateCategory

func (d *Manager) CreateCategory(ctx context.Context, category Category) (Category, error)

func (*Manager) CreateTask

func (d *Manager) CreateTask(ctx context.Context, task Task) (Task, error)

func (*Manager) CreateTaskFeed

func (d *Manager) CreateTaskFeed(ctx context.Context, taskFeed TaskFeed) (TaskFeed, error)

func (*Manager) CreateUser

func (d *Manager) CreateUser(ctx context.Context, user User) (User, error)

func (*Manager) GetCategory

func (d *Manager) GetCategory(ctx context.Context, name string) (Category, error)

func (*Manager) GetTask

func (d *Manager) GetTask(ctx context.Context, name string) (Task, error)

func (*Manager) GetUser

func (d *Manager) GetUser(ctx context.Context, username string) (User, error)

func (*Manager) ListCategories

func (d *Manager) ListCategories(ctx context.Context) ([]Category, error)

func (*Manager) ListTasks

func (d *Manager) ListTasks(ctx context.Context) ([]Task, error)

func (*Manager) ListTasksFeed

func (d *Manager) ListTasksFeed(ctx context.Context) ([]TaskFeed, error)

func (*Manager) ListUsers

func (d *Manager) ListUsers(ctx context.Context) ([]User, error)

type Task

type Task struct {
	ID           int32
	CategoryID   int32
	AssigneeID   int32
	Name         string
	Description  string
	Points       int32
	IsRepeatable bool
}

type TaskFeed

type TaskFeed struct {
	ID          int32
	AssigneeID  int32
	TaskID      int32
	IsComplete  bool
	IsApproved  bool
	CompletedAt timestamp.Timestamp
	Points      int32
}

type User

type User struct {
	ID       int32
	Username string
	Email    string
	IsAdmin  bool
	IsParent bool
	Avatar   string
	Points   int32
	Password string
	Pin      string
	IsActive bool
}

Jump to

Keyboard shortcuts

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