model

package
v0.0.0-...-ef346fd Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserRoleUser  = "USER"
	UserRoleAdmin = "ADMIN"
)

Variables

View Source
var TestUsers = []User{
	{
		Username: "dev",
		Password: "dev",
		Role:     UserRoleUser,
	},
	{
		Username: "admin",
		Password: "admin",
		Role:     UserRoleAdmin,
	},
	{
		Username: "test",
		Password: "test",
		Role:     UserRoleUser,
	},
}

Functions

This section is empty.

Types

type Note

type Note struct {
	ID     int    `db:"note_id" json:"id"`
	Name   string `db:"note_name" json:"name"`
	UserID int    `db:"user_id" json:"userId"`
}

type NoteWithTodos

type NoteWithTodos struct {
	*Note
	Todos []Todo
}

type Todo

type Todo struct {
	ID     int    `db:"todo_id" json:"id"`
	Name   string `db:"todo_name" json:"name"`
	Done   bool   `db:"todo_done" json:"done"`
	NoteID int    `db:"note_id" json:"noteId"`
}

type User

type User struct {
	ID       int    `db:"user_id" json:"id"`
	Username string `db:"user_name" json:"username"`
	Password string `db:"user_password" json:"password"`
	Role     string `db:"user_role" json:"role"`
}

Jump to

Keyboard shortcuts

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