entity

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Follow added in v0.1.21

type Follow struct {
	gorm.Model
	Uuid        *uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	UserID      uint
	User        *User
	Following   *User
	FollowingID uint `gorm:"foreignkey:User"`
}

type Notification

type Notification struct {
	gorm.Model
	Uuid              *uuid.UUID             `gorm:"type:uuid;default:uuid_generate_v4()"`
	Seen              bool                   `gorm:"default:false"`
	Link              string                 `gorm:"not null"`
	NotificationType  model.NotificationType `gorm:"index"`
	UserID            uint                   `gorm:"index"`
	User              *User
	TriggeredByUserID uint `gorm:"index"`
	TriggeredByUser   *User
}

type Post added in v0.1.18

type Post struct {
	gorm.Model
	Text       string
	Draft      bool
	UserID     uint
	User       *User
	Visibility model.Visibility `gorm:"default:'public'"`
	Uuid       *uuid.UUID       `gorm:"type:uuid;default:uuid_generate_v4()"`
}

func (*Post) UpdatePostFromModel added in v0.1.18

func (p *Post) UpdatePostFromModel(post *model.Post)

type User

type User struct {
	gorm.Model
	Uuid       *uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	Username   string     `gorm:"unique;not null"`
	ProfilePic string
	Name       string
	Role       string `gorm:"default:'user'"`
	IsBanned   bool   `gorm:"default:false"`
}

func (*User) UpdateUserProfileFromModel

func (u *User) UpdateUserProfileFromModel(user *model.User)

Jump to

Keyboard shortcuts

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