Documentation ¶
Index ¶
- Constants
- type Data
- type DatabaseMessage
- type Manager
- type Message
- type Service
- func (service *Service) CancelSentMessage(request *Kernel.Request)
- func (service *Service) CheckPermission() bool
- func (service *Service) Fetch(ctx context.Context)
- func (service *Service) GetHistoryMessages(request *Kernel.Request)
- func (service *Service) GetMessage(request *Kernel.Request)
- func (service *Service) SendMessage(request *Kernel.Request)
- type ServiceInterface
Constants ¶
View Source
const ( ErrorEmptyContent = "Content_is_empty" ErrorInvalidContent = "Content_is_invalid" ErrorOriginNotEmpty = "Origin_is_not_empty" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseMessage ¶
type Manager ¶
type Manager struct {
Data
}
func NewManager ¶
func NewManager(config Kernel.RethinkConfig, chatRoomID string) *Manager
type Service ¶
Service: this is the struct of Talk Service.
func (*Service) CancelSentMessage ¶
CancelSentMessage: cancel a message delivery by the request of client.
func (*Service) CheckPermission ¶
CheckPermission: check the permission of client.
func (*Service) Fetch ¶
Fetch: do the fetch for data, if there is a change in database, it will throw the event out.
func (*Service) GetHistoryMessages ¶
GetHistoryMessages: get the history messages for client.
func (*Service) GetMessage ¶
GetMessage: get the message specific for client.
func (*Service) SendMessage ¶
SendMessage: send a message by the request of client.
type ServiceInterface ¶
type ServiceInterface interface { Kernel.ServiceInterface GetHistoryMessages(*Kernel.Request) GetMessage(*Kernel.Request) SendMessage(*Kernel.Request) CancelSentMessage(*Kernel.Request) }
func NewServiceInterface ¶
func NewServiceInterface( dbConfig Kernel.RethinkConfig, chatRoomID string, contentValidator func(int, string) bool, readMessagesHook func(*DatabaseMessage), sendMessageHook func(*DatabaseMessage), ) ServiceInterface
NewServiceInterface: create service interface of Talk.
Click to show internal directories.
Click to hide internal directories.