Documentation ¶
Index ¶
- type Server
- func (s *Server) CreateTodo(ctx context.Context, in *youji.NewTodo) (todo *youji.Todo, err error)
- func (s *Server) GetTodos(ctx context.Context, in *youji.GetTodosParams) (results *youji.Todos, err error)
- func (s *Server) RegisterServer(srv *ggrpc.Server)
- func (s *Server) StartServer()
- func (s *Server) UpdateTodo(ctx context.Context, in *youji.UpdateTodoParams) (todo *youji.Todo, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { *grpc.Server youji.YoujiServer }
Server defines the structure of a server for the Youji service.
func NewServer ¶
func NewServer(config *service.ServerConfig) *Server
NewServer returns a new gRPC server for the Youji service.
func (*Server) CreateTodo ¶
CreateTodo creates a new todo record.
func (*Server) GetTodos ¶
func (s *Server) GetTodos(ctx context.Context, in *youji.GetTodosParams) (results *youji.Todos, err error)
GetTodos finds all todo records for the current user by user ID.
func (*Server) RegisterServer ¶
RegisterServer registers the gRPC server as a Youji service handler.
func (*Server) StartServer ¶
func (s *Server) StartServer()
StartServer initializes the MongoDB connection and database and starts the server.
func (*Server) UpdateTodo ¶
func (s *Server) UpdateTodo(ctx context.Context, in *youji.UpdateTodoParams) (todo *youji.Todo, err error)
UpdateTodo updates a todo record.
Click to show internal directories.
Click to hide internal directories.