Documentation
¶
Index ¶
- type Handler
- func (h *Handler) CreateCommunity(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteCom(w http.ResponseWriter, r *http.Request)
- func (h *Handler) EnrollUser(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAllCommunity(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAllMods(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAllPosts(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetCommunity(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetUsers(w http.ResponseWriter, r *http.Request)
- func (h *Handler) PromoteMod(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Routes() []router.Route
- func (h *Handler) SubmitPost(w http.ResponseWriter, r *http.Request)
- func (h *Handler) TransferAdmin(w http.ResponseWriter, r *http.Request)
- func (h *Handler) UpdateInfo(w http.ResponseWriter, r *http.Request)
- type MongoDBRepository
- func (r *MongoDBRepository) ChangeStatus(ctx context.Context, id string, status types.CommunityStatus) error
- func (r *MongoDBRepository) Create(ctx context.Context, com *types.Community) error
- func (r *MongoDBRepository) Delete(ctx context.Context) error
- func (r *MongoDBRepository) FindAllCom(context.Context) ([]*types.Community, error)
- func (r *MongoDBRepository) FindCommunityByID(ctx context.Context, cID string) (*types.Community, error)
- func (r *MongoDBRepository) FindCommunityByName(ctx context.Context, cName string) (*types.Community, error)
- func (r *MongoDBRepository) UpdateInfo(ctx context.Context, idCom string, comm *types.Community) error
- type NotifiService
- type PolicyService
- type PostService
- type RepoProvider
- type Service
- func (s *Service) CreateCommunity(ctx context.Context, cm *types.Community) (*types.Community, error)
- func (s *Service) EnrollUser(ctx context.Context, idCom string) error
- func (s *Service) FindAllUserID(ctx context.Context, idCom string) ([]string, error)
- func (s *Service) GetAll(ctx context.Context) ([]*types.Community, error)
- func (s *Service) GetAllMods(ctx context.Context, idCom string) ([]*types.User, error)
- func (s *Service) GetAllPosts(ctx context.Context, nameComm string) ([]*types.Post, error)
- func (s *Service) GetCommunity(ctx context.Context, name string) (*types.Community, error)
- func (s *Service) GetUsers(ctx context.Context, idCom string) ([]*types.User, error)
- func (s *Service) PrivateCommunity(ctx context.Context, Com string) error
- func (s *Service) PromoteUser(ctx context.Context, idUser string, idCom string) error
- func (s *Service) SearchCommunity(ctx context.Context, name string) (*types.Community, error)
- func (s *Service) SubmitPost(ctx context.Context, nameComm string, req *types.Post) (*types.Post, error)
- func (s *Service) TransferAdmin(ctx context.Context, idUser, nameCom string) error
- func (s *Service) UpdateInfo(ctx context.Context, idCom string, comm *types.Community) error
- type UserIDPolicyRequest
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
Svc service
}
func NewHandler ¶
func NewHandler(svc service) *Handler
func (*Handler) CreateCommunity ¶
func (h *Handler) CreateCommunity(w http.ResponseWriter, r *http.Request)
func (*Handler) EnrollUser ¶
func (h *Handler) EnrollUser(w http.ResponseWriter, r *http.Request)
func (*Handler) GetAllCommunity ¶
func (h *Handler) GetAllCommunity(w http.ResponseWriter, r *http.Request)
func (*Handler) GetAllMods ¶
func (h *Handler) GetAllMods(w http.ResponseWriter, r *http.Request)
func (*Handler) GetAllPosts ¶
func (h *Handler) GetAllPosts(w http.ResponseWriter, r *http.Request)
func (*Handler) GetCommunity ¶
func (h *Handler) GetCommunity(w http.ResponseWriter, r *http.Request)
func (*Handler) PromoteMod ¶
func (h *Handler) PromoteMod(w http.ResponseWriter, r *http.Request)
func (*Handler) SubmitPost ¶
func (h *Handler) SubmitPost(w http.ResponseWriter, r *http.Request)
func (*Handler) TransferAdmin ¶
func (h *Handler) TransferAdmin(w http.ResponseWriter, r *http.Request)
func (*Handler) UpdateInfo ¶
func (h *Handler) UpdateInfo(w http.ResponseWriter, r *http.Request)
type MongoDBRepository ¶
type MongoDBRepository struct {
// contains filtered or unexported fields
}
func NewMongoDBRepo ¶
func NewMongoDBRepo(session *mgo.Session) *MongoDBRepository
func (*MongoDBRepository) ChangeStatus ¶
func (r *MongoDBRepository) ChangeStatus(ctx context.Context, id string, status types.CommunityStatus) error
func (*MongoDBRepository) FindAllCom ¶
func (*MongoDBRepository) FindCommunityByID ¶
func (*MongoDBRepository) FindCommunityByName ¶
func (*MongoDBRepository) UpdateInfo ¶
type NotifiService ¶
type PolicyService ¶
type PostService ¶
type RepoProvider ¶
type RepoProvider interface { Create(ctx context.Context, com *types.Community) error FindCommunityByID(ctx context.Context, cID string) (*types.Community, error) FindAllCom(context.Context) ([]*types.Community, error) FindCommunityByName(ctx context.Context, cName string) (*types.Community, error) ChangeStatus(ctx context.Context, id string, status types.CommunityStatus) error UpdateInfo(ctx context.Context, idCom string, comm *types.Community) error }
type Service ¶
type Service struct { Repo RepoProvider // contains filtered or unexported fields }
func NewService ¶
func NewService(repo RepoProvider, policySvc PolicyService, postSvc PostService, userSvc UserService, notiSvc NotifiService) *Service
func (*Service) CreateCommunity ¶
func (*Service) FindAllUserID ¶
func (*Service) GetAllMods ¶
------------------------------------------------------------------------------------------------> HERE!!!!!!!!!!!!!!!!!!
func (*Service) GetAllPosts ¶
func (*Service) GetCommunity ¶
func (*Service) PrivateCommunity ¶
func (*Service) PromoteUser ¶
func (*Service) SearchCommunity ¶
func (*Service) SubmitPost ¶
func (*Service) TransferAdmin ¶
type UserIDPolicyRequest ¶
type UserIDPolicyRequest struct {
ID string `json:"id"`
}
type UserService ¶
type UserService interface { EnrollUser(ctx context.Context, idCom, idUser string) error CheckUserEnrolled(ctx context.Context, idUser string, idCom string) (string, error) GetUsersCommunity(ctx context.Context, idCom string) ([]*types.User, error) GetMods(ctx context.Context, listID []string) ([]*types.User, error) }
Click to show internal directories.
Click to hide internal directories.