MCPcopy Index your code
hub / github.com/dreamsofcode-io/grpc / ReadOne

Method ReadOne

pokemon-api/pokedex/server.go:88–100  ·  view source on GitHub ↗
(
	ctx context.Context,
	req *pb.PokemonID,
)

Source from the content-addressed store, hash-verified

86}
87
88func (s *Server) ReadOne(
89 ctx context.Context,
90 req *pb.PokemonID,
91) (*pb.Pokemon, error) {
92 pokemon, err := s.repository.FindByID(ctx, req.Id)
93 if err != nil {
94 return nil, status.Errorf(codes.NotFound, "failed to find pokemon")
95 }
96
97 res := pokemonToResponse(pokemon)
98
99 return &res, nil
100}
101
102func (s *Server) Update(
103 ctx context.Context,

Callers

nothing calls this directly

Calls 2

pokemonToResponseFunction · 0.85
FindByIDMethod · 0.80

Tested by

no test coverage detected