services

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostService

type PostService interface {
	AddPost(newPost repository.Post, authorName string) (repository.Post, error)
	UpdatePost(updatedPost repository.Post) (repository.Post, error)
	DeletePost(id string) error
	GetPost(id string) (repository.Post, error)
	GetPosts() ([]repository.Post, int, error)
	GetPostsPage(page int) ([]repository.Post, int, error)
}

PostService interface. Defines post-related business logic.

func CreatePostService

func CreatePostService(cont container.Container) PostService

CreatePostService instantiates the postService using the application container.

type UserService

type UserService interface {
	AuthenticateUser(userID string, password string) (string, error)
	CheckUserPassword(userID string, password string) bool
	GetUser(userID string) (repository.User, error)
	GetUsers() ([]repository.User, int, error)
	GetUsersPage(page int) ([]repository.User, int, error)
	RegisterFirstUser() error
	RegisterUser(userID string, password string) (repository.User, error)
	UpdateUser(userID string, oldPassword string, newPassword string) (repository.User, error)
	DeleteUser(userID string) error
}

UserService interface. Defines user-related business logic.

func CreateUserService

func CreateUserService(cont container.Container) UserService

CreateUserService instantiates the userService using the application container.

Jump to

Keyboard shortcuts

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