Documentation
¶
Overview ¶
Mongo implements the repository.Group interface.
Index ¶
- type MongoRepository
- func (p *MongoRepository) AddMembers(ctx context.Context, userID []uuid.UUID, groupID uuid.UUID) error
- func (r *MongoRepository) BuildIndexes(ctx context.Context) error
- func (m *MongoRepository) Count(ctx context.Context) (int64, error)
- func (r *MongoRepository) CountMembers(ctx context.Context, groupID uuid.UUID) (uint64, error)
- func (m *MongoRepository) Create(ctx context.Context, group *group.Group) (*group.Group, error)
- func (m *MongoRepository) Delete(ctx context.Context, groupID uuid.UUID) error
- func (m *MongoRepository) DeleteAll(ctx context.Context) error
- func (m *MongoRepository) Get(ctx context.Context, groupID uuid.UUID) (*group.Group, error)
- func (m *MongoRepository) GetByName(ctx context.Context, name string) (*group.Group, error)
- func (m *MongoRepository) List(ctx context.Context, pagination *model.Pagination, search string) (iterator.Iterator[*group.Group], uint64, error)
- func (r *MongoRepository) ListGroupsForUser(ctx context.Context, userID uuid.UUID, pagination *model.Pagination) (iterator.Iterator[uuid.UUID], uint64, error)
- func (r *MongoRepository) ListMembers(ctx context.Context, groupID uuid.UUID, pagination *model.Pagination) (iterator.Iterator[uuid.UUID], uint64, error)
- func (p *MongoRepository) RemoveMember(ctx context.Context, userID, groupID uuid.UUID) error
- func (p *MongoRepository) RemoveMemberFromAll(ctx context.Context, userID uuid.UUID) error
- func (m *MongoRepository) Update(ctx context.Context, group *group.Group) (*group.Group, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoRepository ¶
type MongoRepository struct { GroupsCollection *mongo.Collection MembersCollection *mongo.Collection }
func NewRepository ¶
func NewRepository(c *mongo.Client) (*MongoRepository, error)
func (*MongoRepository) AddMembers ¶
func (*MongoRepository) BuildIndexes ¶
func (r *MongoRepository) BuildIndexes(ctx context.Context) error
func (*MongoRepository) Count ¶
func (m *MongoRepository) Count(ctx context.Context) (int64, error)
Count returns a total count of groups in database.
func (*MongoRepository) CountMembers ¶
func (*MongoRepository) List ¶
func (m *MongoRepository) List(ctx context.Context, pagination *model.Pagination, search string) (iterator.Iterator[*group.Group], uint64, error)
List implements group_repository.GroupRepository
func (*MongoRepository) ListGroupsForUser ¶
func (*MongoRepository) ListMembers ¶
func (*MongoRepository) RemoveMember ¶
func (*MongoRepository) RemoveMemberFromAll ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.