Documentation
¶
Index ¶
- type Handler
- type MongoDBRepository
- func (r *MongoDBRepository) Create(ctx context.Context, comment *types.Comment) error
- func (r *MongoDBRepository) DeleteByID(ctx context.Context, id string) error
- func (r *MongoDBRepository) FindAll(ctx context.Context) ([]*types.Comment, error)
- func (r *MongoDBRepository) FindCommentPost(ctx context.Context, idPost string) ([]*types.Comment, error)
- func (r *MongoDBRepository) Update(ctx context.Context, id string, c string) error
- type PolicyService
- type RepoProvider
- type Service
- func (s *Service) Create(ctx context.Context, req *types.Comment, idPost string) (*types.Comment, error)
- func (s *Service) DeleteByID(ctx context.Context, id string) error
- func (s *Service) GetAll(ctx context.Context) ([]*types.Comment, error)
- func (s *Service) GetCommentsPost(ctx context.Context, idPost string) ([]*types.Comment, error)
- func (s *Service) Update(ctx context.Context, id string, c *types.Comment) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBRepository ¶
type MongoDBRepository struct {
// contains filtered or unexported fields
}
func NewMongoDBRepo ¶
func NewMongoDBRepo(session *mgo.Session) *MongoDBRepository
func (*MongoDBRepository) DeleteByID ¶
func (r *MongoDBRepository) DeleteByID(ctx context.Context, id string) error
func (*MongoDBRepository) FindCommentPost ¶
type PolicyService ¶
type RepoProvider ¶
type RepoProvider interface { FindAll(ctx context.Context) ([]*types.Comment, error) FindCommentPost(ctx context.Context, idPost string) ([]*types.Comment, error) Create(ctx context.Context, req *types.Comment) error Update(ctx context.Context, id string, c string) error DeleteByID(ctx context.Context, id string) error }
type Service ¶
type Service struct { Repo RepoProvider Policy PolicyService }
func NewService ¶
func NewService(repo RepoProvider, policy PolicyService) *Service
func (*Service) GetCommentsPost ¶
Click to show internal directories.
Click to hide internal directories.