models

package
v0.0.0-...-9058691 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClaims

type AuthClaims struct {
	jwt.StandardClaims
	Id       string `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
}

type BroadcastMessage

type BroadcastMessage struct {
	Message map[string]interface{} `json:"message"`
	RoomID  string                 `json:"room_id"`
	Client  *websocket.Conn        `json:"conn"`
}

type Category

type Category string
const (
	Category_Unknown Category = "unknown"
	Category_Friend  Category = "friend"
	Category_Family  Category = "family"
	Category_Work    Category = "work"
	Category_School  Category = "school"
)

func (Category) String

func (c Category) String() string

func (Category) Validate

func (c Category) Validate() (err error)

type Chat

type Chat struct {
	ID        string `json:"id"`
	From      string `json:"from"`
	To        string `json:"to"`
	Msg       string `json:"msg"`
	MsgType   string `json:"msg_type"`
	Timestamp int64  `json:"timestamp"`
}

type Client

type Client struct {
	Conn     *websocket.Conn
	Username string
}

type ContactList

type ContactList struct {
	Username     string `json:"username"`
	LastActivity int64  `json:"last_activity"`
}

type DisconnectMessage

type DisconnectMessage struct {
	RoomID string
	Client *Participant
}

type Message

type Message struct {
	Type string `json:"type"`
	User string `json:"user"`
	Chat Chat   `json:"chat"`
}

type Participant

type Participant struct {
	Conn *websocket.Conn
	Host bool
}

type Resource

type Resource struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type ResourceList

type ResourceList struct {
	ResourceList []Resource `json:"resource"`
}

type Room

type Room struct {
	Id          string `gorm:"primary_key"`
	Name        string
	Description string
	Category    Category
	CreatedAt   time.Time
	UpdatedAt   time.Time
	CreatedBy   string
	User        User `gorm:"foreignKey:CreatedBy"`
}

type RoomSearch

type RoomSearch struct {
	Name        string
	Category    Category
	Description string
}

type User

type User struct {
	Id       string `gorm:"primary_key"`
	Username string `gorm:"not null;unique;type:varchar(20)" json:"username"`
	Email    string `gorm:"not null;unique;type:varchar(32)" json:"email"`
	Password string `gorm:"not null" json:"password"`
	Limit    int    `gorm:"not null" json:"limit"`
}

type UsersList

type UsersList struct {
	TotalCount int64   `json:"total_count"`
	TotalPages int64   `json:"total_pages"`
	Page       int64   `json:"page"`
	Size       int64   `json:"size"`
	HasMore    bool    `json:"has_more"`
	Users      []*User `json:"users"`
}

type Video

type Video struct {
	Id        string
	Name      string
	Url       string
	CreatedAt time.Time
}

video

Jump to

Keyboard shortcuts

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