Documentation ¶
Index ¶
- Constants
- func MessageStorePool(msgQueue MessageQueueSvc, msgStore MsgStoreSvc)
- func NewMongoDBRepo(s *mgo.Session) *mongoDBRepo
- func NewService(r repoProvider) *service
- type CreateRequest
- type Handler
- func (h *Handler) DeleteMessage(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAllMessage(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetMessageById(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetMessagesCommunity(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetMessagesUser(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LoadRoutes() []router.Route
- func (h *Handler) PostMessage(w http.ResponseWriter, r *http.Request)
- func (h *Handler) PutMessage(w http.ResponseWriter, r *http.Request)
- type MessageDB
- type MessageInfo
- type MessageQueueSvc
- type MsgStoreSvc
- type UpdateRequest
Constants ¶
View Source
const (
ROUTE_MESSAGE_STORE_SERVICE = "message_store_service"
)
Variables ¶
This section is empty.
Functions ¶
func MessageStorePool ¶
func MessageStorePool(msgQueue MessageQueueSvc, msgStore MsgStoreSvc)
func NewMongoDBRepo ¶
func NewService ¶
func NewService(r repoProvider) *service
Types ¶
type CreateRequest ¶
type CreateRequest struct { SenderId string `json:"sender_id" validate:"required"` SenderType string `json:"sender_type,omitempty" validate:"omitempty"` ReceiverId string `json:"receiver_id" validate:"required"` ReceiverType string `json:"receiver_type,omitempty" validate:"omitempty"` Content string `json:"content" validate:"required"` }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(s serviceProvider) *Handler
func (*Handler) DeleteMessage ¶
func (h *Handler) DeleteMessage(w http.ResponseWriter, r *http.Request)
func (*Handler) GetAllMessage ¶
func (h *Handler) GetAllMessage(w http.ResponseWriter, r *http.Request)
func (*Handler) GetMessageById ¶
func (h *Handler) GetMessageById(w http.ResponseWriter, r *http.Request)
func (*Handler) GetMessagesCommunity ¶
func (h *Handler) GetMessagesCommunity(w http.ResponseWriter, r *http.Request)
func (*Handler) GetMessagesUser ¶
func (h *Handler) GetMessagesUser(w http.ResponseWriter, r *http.Request)
func (*Handler) LoadRoutes ¶
func (*Handler) PostMessage ¶
func (h *Handler) PostMessage(w http.ResponseWriter, r *http.Request)
func (*Handler) PutMessage ¶
func (h *Handler) PutMessage(w http.ResponseWriter, r *http.Request)
type MessageDB ¶
type MessageDB struct { ID string `bson:"_id"` MessageId string `bson:"message_id"` Type string `bson:"type,omitempty"` SenderType string `bson:"sender_type,omitempty"` SenderId string `bson:"sender_id"` ReceiverType string `bson:"receiver_type,omitempty"` ReceiverId string `bson:"receiver_id"` Content string `bson:"content"` CreatedAt *time.Time `bson:"created_at,omitempty"` UpdatedAt *time.Time `bson:"updated_at,omitempty"` }
type MessageInfo ¶
type MessageInfo struct { MessageId string `json:"message_id" bson:"message_id"` Type string `json:"type,omitempty"` SenderType string `json:"sender_type,omitempty"` SenderId string `json:"sender_id"` ReceiverType string `json:"receiver_type,omitempty"` ReceiverId string `json:"receiver_id"` Content string `json:"content" bson:"content"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type MessageQueueSvc ¶
type MsgStoreSvc ¶
type UpdateRequest ¶
type UpdateRequest struct {
Content string `json:"content" validate:"required"`
}
Click to show internal directories.
Click to hide internal directories.