model

package
v0.0.0-...-256c714 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 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 Friendship

type Friendship struct {
	RequesterID int64     `gorm:"primaryKey;column:requester"`
	AccepterID  int64     `gorm:"primaryKey;column:accepter"`
	CreatedAt   time.Time `gorm:"column:created_at"`

	Requester *User `gorm:"foreignKey:RequesterID;references:ID"`
	Accepter  *User `gorm:"foreignKey:AccepterID;references:ID"`
}

type User

type User struct {
	ID      int64  `gorm:"primaryKey" json:"id"`
	Name    string `gorm:"not null" json:"name"`
	Surname string `gorm:"not null" json:"surname"`
	Email   string `gorm:"uniqueIndex;not null" json:"email"`

	Friends  []*Friendship `gorm:"foreignKey:RequesterID"`
	FriendOf []*Friendship `gorm:"foreignKey:AccepterID"`
}

Jump to

Keyboard shortcuts

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