model

package
v0.0.0-...-ad0e59e Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Types

type Credential

type Credential struct {
	ID             int
	RegisterName   string `gorm:"unique"`
	HashedPassword string
}

type Member

type Member struct {
	ID     int
	UserID int
	RoomID int
}

type Message

type Message struct {
	ID           int       `json:"-"`
	CreatedAt    time.Time `json:"createdat"`
	Body         string    `json:"body" gorm:"type:text"`
	RoomID       int       `json:"roomid"`
	UserID       int       `json:"userid"`
	UserShowName string    `json:"usershowname"`
}

type Room

type Room struct {
	ID int `json:"id"`
}

type User

type User struct {
	ID        int    `json:"id,omitempty"`
	ShowName  string `json:"showname,omitempty"`
	Gender    string `json:"gender,omitempty"`
	BirthYear int    `json:"birthyear,omitempty"`

	CredentialID int `json:"-"`
}

Jump to

Keyboard shortcuts

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