posts

package
v0.44.47 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Posts routes and controllers logic package for the backend.

Index

Constants

View Source
const (
	PKG_NAME = "posts"
)

Variables

This section is empty.

Functions

func NewPostRepository added in v0.44.22

func NewPostRepository(cache db.Cacher) models.PostRepositoryInterface

func NewPostService added in v0.44.26

func NewPostService(
	postRepository models.PostRepositoryInterface,
	userRepository models.UserRepositoryInterface,
) models.PostServiceInterface

func Router

func Router() chi.Router

Types

type PostRepository added in v0.44.22

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

The implementation of pkg/models.PostRepositoryInterface.

func (*PostRepository) Delete added in v0.44.22

func (r *PostRepository) Delete(postID string) error

func (*PostRepository) GetAll added in v0.44.22

func (r *PostRepository) GetAll() (*map[string]models.Post, error)

func (*PostRepository) GetByID added in v0.44.22

func (r *PostRepository) GetByID(postID string) (*models.Post, error)

func (*PostRepository) GetPage added in v0.44.24

func (r *PostRepository) GetPage(pageOpts interface{}) (*map[string]models.Post, *map[string]models.User, error)

func (*PostRepository) Save added in v0.44.22

func (r *PostRepository) Save(post *models.Post) error

type PostService added in v0.44.26

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

func (*PostService) Create added in v0.44.26

func (s *PostService) Create(ctx context.Context, post *models.Post) error

func (*PostService) Delete added in v0.44.26

func (s *PostService) Delete(ctx context.Context, postID string) error

func (*PostService) FindAll added in v0.44.26

func (s *PostService) FindAll(ctx context.Context) (*map[string]models.Post, *models.User, error)

func (*PostService) FindByID added in v0.44.26

func (s *PostService) FindByID(ctx context.Context, postID string) (*models.Post, *models.User, error)

func (*PostService) FindPage added in v0.44.37

func (s *PostService) FindPage(ctx context.Context, opts interface{}) (*map[string]models.Post, *map[string]models.User, error)

func (*PostService) Update added in v0.44.26

func (s *PostService) Update(ctx context.Context, post *models.Post) error

Jump to

Keyboard shortcuts

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