follow

package
v0.0.0-...-1967991 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Service Service
}

func (Controller) ListRoutes

func (controller Controller) ListRoutes() []route.Route

type Dao

type Dao interface {
	FollowUser(followerUuid uuid.UUID, followingUuid uuid.UUID) (bool, error)
	UnfollowUser(followerUuid uuid.UUID, followingUuid uuid.UUID) (bool, error)
	GetFollowersPageAs(userUuid uuid.UUID, searchAsUuid uuid.UUID, afterFollowerId uuid.UUID, afterUsername string) ([]user.ModelUserWithCustom, error)
	GetFollowingsPageAs(userUuid uuid.UUID, searchAsUuid uuid.UUID, afterFollowerId uuid.UUID, afterUsername string) ([]user.ModelUserWithCustom, error)
}

type DbDao

type DbDao struct {
	Db database.AppDatabase
}

func (DbDao) FollowUser

func (db DbDao) FollowUser(followerUuid uuid.UUID, followingUuid uuid.UUID) (bool, error)

func (DbDao) GetFollowersPageAs

func (db DbDao) GetFollowersPageAs(userUuid uuid.UUID, searchAsUuid uuid.UUID, afterFollowerId uuid.UUID, afterUsername string) ([]user.ModelUserWithCustom, error)

func (DbDao) GetFollowingsPageAs

func (db DbDao) GetFollowingsPageAs(userUuid uuid.UUID, searchAsUuid uuid.UUID, afterFollowerId uuid.UUID, afterUsername string) ([]user.ModelUserWithCustom, error)

func (DbDao) UnfollowUser

func (db DbDao) UnfollowUser(followerUuid uuid.UUID, followingUuid uuid.UUID) (bool, error)

type Service

type Service interface {
	FollowUser(followerId string, followingId string) error
	UnfollowUser(followerId string, followingId string) error
	ListFollowersAs(userId string, searchAs string, pageCursor string) ([]user.User, *string, error)
	ListFollowingsAs(userId string, searchAs string, pageCursor string) ([]user.User, *string, error)
}

type ServiceImpl

type ServiceImpl struct {
	Db          Dao
	BanService  user.BanService
	UserService user.Service
}

func NewServiceImpl

func NewServiceImpl(db Dao, banService user.BanService, userService user.Service) ServiceImpl

func (ServiceImpl) FollowUser

func (service ServiceImpl) FollowUser(followerId string, followingId string) error

func (ServiceImpl) ListFollowersAs

func (service ServiceImpl) ListFollowersAs(userId string, searchAs string, pageCursor string) ([]user.User, *string, error)

func (ServiceImpl) ListFollowingsAs

func (service ServiceImpl) ListFollowingsAs(userId string, searchAs string, pageCursor string) ([]user.User, *string, error)

func (ServiceImpl) UnfollowUser

func (service ServiceImpl) UnfollowUser(followerId string, followingId string) error

Jump to

Keyboard shortcuts

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