command
module
Version:
v0.0.0-...-35669d6
Opens a new window with list of versions in this module.
Published: Jul 10, 2023
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Go-Chat
Fast Fiber-ous Chat Application
Currently Supports:
- Creation of chatrooms!
- Adding users to chatroom!
- Messaging to chatroom using Pure Websockets
Upcoming Features:
- Invite to Chatrooms
- Delete Messages
- Tag Users
- Search for Users
- Email Verification
- Client Website and Application
Last Update:
- Added New Chat API (v2) with a different Auth Method
API Routes:
Users /api/v1/auth
/register
: Register a new user
- Method :
POST
- Body :
{
"username": "username",
"email": "abc@xyz.com",
"password": "password"
}
- Response :
{
"error": false,
"message": "User Registered Successfully",
"access_token":"",
"refresh_token":""
}
/login
: Login a user
- Method :
POST
- Body :
{
"email": "abc@xyz.com",
"password": "password"
}
- Response :
{
"error": false,
"message": "Logged in Successfully",
"access_token":"",
"refresh_token":""
}
/refresh
: Refresh a JWT Token
/current-user
: Get the current user
/user
: Get a user by their email
Chats /api/v1/chat
/chats
: Get all chats
- Method :
GET
- Response :
{
"chats": [
{
"chat_id": "chat_id",
"chat_name": "chat_name",
"chat_users": [
"user_id",
"user_id"
]
},
{
"chat_id": "chat_id",
"chat_name": "chat_name",
"chat_users": [
"user_id",
"user_id"
]
}
]
}
/chats
: Create a Chat
- Method :
POST
- Body :
{
"name": "Chat Name",
"users": ["User1", "User2"] // User IDs
}
- Response :
{
"error": false,
"message": "Chat Created Successfully",
"chat": {
"id": "Chat ID",
"name": "Chat Name",
"users": ["User1", "User2"] // User IDs
}
}
/chats
: Update a Chat
- Method :
PUT
- Body :
{
"name": "Chat Name", //[Optional]
"users": ["User1", "User2"] // User IDs [Optional]
}
- Response :
{
"error": false,
"message": "Chat Updated Successfully",
"chat": {
"id": "Chat ID",
"name": "Chat Name", // Updated Name
"users": ["User1", "User2"] // User IDs , Updated Valid USERIDS
}
}
Chats /api/v1/chat
[WebSockets]
- /<sess_id>/<chat_id>
<sess_id>
: User's JWT access Token
<chat_id>
: Chat ID to join.
Creates a Websocket Connection.
Chats /api/v2/chat
[WebSockets] [NEW]
- /<sess_id>
<sess_id>
: User's JWT access Token
User is authenticated
To connect to chatroom send TEXTMessage: "!startChat <chat_id>"
How to Run:
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.