models

package
v1.0.2-0...-93c6762 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID    uint   `gorm:"primaryKey"`
	Key   string `gorm:"column:key"`
	Value string `gorm:"column:value"`
}

Config model

type FollowRequest

type FollowRequest struct {
	Follow   string `json:"follow"`
	Unfollow string `json:"unfollow"`
}

FollowRequest defines a follow request

type Follower

type Follower struct {
	WhoID  uint `gorm:"column:who_id"`
	WhomID uint `gorm:"column:whom_id"`
}

Follower model

type Log

type Log struct {
	Message        string
	Data           interface{}
	AdditionalInfo interface{}
}

Log represents a log message object

type LoginRequest

type LoginRequest struct {
	Username string
	Password string
}

type Message

type Message struct {
	MessageID uint   `gorm:"column:message_id;primaryKey"`
	AuthorID  uint   `gorm:"column:author_id"`
	Text      string `gorm:"column:text"`
	PubDate   int64  `gorm:"column:pub_date"`
	Flagged   int    `gorm:"column:flagged"`
}

Message model structure

type MessageDto

type MessageDto struct {
	Content  string `gorm:"column:text" json:"content"`
	PubDate  int64  `gorm:"column:pub_date" json:"pub_date"`
	Username string `gorm:"column:username" json:"user"`
	Email    string `gorm:"column:email" json:"email"`
}

type MessageRequest

type MessageRequest struct {
	Content string `json:"content"`
}

MessageRequest defines a API POST message

type MessageResponse

type MessageResponse struct {
	Content string `json:"content"`
	PubDate int64  `json:"pub_date"`
	User    string `json:"user"`
}

MessageResponse defines a message response

type MessageViewModel

type MessageViewModel struct {
	Content string `json:"content"`
	PubDate string `json:"pub_date"`
	User    string `json:"user"`
	Email   string `json:"email"`
}

type PageData

type PageData map[string]interface{}

PageData defines data on page whatever and request

type RegisterRequest

type RegisterRequest struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"pwd"`
}

RegisterRequest represents a register request

type User

type User struct {
	UserID   uint      `gorm:"primaryKey"`
	Username string    `gorm:"column:username"`
	Email    string    `gorm:"column:email"`
	PwHash   string    `gorm:"column:pw_hash"`
	Messages []Message `gorm:"foreignKey:AuthorID"`
}

User model

type UserCreateRequest

type UserCreateRequest struct {
	Username  string
	Email     string
	Password  string
	Password2 string
}

Jump to

Keyboard shortcuts

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