service

package
v0.0.0-...-0064678 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestLogger

func TestLogger(t *testing.T) *logrus.Entry

TestLogger ...

Types

type AuthService

type AuthService interface {
	SignupUser(ctx context.Context, request *dto.SignupUserRequest, userID string, token string) (*dto.SignupUserResponse, error)
	LoginUser(ctx context.Context, userID string, token string) (*dto.LoginUserResponse, error)
}

func NewAuthService

func NewAuthService(log *logrus.Entry, db *db.Repository) AuthService

type AuthServiceImpl

type AuthServiceImpl struct {
	// contains filtered or unexported fields
}

func (*AuthServiceImpl) LoginUser

func (svc *AuthServiceImpl) LoginUser(ctx context.Context, userID string, token string) (*dto.LoginUserResponse, error)

func (*AuthServiceImpl) SignupUser

func (svc *AuthServiceImpl) SignupUser(ctx context.Context, request *dto.SignupUserRequest, userID string, token string) (*dto.SignupUserResponse, error)

type ChatService

type ChatService interface {
	CreateChat(ctx context.Context, request *dto.CreateChatRequest) (*dto.CreateChatResponse, error)
	GetDialogs(ctx context.Context, request *dto.GetDialogsRequest) (*dto.GetDialogsResponse, error)
	GetDialog(ctx context.Context, request *dto.GetDialogRequest) (*dto.GetDialogResponse, error)
	GetDialogByUserID(ctx context.Context, request *dto.GetDialogByUserIDRequest, currentUserID string) (*dto.GetDialogByUserIDResponse, error)

	SendMessage(ctx context.Context, request *dto.SendMessageRequest) (*dto.SendMessageResponse, error)
	ReadMessage(ctx context.Context, request *dto.ReadMessageRequest) (*dto.ReadMessageResponse, error)
	CheckDialog(ctx context.Context, request *dto.CheckDialogRequest) error
}

func NewChatService

func NewChatService(log *logrus.Entry, db *db.Repository) ChatService

type CommentService

type CommentService interface {
	CreateComment(ctx context.Context, request *dto.CreateCommentRequest, userID string) (*dto.CreateCommentResponse, error)
	GetComments(ctx context.Context, request *dto.GetCommentsRequest) (*dto.GetCommentsResponse, error)
	EditComment(ctx context.Context, request *dto.EditCommentRequest, userID string) (*dto.EditCommentResponse, error)
	DeleteComment(ctx context.Context, request *dto.DeleteCommentRequest, userID string) (*dto.DeleteCommentResponse, error)
}

func NewCommentService

func NewCommentService(log *logrus.Entry, db *db.Repository) CommentService

type CommentServiceImpl

type CommentServiceImpl struct {
	// contains filtered or unexported fields
}

func (*CommentServiceImpl) CreateComment

func (svc *CommentServiceImpl) CreateComment(ctx context.Context, request *dto.CreateCommentRequest, userID string) (*dto.CreateCommentResponse, error)

func (*CommentServiceImpl) DeleteComment

func (svc *CommentServiceImpl) DeleteComment(ctx context.Context, request *dto.DeleteCommentRequest, userID string) (*dto.DeleteCommentResponse, error)

func (*CommentServiceImpl) EditComment

func (svc *CommentServiceImpl) EditComment(ctx context.Context, request *dto.EditCommentRequest, userID string) (*dto.EditCommentResponse, error)

func (*CommentServiceImpl) GetComments

type CommunityService

type CommunityService interface {
	CreateCommunity(ctx context.Context, request *dto.CreateCommunityRequest, userID string) (*dto.CreateCommunityResponse, error)
	DeleteCommunity(ctx context.Context, request *dto.DeleteCommunityRequest, userID string) (*dto.DeleteCommunityResponse, error)
	EditCommunity(ctx context.Context, request *dto.EditCommunityRequest, userID string) (*dto.EditCommunityResponse, error)
	GetCommunity(ctx context.Context, request *dto.GetCommunityRequest) (*dto.GetCommunityResponse, error)
	GetCommunityPosts(ctx context.Context, request *dto.GetCommunityPostsRequest, userID string) (*dto.GetCommunityPostsResponse, error)
	GetUserCommunities(ctx context.Context, request *dto.GetUserCommunitiesRequest) (*dto.GetUserCommunitiesResponse, error)
	GetUserManageCommunities(ctx context.Context, request *dto.GetUserManageCommunitiesRequest) (*dto.GetUserManageCommunitiesResponse, error)
	JoinCommunity(ctx context.Context, request *dto.JoinCommunityRequest, userID string) (*dto.JoinCommunityResponse, error)
	LeaveCommunity(ctx context.Context, request *dto.LeaveCommunityRequest, userID string) (*dto.LeaveCommunityResponse, error)
	SearchCommunities(ctx context.Context, request *dto.SearchCommunitiesRequest) (*dto.SearchCommunitiesResponse, error)
	GetFollowers(ctx context.Context, request *dto.GetFollowersRequest) (*dto.GetFollowersResponse, error)
	GetCommunities(ctx context.Context, request *dto.GetCommunitiesRequest) (*dto.GetCommunitiesResponse, error)
	UpdatePhoto(ctx context.Context, request *dto.UpdatePhotoCommunityRequest, url string, userID string) (*dto.UpdatePhotoCommunityResponse, error)
	GetMutualFriends(ctx context.Context, request *dto.GetMutualFriendsRequest, userID string) (*dto.GetMutualFriendsResponse, error)

	CreatePostCommunity(ctx context.Context, request *dto.CreatePostCommunityRequest, userID string) (*dto.CreatePostCommunityResponse, error)
	DeletePostCommunity(ctx context.Context, request *dto.DeletePostCommunityRequest, userID string) (*dto.DeletePostCommunityResponse, error)
	EditPostCommunity(ctx context.Context, request *dto.EditPostCommunityRequest, userID string) (*dto.EditPostCommunityResponse, error)
}

func NewCommunityService

func NewCommunityService(log *logrus.Entry, db *db.Repository) CommunityService

type LikeService

type LikeService interface {
	IncreaseLike(ctx context.Context, request *dto.IncreaseLikeRequest, userID string) (*dto.IncreaseLikeResponse, error)
	ReduceLike(ctx context.Context, request *dto.ReduceLikeRequest, userID string) (*dto.ReduceLikeResponse, error)
	GetLikePost(ctx context.Context, request *dto.GetLikePostRequest, userID string) (*dto.GetLikePostResponse, error)
	GetLikePhoto(ctx context.Context, request *dto.GetLikePhotoRequest, userID string) (*dto.GetLikePhotoResponse, error)
}

func NewLikeService

func NewLikeService(log *logrus.Entry, db *db.Repository) LikeService

type OAuthService

type OAuthService interface {
	AuthenticateThroughTelergam(ctx context.Context, request *dto.AuthenticateThroughTelergamRequest) error
}

func NewOAuthService

func NewOAuthService(log *logrus.Entry, db *db.Repository) OAuthService

type OAuthServiceImpl

type OAuthServiceImpl struct {
	// contains filtered or unexported fields
}

func (*OAuthServiceImpl) AuthenticateThroughTelergam

func (svc *OAuthServiceImpl) AuthenticateThroughTelergam(ctx context.Context, request *dto.AuthenticateThroughTelergamRequest) error

type PostService

type PostService interface {
	CreatePost(ctx context.Context, request *dto.CreatePostRequest, userID string) (*dto.CreatePostResponse, error)
	GetPost(ctx context.Context, request *dto.GetPostRequest, userID string) (*dto.GetPostResponse, error)
	EditPost(ctx context.Context, request *dto.EditPostRequest, userID string) (*dto.EditPostResponse, error)
	DeletePost(ctx context.Context, request *dto.DeletePostRequest, userID string) (*dto.DeletePostResponse, error)
}

func NewPostService

func NewPostService(log *logrus.Entry, db *db.Repository) PostService

type Registry

type Registry struct {
	AuthService      AuthService
	OAuthService     OAuthService
	UserService      UserService
	PostService      PostService
	FriendsService   FriendsService
	StaticService    StaticService
	ChatService      ChatService
	LikeService      LikeService
	CommunityService CommunityService
	CommentService   CommentService
}

func NewRegistry

func NewRegistry(log *logrus.Entry, repository *db.Repository) *Registry

type StaticService

type StaticService interface {
	UploadImage(ctx context.Context, fileHeader *multipart.FileHeader) (string, error)
	UploadFile(fileHeader *multipart.FileHeader) (string, error)
	UploadFileChat(uuid string, extension string, binaryData string) (string, error)
}

func NewStaticService

func NewStaticService(log *logrus.Entry, db *db.Repository) StaticService

type TestRepository

type TestRepository struct {
	// contains filtered or unexported fields
}

TestRepository ...

func TestRepositories

func TestRepositories(t *testing.T, ctrl *gomock.Controller) (*db.Repository, *TestRepository)

TestRepositories ...

type UserService

type UserService interface {
	GetUserData(ctx context.Context, userID string) (*dto.GetUserResponse, error)
	GetUserPosts(ctx context.Context, request *dto.GetUserPostsRequest) (*dto.GetUserPostsResponse, error)
	GetFeed(ctx context.Context, userID string, request *dto.GetUserFeedRequest) (*dto.GetUserFeedResponse, error)
	GetProfile(ctx context.Context, request *dto.GetProfileRequest) (*dto.GetProfileResponse, error)
	EditProfile(ctx context.Context, request *dto.EditProfileRequest, userID string) (*dto.EditProfileResponse, error)
	UpdatePhoto(ctx context.Context, url string, userID string) (*dto.UpdatePhotoResponse, error)
	SearchUsers(ctx context.Context, request *dto.SearchUsersRequest) (*dto.SearchUsersResponse, error)
}

func NewUserService

func NewUserService(log *logrus.Entry, db *db.Repository) UserService

Jump to

Keyboard shortcuts

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