user

package
v0.0.0-...-dd01cb3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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) Delete

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

func (*Handler) GetAll

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

func (*Handler) LoadNoti

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

func (*Handler) Register

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

func (*Handler) Routes

func (h *Handler) Routes() []router.Route

func (*Handler) Update

func (h *Handler) Update(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) CheckUserEnrolled

func (r *MongoDBRepository) CheckUserEnrolled(ctx context.Context, idUser string, idCom string) (string, error)

func (*MongoDBRepository) Create

func (r *MongoDBRepository) Create(ctx context.Context, user *types.User) error

func (*MongoDBRepository) Delete

func (r *MongoDBRepository) Delete(ctx context.Context, id string) error

func (*MongoDBRepository) EnrollUser

func (r *MongoDBRepository) EnrollUser(ctx context.Context, idUser string, idCom string) error

func (*MongoDBRepository) FindAll

func (r *MongoDBRepository) FindAll(context.Context) ([]*types.User, error)

func (*MongoDBRepository) FindUserByMail

func (r *MongoDBRepository) FindUserByMail(ctx context.Context, email string) (*types.User, error)

func (*MongoDBRepository) GetMods

func (r *MongoDBRepository) GetMods(ctx context.Context, listID []string) ([]*types.User, error)

func (*MongoDBRepository) GetUsersCommunity

func (r *MongoDBRepository) GetUsersCommunity(ctx context.Context, idCom string) ([]*types.User, error)

func (*MongoDBRepository) UpdateInfo

func (r *MongoDBRepository) UpdateInfo(ctx context.Context, userID string, user *types.User) error

type NotiService

type NotiService interface {
	LoadNotiUser(ctx context.Context, userID string) ([]*types.PushNotification, error)
}

type PolicyService

type PolicyService interface {
	Validate(ctx context.Context, obj string, act string) error
}

type Service

type Service struct {
	Repo repoProvider
	// contains filtered or unexported fields
}

func NewService

func NewService(repo repoProvider, policySvc PolicyService, notiSvc NotiService) *Service

func (*Service) Auth

func (s *Service) Auth(ctx context.Context, email, password string) (*types.User, error)

func (*Service) CheckUserEnrolled

func (s *Service) CheckUserEnrolled(ctx context.Context, idUser string, idCom string) (string, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, userID string) error

func (*Service) EnrollUser

func (s *Service) EnrollUser(ctx context.Context, idCom, idUser string) error

func (*Service) FindAll

func (s *Service) FindAll(ctx context.Context) ([]*types.User, error)

func (*Service) GetMods

func (s *Service) GetMods(ctx context.Context, listID []string) ([]*types.User, error)

func (*Service) GetUsersCommunity

func (s *Service) GetUsersCommunity(ctx context.Context, idCom string) ([]*types.User, error)

func (*Service) LoadNotification

func (s *Service) LoadNotification(ctx context.Context, ID string) ([]*types.PushNotification, error)

func (*Service) Register

func (s *Service) Register(ctx context.Context, req *types.RegisterRequest) (*types.User, error)

func (*Service) SearchUser

func (s *Service) SearchUser(ctx context.Context, req *types.User) (*types.User, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, userID string, user *types.User) error

Jump to

Keyboard shortcuts

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