models

package
v0.0.0-...-ab52134 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 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 CreateTodoRequest

type CreateTodoRequest struct {
	Title       string `json:"title"`
	Description string `json:"description"`
}

type CreateUserRequest

type CreateUserRequest struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	UserName  string `json:"user_name"`
	Email     string `json:"email"`
	Password  string `json:"password"`
}

type LoginRequest

type LoginRequest struct {
	UserName string `json:"user_name"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	UserName string `json:"user_name"`
	Token    string `json:"token"`
}

type Todo

type Todo struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Completed   bool   `json:"completed"`
}

func NewTodo

func NewTodo(title, description string) (*Todo, error)

func NewTodoUpdate

func NewTodoUpdate(title, description string, completed bool) (*Todo, error)

type UpdateTodoRequest

type UpdateTodoRequest struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Completed   bool   `json:"completed"`
}

type User

type User struct {
	ID        int       `json:"id"`
	FirstName string    `json:"first_name"`
	LastName  string    `json:"last_name"`
	UserName  string    `json:"user_name"`
	Password  string    `json:"password"`
	UserType  string    `json:"user_type"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
}

func NewAccount

func NewAccount(first_name, last_name, password, email, user_name string) (*User, error)

Jump to

Keyboard shortcuts

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