Documentation ¶
Index ¶
- func NewMongoDBRepo(s *mgo.Session) *mongoDBRepo
- func NewService(r repoProvider) *service
- type CreateRequest
- type FriendDB
- type FriendInfo
- type Handler
- func (h *Handler) DeleteFriend(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetFriendById(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetFriendRequests(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetFriends(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LoadRoutes() []router.Route
- func (h *Handler) PostFriend(w http.ResponseWriter, r *http.Request)
- func (h *Handler) PutFriend(w http.ResponseWriter, r *http.Request)
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMongoDBRepo ¶
func NewService ¶
func NewService(r repoProvider) *service
Types ¶
type CreateRequest ¶
type FriendDB ¶
type FriendDB struct { ID string `bson:"_id"` FriendID string `bson:"friend_id"` UserID string `bson:"user_id"` UserTargetID string `bson:"user_target_id"` Accepted bool `bson:"accepted"` AcceptedAt *time.Time `bson:"accepted_at"` CreatedAt *time.Time `bson:"created_at"` UpdatedAt *time.Time `bson:"updated_at"` }
type FriendInfo ¶
type FriendInfo struct { FriendID string `json:"id"` UserID string `json:"user_id"` UserTargetID string `json:"user_target_id"` Accepted bool `json:"accepted"` AcceptedAt *time.Time `json:"accepted_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(s serviceProvider) *Handler
func (*Handler) DeleteFriend ¶
func (h *Handler) DeleteFriend(w http.ResponseWriter, r *http.Request)
func (*Handler) GetFriendById ¶
func (h *Handler) GetFriendById(w http.ResponseWriter, r *http.Request)
func (*Handler) GetFriendRequests ¶
func (h *Handler) GetFriendRequests(w http.ResponseWriter, r *http.Request)
func (*Handler) GetFriends ¶
func (h *Handler) GetFriends(w http.ResponseWriter, r *http.Request)
func (*Handler) LoadRoutes ¶
func (*Handler) PostFriend ¶
func (h *Handler) PostFriend(w http.ResponseWriter, r *http.Request)
type UpdateRequest ¶
type UpdateRequest struct {
Accepted bool `json:"accepted" validator:""`
}
Click to show internal directories.
Click to hide internal directories.