chat

package
v0.0.0-...-33050dc Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversationManager

type ConversationManager interface {
	CreateSchema(schema string) error
	GetByUserID(userID string, limit int32, offset int32) ([]*pb.Conversation, error)
	GetByID(id string) (*pb.Conversation, error)
	Create(*pb.Conversation) error
	Update(*pb.Conversation) error
	AddMember(cID, memberID string) error
	RemoveMember(cID, memberID string) error
}

type ConversationService

type ConversationService struct {
	// contains filtered or unexported fields
}

func NewConversationService

func NewConversationService(rsaPublicKey []byte, m ConversationManager) (*ConversationService, error)

func (*ConversationService) AddMember

func (*ConversationService) Create

func (*ConversationService) Get

func (*ConversationService) Leave

func (*ConversationService) RemoveMember

type MessageManager

type MessageManager interface {
	CreateSchema(schema string) error
	GetMessages(conversationID string, limit int32, offset int32) ([]*pb.Message, error)
	ReadMessages(cID string, mID string) error
	SaveMessage(ms *pb.Message, conversationID string) error
}

type MessageService

type MessageService struct {
	// contains filtered or unexported fields
}

func NewMessageService

func NewMessageService(rsaPublicKey []byte, m MessageManager, c ConversationManager, nc *nats.EncodedConn) (*MessageService, error)

func (*MessageService) Comunicate

Comunicate Send and Receive Messages or events to/from conversations.

func (*MessageService) GetHistory

GetHistory return the history of messages for an conversation in DESC order.

func (*MessageService) ReadHistory

ReadHistory notifies the reading of messages from a conversation.

Directories

Path Synopsis
Package chatpb is a generated protocol buffer package.
Package chatpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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