models

package
v0.0.0-...-159e443 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDatabase

func InitDatabase() (db *gorm.DB, err error)

InitDatabase function initialize database

Types

type Accesstoken

type Accesstoken struct {
	gorm.Model

	Token  string
	User   User
	UserID uint
}

Accesstoken Model Object

type Login

type Login struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Login Object

type Message

type Message struct {
	gorm.Model

	From    User
	FromID  uint
	To      User
	ToID    uint
	Message string
}

Message is a message response

type MessageCreate

type MessageCreate struct {
	Message string `json:"message"`
}

MessageCreate is a message creation object

type MessageResponse

type MessageResponse struct {
	Message   string    `json:"message"`
	CreatedAt time.Time `json:"created_at"`
	FromUser  string    `json:"from"`
	ToUser    string    `json:"to"`
}

MessageResponse is a API message response

type Signup

type Signup struct {
	Username string `json:"username"`
	Password string `json:"password"`
	FullName string `json:"fullname"`
}

Signup Object

type User

type User struct {
	gorm.Model

	Username string `json:"username"`
	FullName string `json:"fullname"`
	Password string `json:"-"`
}

User Model Object

Jump to

Keyboard shortcuts

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