friend

package
v0.0.0-...-3773cab Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMongoDBRepo

func NewMongoDBRepo(s *mgo.Session) *mongoDBRepo

func NewService

func NewService(r repoProvider) *service

Types

type CreateRequest

type CreateRequest struct {
	UserID       string `json:"user_id" validator:""`
	UserTargetID string `json:"user_target_id" validator:""`
}

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 InitHandlerMongoDBInjected

func InitHandlerMongoDBInjected(s *mgo.Session) *Handler

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 (h *Handler) LoadRoutes() []router.Route

func (*Handler) PostFriend

func (h *Handler) PostFriend(w http.ResponseWriter, r *http.Request)

func (*Handler) PutFriend

func (h *Handler) PutFriend(w http.ResponseWriter, r *http.Request)

type UpdateRequest

type UpdateRequest struct {
	Accepted bool `json:"accepted" validator:""`
}

Jump to

Keyboard shortcuts

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