Documentation ¶
Index ¶
- func NewClient(logger log.Logger, conf *config.Config) (v1.CommentServiceClient, error)
- func NewServer(logger log.Logger, repo Repository) v1.CommentServiceServer
- type Comment
- type Repository
- type Server
- func (s Server) CreateComment(ctx context.Context, req *v1.CreateCommentRequest) (*v1.CreateCommentResponse, error)
- func (s Server) CreateCommentCompensate(ctx context.Context, req *v1.CreateCommentRequest) (*v1.CreateCommentResponse, error)
- func (s Server) DeleteComment(ctx context.Context, req *v1.DeleteCommentRequest) (*v1.DeleteCommentResponse, error)
- func (s Server) DeleteCommentCompensate(ctx context.Context, req *v1.DeleteCommentRequest) (*v1.DeleteCommentResponse, error)
- func (s Server) DeleteCommentsByPostID(ctx context.Context, req *v1.DeleteCommentsByPostIDRequest) (*v1.DeleteCommentsByPostIDResponse, error)
- func (s Server) DeleteCommentsByPostIDCompensate(ctx context.Context, req *v1.DeleteCommentsByPostIDRequest) (*v1.DeleteCommentsByPostIDResponse, error)
- func (s Server) GetComment(ctx context.Context, req *v1.GetCommentRequest) (*v1.GetCommentResponse, error)
- func (s Server) GetCommentByUUID(ctx context.Context, req *v1.GetCommentByUUIDRequest) (*v1.GetCommentByUUIDResponse, error)
- func (s Server) ListCommentsByPostID(ctx context.Context, req *v1.ListCommentsByPostIDRequest) (*v1.ListCommentsByPostIDResponse, error)
- func (s Server) UpdateComment(ctx context.Context, req *v1.UpdateCommentRequest) (*v1.UpdateCommentResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(logger log.Logger, repo Repository) v1.CommentServiceServer
Types ¶
type Repository ¶
type Repository interface { Create(ctx context.Context, comment *Comment) error Update(ctx context.Context, comment *Comment) error UpdateWithUnscoped(ctx context.Context, comment *Comment) error UpdateByPostIDWithUnscoped(ctx context.Context, postID uint64, comment Comment) error Delete(ctx context.Context, id uint64) error DeleteByUUID(ctx context.Context, uuid string) error DeleteByPostID(ctx context.Context, postID uint64) error ListByPostID(ctx context.Context, postID uint64, offset, limit int) ([]*Comment, error) ListByPostIDWithUnscoped(ctx context.Context, postID uint64) ([]*Comment, error) Get(ctx context.Context, id uint64) (*Comment, error) GetWithUnscoped(ctx context.Context, id uint64) (*Comment, error) GetByUUID(ctx context.Context, uuid string) (*Comment, error) CountByPostID(ctx context.Context, postID uint64) (uint64, error) }
func NewRepository ¶
func NewRepository(logger log.Logger, db *dbcontext.DB) Repository
type Server ¶
type Server struct { v1.UnimplementedCommentServiceServer // contains filtered or unexported fields }
func (Server) CreateComment ¶
func (s Server) CreateComment(ctx context.Context, req *v1.CreateCommentRequest) (*v1.CreateCommentResponse, error)
func (Server) CreateCommentCompensate ¶
func (s Server) CreateCommentCompensate(ctx context.Context, req *v1.CreateCommentRequest) (*v1.CreateCommentResponse, error)
func (Server) DeleteComment ¶
func (s Server) DeleteComment(ctx context.Context, req *v1.DeleteCommentRequest) (*v1.DeleteCommentResponse, error)
func (Server) DeleteCommentCompensate ¶
func (s Server) DeleteCommentCompensate(ctx context.Context, req *v1.DeleteCommentRequest) (*v1.DeleteCommentResponse, error)
func (Server) DeleteCommentsByPostID ¶
func (s Server) DeleteCommentsByPostID(ctx context.Context, req *v1.DeleteCommentsByPostIDRequest) (*v1.DeleteCommentsByPostIDResponse, error)
func (Server) DeleteCommentsByPostIDCompensate ¶
func (s Server) DeleteCommentsByPostIDCompensate(ctx context.Context, req *v1.DeleteCommentsByPostIDRequest) (*v1.DeleteCommentsByPostIDResponse, error)
func (Server) GetComment ¶
func (s Server) GetComment(ctx context.Context, req *v1.GetCommentRequest) (*v1.GetCommentResponse, error)
func (Server) GetCommentByUUID ¶
func (s Server) GetCommentByUUID(ctx context.Context, req *v1.GetCommentByUUIDRequest) (*v1.GetCommentByUUIDResponse, error)
func (Server) ListCommentsByPostID ¶
func (s Server) ListCommentsByPostID(ctx context.Context, req *v1.ListCommentsByPostIDRequest) (*v1.ListCommentsByPostIDResponse, error)
func (Server) UpdateComment ¶
func (s Server) UpdateComment(ctx context.Context, req *v1.UpdateCommentRequest) (*v1.UpdateCommentResponse, error)
Click to show internal directories.
Click to hide internal directories.