structures

package
v0.0.0-...-bede71d Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthErrorResponse

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

type Chat

type Chat struct {
	From    string `json:"from"`
	To      string `json:"to"`
	Message string `json:"message"`
	Target  *Room  `json:"target"`
}

type Claims

type Claims struct {
	ID   float64 `json:"id"`
	Name string  `json:"name"`
	jwt.StandardClaims
}

type Client

type Client struct {
	Conn     *websocket.Conn
	Username string `json:"username"`
	RoomID   string `json:"-"`
}

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Type    string `json:"type,omitempty"`
	Message string `json:"message,omitempty"`
}

type Response

type Response struct {
	Status  bool        `json:"status"`
	Message string      `json:"message"`
	Jwt     string      `json:"jwt"`
	Data    interface{} `json:"data"`
}

type Room

type Room struct {
	ID      string             `json:"id"`
	Name    string             `json:"name"`
	Clients map[string]*Client `json:"-"`
}

func (*Room) AddClientToRoom

func (r *Room) AddClientToRoom(username string, client *Client)

Yeni Oda Oluştur

func (*Room) RemoveClientFromRoom

func (r *Room) RemoveClientFromRoom(username string)

Odayı Sil

type StatusMessage

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

Chat Mesajı

func (*StatusMessage) TableName

func (p *StatusMessage) TableName() string

type User

type User struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*User) TableName

func (p *User) TableName() string

Jump to

Keyboard shortcuts

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