models

package
v0.0.0-...-35c4631 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 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 Timestamp

type Timestamp struct {
	CreatedAt time.Time `gorm:"default:current_timestamp" json:"created_at"`
	UpdatedAt time.Time `gorm:"default:current_timestamp" json:"updated_at"`
}

type Todo

type Todo struct {
	ID          string `gorm:"primaryKey;index" json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	IsCompleted bool   `gorm:"default:false" json:"is_completed"`
	Timestamp
	IsDeleted bool   `gorm:"default:false" json:"is_deleted"`
	UserID    string `gorm:"index"`
}

type User

type User struct {
	UID      string `gorm:"primaryKey;column:id;index" json:"id"`
	Email    string `gorm:"unique;index" json:"email"`
	Password string `json:"password"`
	Todos    []Todo `gorm:"foreignKey:UserID"`
	Timestamp
}

Jump to

Keyboard shortcuts

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