services

package
v0.0.0-...-8442f8b Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDateTime

func ConvertDateTime(tz string, dt time.Time) string

Types

type Todo

type Todo struct {
	ID          int       `json:"id"`
	CreatedBy   int       `json:"created_by"`
	Title       string    `json:"title"`
	Description string    `json:"description,omitempty"`
	Status      bool      `json:"status,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty"`
}

type TodoServices

type TodoServices struct {
	Todo      Todo
	TodoStore db.Store
}

func NewTodoServices

func NewTodoServices(t Todo, tStore db.Store) *TodoServices

func (*TodoServices) CreateTodo

func (ts *TodoServices) CreateTodo(t Todo) (Todo, error)

func (*TodoServices) DeleteTodo

func (ts *TodoServices) DeleteTodo(t Todo) error

func (*TodoServices) GetAllTodos

func (ts *TodoServices) GetAllTodos(createdBy int) ([]Todo, error)

func (*TodoServices) GetTodoById

func (ts *TodoServices) GetTodoById(t Todo) (Todo, error)

func (*TodoServices) UpdateTodo

func (ts *TodoServices) UpdateTodo(t Todo) (Todo, error)

type User

type User struct {
	ID       int    `json:"id"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Username string `json:"username"`
}

type UserServices

type UserServices struct {
	User      User
	UserStore db.Store
}

func NewUserServices

func NewUserServices(u User, uStore db.Store) *UserServices

func (*UserServices) CheckEmail

func (us *UserServices) CheckEmail(email string) (User, error)

func (*UserServices) CreateUser

func (us *UserServices) CreateUser(u User) error

Jump to

Keyboard shortcuts

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