repositories

package
v0.0.0-...-9c79e73 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FollowerRepository

type FollowerRepository struct {
	DBClient *mongo.Client
}

func NewFollowerRepository

func NewFollowerRepository(client *mongo.Client) *FollowerRepository

func (*FollowerRepository) Follow

func (r *FollowerRepository) Follow(ctx context.Context, followed, follower string) error

Follow establishes a follow relationship between two users.

The followed parameter represents the ID of the user to be followed.

The follower parameter represents the ID of the user that is following.

func (*FollowerRepository) IsFollowedBy

func (r *FollowerRepository) IsFollowedBy(ctx context.Context, followed, follower string) (*models.Follower, error)

IsFollowedBy queries for a follow relationship between two users. Returns *models.Follower.

The followed parameter represents the ID of the user to be followed.

The follower parameter represents the ID of the user that is following.

func (*FollowerRepository) Unfollow

func (r *FollowerRepository) Unfollow(ctx context.Context, followed, follower string) error

Unfollow de-establishes a follow relationship between two users

The followed parameter represents the ID of the user to be followed.

The follower parameter represents the ID of the user that is following.

Jump to

Keyboard shortcuts

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