service

package
v0.0.0-...-bf6c1cb Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinioClient

type MinioClient interface {
	PresignedGetObject(ctx context.Context, bucketName, objectName string, expires time.Duration, reqParams url.Values) (*url.URL, error)
	PresignedPostPolicy(ctx context.Context, p *minio.PostPolicy) (u *url.URL, formData map[string]string, err error)
}

type PostService

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

func NewPostService

func NewPostService(repository core.PostRepository, kafka kafkaClient, minioClient MinioClient, cleanup *cleanup.CleanUpService) *PostService

func (*PostService) CreateCacheUser

func (postService *PostService) CreateCacheUser(ctx context.Context, userID int, username, name string) error

func (*PostService) CreatePost

func (postService *PostService) CreatePost(ctx context.Context, post *models.Post) (*models.Post, error)

func (*PostService) DecreaseLikeCount

func (postService *PostService) DecreaseLikeCount(ctx context.Context, postID int) error

func (*PostService) DeletePost

func (postService *PostService) DeletePost(ctx context.Context, postID int) error

func (*PostService) GenerateUploadURL

func (postService *PostService) GenerateUploadURL(ctx context.Context, filename, contentType string, userID int) (string, map[string]string, error)

func (*PostService) GetUserPosts

func (postService *PostService) GetUserPosts(ctx context.Context, UserID, limit int64, cursor string) (*dto.PaginatedResponse, error)

func (*PostService) IncreaseLikeCount

func (postService *PostService) IncreaseLikeCount(ctx context.Context, postID int) error

func (*PostService) ListPosts

func (postService *PostService) ListPosts(ctx context.Context) ([]models.Post, error)

func (*PostService) UpdatePost

func (postService *PostService) UpdatePost(ctx context.Context, postID int, title, content, image string) (*models.Post, error)

Jump to

Keyboard shortcuts

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