models

package
v0.0.0-...-470840f Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Follow

type Follow struct {
	Follower  uint `json:"follower" gorm:"primaryKey;foreignKey:ID;"`
	Following uint `json:"following" gorm:"primaryKey;foreignKey:ID;"`
}

type FollowForm

type FollowForm struct {
	Follow   string         `json:"follow" form:"follow"`
	Unfollow string         `json:"unfollow" form:"follow"`
	Latest   pq.StringArray `json:"latest" form:"latest"`
}

type LoginForm

type LoginForm struct {
	Username string `form:"username" binding:"required"`
	Password string `form:"password" binding:"required"`
}

type Message

type Message struct {
	MessageID uint      `json:"messageID" gorm:"primaryKey"`
	Author    string    `json:"authorID" gorm:"foreignKey:Username;"`
	Text      string    `json:"text"`
	CreatedAt time.Time `json:"createdAt"`
	Flagged   bool      `json:"flagged"`
}

type MessageForm

type MessageForm struct {
	Content string `json:"content" form:"content" binding:"required"`
}

type RegisterForm

type RegisterForm struct {
	Username string `json:"username" form:"username" binding:"required"`
	Email    string `json:"email" form:"email" binding:"required"`
	Password string `json:"pwd" form:"password" binding:"required"`
}

type User

type User struct {
	ID       uint   `json:"id" gorm:"primary_key"`
	Username string `json:"username" gorm:"unique;type:varchar(100);not null"`
	Email    string `json:"email" gorm:"type:varchar(100);not null"`
	Salt     string `json:"salt" gorm:"type:varchar(100);not null"`
	Password string `json:"password" gorm:"not null"`
}

Jump to

Keyboard shortcuts

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