services

package
v0.0.0-...-f1d9a45 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	SignUpUser(*models.SignUpInput) (*models.DBResponse, error)
	SignInUser(*models.SignInInput) (*models.DBResponse, error)
}

func NewAuthService

func NewAuthService(collection *mongo.Collection, ctx context.Context) AuthService

type AuthServiceImpl

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

func (*AuthServiceImpl) SignInUser

func (*AuthServiceImpl) SignUpUser

func (uc *AuthServiceImpl) SignUpUser(user *models.SignUpInput) (*models.DBResponse, error)

type PostService

type PostService interface {
	CreatePost(*models.CreatePostRequest) (*models.DBPost, error)
	UpdatePost(string, *models.UpdatePost) (*models.DBPost, error)
	FindPostById(string) (*models.DBPost, error)
	FindPosts(page int, limit int) ([]*models.DBPost, error)
	DeletePost(string) error
}

func NewPostService

func NewPostService(postCollection *mongo.Collection, ctx context.Context) PostService

type PostServiceImpl

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

func (*PostServiceImpl) CreatePost

func (p *PostServiceImpl) CreatePost(post *models.CreatePostRequest) (*models.DBPost, error)

func (*PostServiceImpl) DeletePost

func (p *PostServiceImpl) DeletePost(id string) error

func (*PostServiceImpl) FindPostById

func (p *PostServiceImpl) FindPostById(id string) (*models.DBPost, error)

func (*PostServiceImpl) FindPosts

func (p *PostServiceImpl) FindPosts(page int, limit int) ([]*models.DBPost, error)

func (*PostServiceImpl) UpdatePost

func (p *PostServiceImpl) UpdatePost(id string, data *models.UpdatePost) (*models.DBPost, error)

type UserService

type UserService interface {
	FindUserById(id string) (*models.DBResponse, error)
	FindUserByEmail(email string) (*models.DBResponse, error)
	UpdateUserById(id string, data *models.UpdateInput) (*models.DBResponse, error)
}

func NewUserServiceImpl

func NewUserServiceImpl(collection *mongo.Collection, ctx context.Context) UserService

type UserServiceImpl

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

func (*UserServiceImpl) FindUserByEmail

func (us *UserServiceImpl) FindUserByEmail(email string) (*models.DBResponse, error)

func (*UserServiceImpl) FindUserById

func (us *UserServiceImpl) FindUserById(id string) (*models.DBResponse, error)

func (*UserServiceImpl) UpdateUserById

func (uc *UserServiceImpl) UpdateUserById(id string, data *models.UpdateInput) (*models.DBResponse, error)

Jump to

Keyboard shortcuts

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