api

package
v0.0.0-...-2c8b9bc Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPaginationSize = 20
)
View Source
const TypeGrpc = "grpc"

Variables

This section is empty.

Functions

func NewServer

func NewServer(config util.Config, repository port.Service, logger port.Logger) port.Server

Types

type Server

type Server struct {
	pb.UnimplementedRealWorldServer
	// contains filtered or unexported fields
}

func (*Server) CreateArticle

func (server *Server) CreateArticle(ctx context.Context, req *pb.CreateArticleRequest) (*pb.ArticleResponse, error)

func (*Server) CreateComment

func (server *Server) CreateComment(ctx context.Context, req *pb.CreateCommentRequest) (*pb.CommentResponse, error)

func (*Server) CurrentUser

func (server *Server) CurrentUser(ctx context.Context, _ *emptypb.Empty) (*pb.UserResponse, error)

func (*Server) DeleteArticle

func (server *Server) DeleteArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.Response, error)

func (*Server) DeleteComment

func (server *Server) DeleteComment(ctx context.Context, req *pb.GetCommentRequest) (*pb.Response, error)

func (*Server) FavoriteArticle

func (server *Server) FavoriteArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.ArticleResponse, error)

func (*Server) FeedArticle

func (server *Server) FeedArticle(ctx context.Context, req *pb.FilterArticleRequest) (*pb.ArticlesResponse, error)

func (*Server) FollowUser

func (server *Server) FollowUser(ctx context.Context, req *pb.GetProfileRequest) (*pb.ProfileResponse, error)

func (*Server) GetArticle

func (server *Server) GetArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.ArticleResponse, error)

func (*Server) GetProfile

func (server *Server) GetProfile(ctx context.Context, req *pb.GetProfileRequest) (*pb.ProfileResponse, error)

func (*Server) ListArticle

func (server *Server) ListArticle(ctx context.Context, req *pb.FilterArticleRequest) (*pb.ArticlesResponse, error)

func (*Server) ListComment

func (server *Server) ListComment(ctx context.Context, req *pb.ListCommentRequest) (*pb.CommentsResponse, error)

func (*Server) ListTag

func (server *Server) ListTag(ctx context.Context, _ *emptypb.Empty) (*pb.ListTagResponse, error)

func (*Server) Logger

func (server *Server) Logger(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)

func (*Server) LoginUser

func (server *Server) LoginUser(ctx context.Context, req *pb.LoginUserRequest) (*pb.UserResponse, error)

func (*Server) RegisterUser

func (server *Server) RegisterUser(ctx context.Context, req *pb.RegisterUserRequest) (*pb.UserResponse, error)

func (*Server) Start

func (server *Server) Start() error

func (*Server) UnFavoriteArticle

func (server *Server) UnFavoriteArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.ArticleResponse, error)

func (*Server) UnFollowUser

func (server *Server) UnFollowUser(ctx context.Context, req *pb.GetProfileRequest) (*pb.ProfileResponse, error)

func (*Server) UpdateArticle

func (server *Server) UpdateArticle(ctx context.Context, req *pb.UpdateArticleRequest) (*pb.ArticleResponse, error)

func (*Server) UpdateUser

func (server *Server) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.UserResponse, error)

Jump to

Keyboard shortcuts

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