Documentation ¶
Index ¶
- Constants
- func NewServer(config util.Config, repository port.Service, logger port.Logger) port.Server
- type Server
- func (server *Server) CreateArticle(ctx context.Context, req *pb.CreateArticleRequest) (*pb.ArticleResponse, error)
- func (server *Server) CreateComment(ctx context.Context, req *pb.CreateCommentRequest) (*pb.CommentResponse, error)
- func (server *Server) CurrentUser(ctx context.Context, _ *emptypb.Empty) (*pb.UserResponse, error)
- func (server *Server) DeleteArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.Response, error)
- func (server *Server) DeleteComment(ctx context.Context, req *pb.GetCommentRequest) (*pb.Response, error)
- func (server *Server) FavoriteArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.ArticleResponse, error)
- func (server *Server) FeedArticle(ctx context.Context, req *pb.FilterArticleRequest) (*pb.ArticlesResponse, error)
- func (server *Server) FollowUser(ctx context.Context, req *pb.GetProfileRequest) (*pb.ProfileResponse, error)
- func (server *Server) GetArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.ArticleResponse, error)
- func (server *Server) GetProfile(ctx context.Context, req *pb.GetProfileRequest) (*pb.ProfileResponse, error)
- func (server *Server) ListArticle(ctx context.Context, req *pb.FilterArticleRequest) (*pb.ArticlesResponse, error)
- func (server *Server) ListComment(ctx context.Context, req *pb.ListCommentRequest) (*pb.CommentsResponse, error)
- func (server *Server) ListTag(ctx context.Context, _ *emptypb.Empty) (*pb.ListTagResponse, error)
- func (server *Server) Logger(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (resp any, err error)
- func (server *Server) LoginUser(ctx context.Context, req *pb.LoginUserRequest) (*pb.UserResponse, error)
- func (server *Server) RegisterUser(ctx context.Context, req *pb.RegisterUserRequest) (*pb.UserResponse, error)
- func (server *Server) Start() error
- func (server *Server) UnFavoriteArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.ArticleResponse, error)
- func (server *Server) UnFollowUser(ctx context.Context, req *pb.GetProfileRequest) (*pb.ProfileResponse, error)
- func (server *Server) UpdateArticle(ctx context.Context, req *pb.UpdateArticleRequest) (*pb.ArticleResponse, error)
- func (server *Server) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.UserResponse, error)
Constants ¶
View Source
const (
DefaultPaginationSize = 20
)
View Source
const TypeGrpc = "grpc"
Variables ¶
This section is empty.
Functions ¶
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) DeleteArticle ¶
func (*Server) DeleteComment ¶
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) 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) 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)
Click to show internal directories.
Click to hide internal directories.