Documentation ¶
Index ¶
- func NewHTTPRouter(logger *logrus.Entry, handlers RouterHandlers) *http.Server
- type AllChatsProjectionChat
- type AllChatsResponse
- type AllChatsUpdatedRequest
- type AllChatsUpdatedSSEHandler
- type Chat
- type ChatRepository
- type ChatUpdatedSSEHandler
- type CreateChatHandler
- type CreateChatRequest
- type ErrorMessage
- type Message
- type RouterHandlers
- type SendMessageHandler
- type SendMessageRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPRouter ¶
func NewHTTPRouter( logger *logrus.Entry, handlers RouterHandlers, ) *http.Server
Types ¶
type AllChatsProjectionChat ¶
type AllChatsResponse ¶
type AllChatsResponse struct {
Chats []AllChatsProjectionChat `json:"chats"`
}
type AllChatsUpdatedRequest ¶
type AllChatsUpdatedRequest struct {
UserID string `json:"user_id"`
}
type AllChatsUpdatedSSEHandler ¶
type AllChatsUpdatedSSEHandler struct {
AllChatsUpdated http.HandlerFunc
}
func NewAllChatsUpdatedSSEHandler ¶
func NewAllChatsUpdatedSSEHandler(sseRouter *watermillHttp.SSERouter, logger watermill.LoggerAdapter, ctx context.Context) AllChatsUpdatedSSEHandler
type ChatRepository ¶
type ChatUpdatedSSEHandler ¶
type ChatUpdatedSSEHandler struct {
ChatUpdated http.HandlerFunc
}
func NewChatUpdatedSSEHandler ¶
func NewChatUpdatedSSEHandler(sseRouter *watermillHttp.SSERouter, repository ChatRepository, logger watermill.LoggerAdapter) ChatUpdatedSSEHandler
type CreateChatHandler ¶
type CreateChatHandler struct {
// contains filtered or unexported fields
}
func NewCreateChatHandler ¶
func NewCreateChatHandler(logger watermill.LoggerAdapter, pubsub pubsub.PubSub, ctx context.Context) CreateChatHandler
func (CreateChatHandler) Handle ¶
func (h CreateChatHandler) Handle(w http.ResponseWriter, r *http.Request)
type CreateChatRequest ¶
type ErrorMessage ¶
type ErrorMessage struct { // Application-level error message, for debugging Error *string `json:"error,omitempty"` // User-level status message Status string `json:"status"` }
ErrorMessage defines model for ErrorMessage.
type RouterHandlers ¶
type RouterHandlers struct { ChatUpdated ChatUpdatedSSEHandler AllChatsUpdated AllChatsUpdatedSSEHandler SendMessage SendMessageHandler CreateChat CreateChatHandler }
func NewHandlers ¶
func NewHandlers( ctx context.Context, logger watermill.LoggerAdapter, sseRouter *watermillHttp.SSERouter, repository ChatRepository, pubsub pubsub.PubSub, ) RouterHandlers
type SendMessageHandler ¶
type SendMessageHandler struct {
// contains filtered or unexported fields
}
func NewSendMessageHandler ¶
func NewSendMessageHandler(logger watermill.LoggerAdapter, pubsub pubsub.PubSub, ctx context.Context) SendMessageHandler
func (SendMessageHandler) Handle ¶
func (h SendMessageHandler) Handle(w http.ResponseWriter, r *http.Request)
type SendMessageRequest ¶
type SendMessageRequest struct {
Message Message `json:"message"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.