Documentation
¶
Index ¶
- type FriendServe
- type FriendshipService
- type UserServe
- func (US *UserServe) CreateUser(user *model.User, ctx context.Context) error
- func (US *UserServe) DeleteUser(id int64, ctx context.Context) error
- func (US *UserServe) GetUserByID(id int64, ctx context.Context) (*model.User, error)
- func (US *UserServe) ListUsers(ctx context.Context) ([]model.User, error)
- func (US *UserServe) UpdateUser(user *model.User, ctx context.Context) error
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FriendServe ¶
type FriendServe struct {
Repo repository.FriendRepository
UserRepo repository.UserRepository
}
FriendServe
func NewFriendService ¶
func NewFriendService(friendRepo repository.FriendRepository, userRepo repository.UserRepository) FriendServe
func (*FriendServe) AddFriend ¶
func (FS *FriendServe) AddFriend(user, friend int64, ctx context.Context) error
func (*FriendServe) GetFriends ¶
func (*FriendServe) RemoveFriend ¶
func (FS *FriendServe) RemoveFriend(user, friend int64, ctx context.Context) error
type FriendshipService ¶
type UserServe ¶
type UserServe struct {
Repo repository.UserRepository
}
UserServe
func NewUserService ¶
func NewUserService(userRepo repository.UserRepository) UserServe
func (*UserServe) CreateUser ¶
func (*UserServe) GetUserByID ¶
type UserService ¶
type UserService interface {
CreateUser(user *model.User, ctx context.Context) error
GetUserByID(id int64, ctx context.Context) (*model.User, error)
ListUsers(ctx context.Context) ([]model.User, error)
DeleteUser(id int64, ctx context.Context) error
UpdateUser(user *model.User, ctx context.Context) error
}
Click to show internal directories.
Click to hide internal directories.