service

package
v0.0.0-...-3dfe287 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 18 Imported by: 0

README

Service

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is service providers.

Functions

func MapBizPost2Pb

func MapBizPost2Pb(a *biz.Post, b *pb.Post)

func MapCreatePbPost2Biz

func MapCreatePbPost2Biz(a *pb.CreatePostRequest, b *biz.Post)

func MapUpdatePbPost2Biz

func MapUpdatePbPost2Biz(a *pb.UpdatePost, b *biz.Post)

func NewGrpcServerRegister

func NewGrpcServerRegister(post *PostService) kitgrpc.ServiceRegister

func NewHttpServerRegister

func NewHttpServerRegister(
	resEncoder khttp.EncodeResponseFunc,
	errEncoder khttp.EncodeErrorFunc,
	post *PostService) kithttp.ServiceRegister

Types

type PostService

type PostService struct {
	pb.UnimplementedPostServiceServer
	// contains filtered or unexported fields
}

func NewPostService

func NewPostService(repo biz.PostRepo, auth authz.Service) *PostService

func (*PostService) CreatePost

func (s *PostService) CreatePost(ctx context.Context, req *pb.CreatePostRequest) (*pb.Post, error)

func (*PostService) DeletePost

func (s *PostService) DeletePost(ctx context.Context, req *pb.DeletePostRequest) (*pb.DeletePostReply, error)

func (*PostService) GetPost

func (s *PostService) GetPost(ctx context.Context, req *pb.GetPostRequest) (*pb.Post, error)

func (*PostService) ListPost

func (s *PostService) ListPost(ctx context.Context, req *pb.ListPostRequest) (*pb.ListPostReply, error)

func (*PostService) UpdatePost

func (s *PostService) UpdatePost(ctx context.Context, req *pb.UpdatePostRequest) (*pb.Post, error)

Jump to

Keyboard shortcuts

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