models

package
v0.0.0-...-4118960 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(user User) error

func MakeMigrations

func MakeMigrations()

Types

type Material

type Material struct {
	ID          uint64  `json:"id"`
	CreatedBy   uint64  `json:"created_by"`
	Name        string  `json:"name"`
	Description string  `json:"description,omitempty"`
	Lambda      float32 `json:"lambda"`
	Price       float32 `json:"price,omitempty"`
}

func (*Material) CreateMaterial

func (t *Material) CreateMaterial() (Material, error)

func (*Material) DeleteMaterial

func (t *Material) DeleteMaterial() error

func (*Material) GetAllMaterials

func (t *Material) GetAllMaterials() ([]Material, error)

func (*Material) GetMaterialById

func (t *Material) GetMaterialById() (Material, error)

func (*Material) SearchMaterial

func (t *Material) SearchMaterial(search Search) ([]Material, error)

func (*Material) UpdateMaterial

func (t *Material) UpdateMaterial() (Material, error)
type Search struct {
	Name   string  `json:"name"`
	Lambda float32 `json:"lambda"`
	Price  float32 `json:"price"`
}

type Todo

type Todo struct {
	ID          uint64 `json:"id"`
	CreatedBy   uint64 `json:"created_by"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	Status      bool   `json:"status,omitempty"`
}

func (*Todo) CreateTodo

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

func (*Todo) DeleteTodo

func (t *Todo) DeleteTodo() error

func (*Todo) GetAllTodos

func (t *Todo) GetAllTodos() ([]Todo, error)

func (*Todo) GetNoteById

func (t *Todo) GetNoteById() (Todo, error)

func (*Todo) UpdateTodo

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

type User

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

func CheckEmail

func CheckEmail(email string) (User, error)

func GetUserById

func GetUserById(id string) (User, error)

Jump to

Keyboard shortcuts

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