models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Room

type Room struct {
	ID        uint          `gorm:"primarykey" json:"-"`
	CreatedAt time.Time     `json:"-"`
	UpdatedAt time.Time     `json:"-"`
	DeletedAt sql.NullTime  `gorm:"index" json:"-"`
	Name      string        `json:"name" binding:"required,gte=2,lte=20" example:"BirthdayParty"`
	OwnerID   uint          `json:"ownerID,omitempty"`
	UsersID   pq.Int64Array `json:"usersID,omitempty" gorm:"type:integer[]"`
}

type RoomUpdate

type RoomUpdate struct {
	Name string `json:"name,omitempty" binding:"gte=2,lte=20"`
}

func (*RoomUpdate) ToRoom

func (ru *RoomUpdate) ToRoom() *Room

ToRoom converts a RoomUpdate to a Room

type User

type User struct {
	ID        uint         `gorm:"primarykey" json:"-"`
	CreatedAt time.Time    `json:"-"`
	UpdatedAt time.Time    `json:"-"`
	DeletedAt sql.NullTime `gorm:"index" json:"-"`
	Name      string       `json:"name" binding:"required,gte=2,lte=20" example:"Diablox9"`
	Password  string       `json:"-"`
}

type UserUpdate

type UserUpdate struct {
	Name string `json:"name,omitempty" binding:"gte=2,lte=20"`
}

func (*UserUpdate) ToUser

func (u *UserUpdate) ToUser() *User

ToUser converts a UserUpdate to a User

Jump to

Keyboard shortcuts

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