storage

package
v0.0.0-...-23be098 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NewTodoInput

type NewTodoInput struct {
	Title       string
	Description string
	UserId      int
}

type NewUser

type NewUser struct {
	FirstName string
	LastName  string
	Email     string
	Password  string
}

type TodoStorage

type TodoStorage struct {
	Conn *sqlx.DB
}

func NewTodoStorage

func NewTodoStorage(conn *sqlx.DB) *TodoStorage

func (*TodoStorage) CompleteTodo

func (s *TodoStorage) CompleteTodo(todoId int) error

func (*TodoStorage) CreateNewTodo

func (s *TodoStorage) CreateNewTodo(data NewTodoInput) (int, error)

func (*TodoStorage) DeleteTodo

func (s *TodoStorage) DeleteTodo(todoId int) error

func (*TodoStorage) GetAllTodos

func (s *TodoStorage) GetAllTodos(userId int) ([]Todo_DB, error)

func (*TodoStorage) GetOneTodo

func (s *TodoStorage) GetOneTodo(todoId int) (Todo_DB, error)

type Todo_DB

type Todo_DB struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Id          int    `json:"id"`
	Completed   bool   `json:"completed"`
}

type UserStorage

type UserStorage struct {
	Conn *sqlx.DB
}

func NewUserStorage

func NewUserStorage(conn *sqlx.DB) *UserStorage

func (*UserStorage) CreateNewUser

func (s *UserStorage) CreateNewUser(data NewUser) (int, error)

Jump to

Keyboard shortcuts

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