model

package
v0.0.0-...-5f46fbe Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Connect

func Connect()

func NewItem

func NewItem(c *fiber.Ctx, newItem Item) error

func RegisterUser

func RegisterUser(c *fiber.Ctx, registerData RegisterData) error

Types

type Item

type Item struct {
	ID   int           `json:"id"`
	Name template.HTML `json:"name"`
}

func GetAllItems

func GetAllItems(c *fiber.Ctx) ([]Item, error)

func GetItem

func GetItem(c *fiber.Ctx, id int) (*Item, error)

type LoginData

type LoginData struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type RegisterData

type RegisterData struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type User

type User struct {
	Username string `json:"username"`
	Password string `json:"password"`
	ID       string `json:"id"`
	LoggedIn bool
}

func GetUserByID

func GetUserByID(c *fiber.Ctx, id int) (*User, error)

func GetUserByName

func GetUserByName(c *fiber.Ctx, username string) (*User, error)

Jump to

Keyboard shortcuts

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