post

package
v0.0.0-...-52cd6b4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePostParams

type CreatePostParams struct {
	UserID model.UserID
	Text   string
}

type DeletePostParams

type DeletePostParams struct {
	PostID model.PostID
}

type GetFeedParams

type GetFeedParams struct {
	FollowerID model.UserID
}

type GetLastPostsParams

type GetLastPostsParams struct {
	Duration time.Duration
}

type GetPostByIDParams

type GetPostByIDParams struct {
	PostID model.PostID
}

type Service

type Service interface {
	Create(ctx context.Context, params *CreatePostParams) (*model.Post, error)
	GetPostByID(ctx context.Context, params *GetPostByIDParams) (*model.Post, error)
	Update(ctx context.Context, params *UpdatePostParams) error
	Delete(ctx context.Context, params *DeletePostParams) error
	GetFeed(ctx context.Context, params *GetFeedParams) ([]*model.Post, error)
	GetLastPosts(ctx context.Context, params *GetLastPostsParams) ([]*model.Post, error)
}

type ServiceImpl

type ServiceImpl struct {
	Storage         storage.Storage
	Cache           cache.Service
	Logger          *zap.Logger
	ProducerService *queue.ProducerService
}

func (*ServiceImpl) Create

func (s *ServiceImpl) Create(ctx context.Context, params *CreatePostParams) (*model.Post, error)

func (*ServiceImpl) Delete

func (s *ServiceImpl) Delete(ctx context.Context, params *DeletePostParams) error

func (*ServiceImpl) GetFeed

func (s *ServiceImpl) GetFeed(ctx context.Context, params *GetFeedParams) ([]*model.Post, error)

func (*ServiceImpl) GetLastPosts

func (s *ServiceImpl) GetLastPosts(ctx context.Context, params *GetLastPostsParams) ([]*model.Post, error)

func (*ServiceImpl) GetPostByID

func (s *ServiceImpl) GetPostByID(ctx context.Context, params *GetPostByIDParams) (*model.Post, error)

func (*ServiceImpl) Update

func (s *ServiceImpl) Update(ctx context.Context, params *UpdatePostParams) error

type UpdatePostParams

type UpdatePostParams struct {
	PostID model.PostID
	Text   string
}

Jump to

Keyboard shortcuts

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