chat

package
v2.1.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

README

Chat Service

Chat service provides a generic store for implementing chat rooms attached to any type of objects. Chat rooms has IDs, active users and messages. Events are published on the micro event broker, and as such this service depends on the WebSocket service to forward these events to user's interfaces.

Chat Rooms

Chat Rooms are defined by a Uuid and a RoomType to ease the search. RoomType "attaches" a given room to a given application entity : Workspace, Node, User or Global (no entity).

Currently it is implemented on "nodes" to replace the legacy "meta.comments" plugin, providing one realtime chat per file or folder.

See the common/proto/chat/chat.proto file.

Service

ChatService provides a GRPC handler conforming to the following signature :

service ChatService {
    rpc PutRoom(PutRoomRequest) returns (PutRoomResponse);
    rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse);
    rpc ListRooms(ListRoomsRequest) returns (stream ListRoomsResponse);
    rpc ListMessages(ListMessagesRequest) returns (stream ListMessagesResponse);
    rpc PostMessage(PostMessageRequest) returns (PostMessageResponse);
}

There is no REST service currently for that, as the main interface for communication with clients goes directly from the UX to the grpc service through the websocket channel.

Storage

Current implementation stores all chats and messages in a BoltDB file located in [Application Data Dir]/chats.json.

Documentation

Overview

Package chat provides real-time chats linked to any topics for end users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDAO

func NewDAO(o dao.DAO) dao.DAO

Types

type DAO

type DAO interface {
	dao.DAO
	PutRoom(room *chat.ChatRoom) (*chat.ChatRoom, error)
	DeleteRoom(room *chat.ChatRoom) (bool, error)
	ListRooms(request *chat.ListRoomsRequest) ([]*chat.ChatRoom, error)
	RoomByUuid(byType chat.RoomType, roomUUID string) (*chat.ChatRoom, error)
	ListMessages(request *chat.ListMessagesRequest) ([]*chat.ChatMessage, error)
	PostMessage(request *chat.ChatMessage) (*chat.ChatMessage, error)
	DeleteMessage(message *chat.ChatMessage) error
}

Directories

Path Synopsis
Package grpc provides a Pydio GRPC service for managing chat rooms.
Package grpc provides a Pydio GRPC service for managing chat rooms.

Jump to

Keyboard shortcuts

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